Skip to content

Commit d7f226c

Browse files
committed
chore(npm): extract common options to cucumber.js
1 parent 02fb70d commit d7f226c

3 files changed

Lines changed: 11 additions & 20 deletions

File tree

.vscode/launch.json

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,16 @@
1313
"stopOnEntry": false,
1414
"program": "${workspaceRoot}/node_modules/@cucumber/cucumber/bin/cucumber-js",
1515
"args": [
16-
"features/**/*.feature",
17-
"--require",
18-
"env/set-environment-variables.ts",
19-
"--require",
20-
"world/custom-world.ts",
21-
"--require",
22-
"step-definitions/**/*.ts",
23-
"--require",
24-
"hooks/**/*.ts",
25-
"--require-module",
26-
"ts-node/register",
27-
"--format-options" ,
28-
"{\"snippetInterface\": \"async-await\"}",
2916
"--format",
3017
"summary",
3118
"--tags",
3219
"@debug",
33-
"--publish-quiet"
3420
],
3521
"cwd": "${workspaceRoot}",
3622
"runtimeArgs": [
37-
"--nolazy"],
38-
"sourceMaps": true
23+
"--nolazy"
24+
],
25+
"sourceMaps": true
3926
}
4027
]
4128
}

cucumber.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
default:
3+
'features/**/*.feature --require env/set-environment-variables.ts --require world/custom-world.ts --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options \'{"snippetInterface": "async-await"}\' --publish-quiet',
4+
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "rimraf build && npm run format && npm run lint && tsc && npm run cucumber-check",
8-
"cucumber-check": "node ./node_modules/@cucumber/cucumber/bin/cucumber-js features/**/*.feature --dry-run --require env/set-environment-variables.ts --require world/custom-world.ts --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options \"{\\\"snippetInterface\\\": \\\"async-await\\\"}\" --format summary --format progress --format progress-bar --publish-quiet",
9-
"cucumber": "node ./node_modules/@cucumber/cucumber/bin/cucumber-js features/**/*.feature --require env/set-environment-variables.ts --require world/custom-world.ts --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options \"{\\\"snippetInterface\\\": \\\"async-await\\\"}\" --format html:reports/report.html --format summary --format @cucumber/pretty-formatter --format cucumber-console-formatter --publish-quiet",
8+
"cucumber-check": "npx cucumber-js --dry-run --format summary --format progress --format progress-bar",
9+
"cucumber": "npx cucumber-js --format html:reports/report.html --format summary --format @cucumber/pretty-formatter --format cucumber-console-formatter",
1010
"eslint-fix": "eslint ./ --ext .js,.ts,.tsx --fix",
1111
"eslint-init": "eslint --init",
1212
"format": "prettier --write \"**/*.{ts,tsx,css,html}\" ",
1313
"lint": "eslint ./ --ext .js,.ts,.tsx --format visualstudio --no-color --max-warnings 10 --report-unused-disable-directives",
1414
"only": "npm run cucumber -- --tags @only",
1515
"report": "open reports/report.html",
16-
"snippets": "node ./node_modules/@cucumber/cucumber/bin/cucumber-js features/**/*.feature --dry-run --require env/set-environment-variables.ts --require world/custom-world.ts --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options \"{\\\"snippetInterface\\\": \\\"async-await\\\"}\" --format snippets --publish-quiet",
17-
"steps-usage": "node ./node_modules/@cucumber/cucumber/bin/cucumber-js features/**/*.feature --dry-run --require env/set-environment-variables.ts --require world/custom-world.ts --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options \"{\\\"snippetInterface\\\": \\\"async-await\\\"}\" --format usage --publish-quiet",
16+
"snippets": "npx cucumber-js --dry-run --format snippets",
17+
"steps-usage": "npx cucumber-js --dry-run --format usage",
1818
"test": "npm run cucumber"
1919
},
2020
"engines": {

0 commit comments

Comments
 (0)