Skip to content

Commit

Permalink
cds-add-cucumber recommends vscode plugin (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
vl-leon authored Nov 21, 2023
1 parent 33bde1d commit 8ede0f2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/cds-add-cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function createTestFeaturesDir() {
}

function createVSCodePluginConfig() {
const content = `{
const settingsJson = `{
// Cucumber for Visual Studio Code (CucumberOpen) https://open-vsx.org/extension/CucumberOpen/cucumber-official
"cucumber.features": [
"test/features/**/*.feature"
Expand All @@ -57,11 +57,17 @@ function createVSCodePluginConfig() {
"cucumberautocomplete.strictGherkinCompletion": true
}
`
mkdir('./.vscode');

const file = './.vscode/settings.json';
const extensionsJson = `{
"recommendations": [
"cucumberopen.cucumber-official",
]
}
`
mkdir('./.vscode');

createFileIfMissing(file, content);
createFileIfMissing('./.vscode/settings.json', settingsJson);
createFileIfMissing('./.vscode/extensions.json', extensionsJson);

}

Expand Down
41 changes: 41 additions & 0 deletions test/bin/testGettingStartedLocallyWithLocalUI5tgz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -e
set -x

ROOT_DIR=`pwd`
DIR=tmp/getting-started-locally-with-local-ui5-tgz
test -d $DIR && rm -r -f $DIR
mkdir -p $DIR
cd $DIR
npm init -y

npm init -w dk -y
npm add -w dk @sap/cds-dk

npm init -w service -y
cd service
rm package.json

npx cds init --add sample
npm add ../../.. || true
test -f ./.vscode/extensions.json && rm ./.vscode/extensions.json
npx cds-add-cucumber
# requireModule does not work with links -> require the steps directly
cat <<EOF >cucumber.yml
default:
require:
- ../../../lib/index.js
EOF

. ${ROOT_DIR}/test/bin/.sapui5.version.sh
. ${ROOT_DIR}/test/bin/.sapui5.tgz.sh
if [ -f ${SAPUI5_ARCHIVE_FILE} ]; then
echo "Found UI5 local archive: ${SAPUI5_ARCHIVE_FILE}"
else
echo "Could not find UI5 local archive"
exit 1
fi

npx cds-add-cucumber-plugin -p local-ui5-tgz -f ./app/index.html

npx cucumber-js test

0 comments on commit 8ede0f2

Please sign in to comment.