Skip to content

Commit

Permalink
Fix running tests in vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
Tallyb committed Sep 29, 2024
1 parent b6083b7 commit e4ca7fe
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 43 deletions.
42 changes: 9 additions & 33 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
{
"name": "debug",
"request": "launch",
"runtimeArgs": [
"./node_modules/.bin/cucumber-js",
"${file}"
],
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"runtimeArgs": ["tsx", "./node_modules/.bin/cucumber-js", "${file}"],
"skipFiles": ["<node_internals>/**"],
"env": {
"DEBUG": "pw:api",
"PWDEBUG": "1"
Expand All @@ -25,16 +19,8 @@
{
"name": "debug-only",
"request": "launch",
"runtimeArgs": [
"./node_modules/.bin/cucumber-js",
"${file}",
"--tags",
"@only"
],
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node",
"runtimeArgs": ["tsx", "./node_modules/.bin/cucumber-js", "${file}", "--tags", "@only"],
"skipFiles": ["<node_internals>/**"],
"env": {
"DEBUG": "pw:api",
"PWDEBUG": "1"
Expand All @@ -46,26 +32,16 @@
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
"skipFiles": ["<node_internals>/**"]
},
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register"
],
"args": ["${relativeFile}"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"cwd": "${workspaceRoot}"
}
]
}
}
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
"prettier.singleQuote": true,
"prettier.trailingComma": "es5",

"cucumberautocomplete.syncfeatures": "./features/**/*.feature",
"cucumberautocomplete.steps": ["src/steps/**/*.ts"],
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"cucumber.glue": ["src/**/*.ts"],
"cucumber.features": ["features/**/*.feature"],
"cucumberTestRunner.env": {
"PWDEBUG": 1,
"NODE_OPTIONS": "--import tsx"
},
"cucumberTestRunner.profile": ""
}
File renamed without changes.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
"cucumber-check": "npm run cucumber 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",
"debug": "PWDEBUG=1 DEBUG=pw:api npm run cucumber ",
"video": "PWVIDEO=1 npm run cucumber ",
"eslint-fix": "eslint ./ --ext .js,.ts,.tsx --fix",
"eslint-init": "eslint --init",
"format": "prettier --write \"**/*.{ts,tsx,css,html}\" ",
"lint": "eslint --no-color --report-unused-disable-directives",
"lint": "eslint",
"only": "npm run cucumber -- --tags @only",
"report": "open reports/report.html",
"snippets": "npm run cucumber features/**/*.feature --dry-run --format snippets",
"steps-usage": "cucumber-js features/**/*.feature --dry-run",
"steps-usage": "tsx $(bin)/cucumber-js features/**/*.feature --dry-run",
"all": "npm run cucumber features/**/*.feature",
"test": "npm run cucumber ",
"test:parallel": "npm run cucumber --parallel=2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* Basic Options */
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
"lib": ["ESNext", "DOM", "DOM.Iterable"],
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
Expand Down Expand Up @@ -36,7 +36,7 @@
"resolveJsonModule": true,
"allowJs": true /* Allow javascript files to be compiled. */,
/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"moduleResolution": "Bundler" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
Expand All @@ -58,5 +58,9 @@
},
"exclude": ["node_modules"],
"include": ["src"],
"files": ["cucumber.mjs", "eslint.config.js"]
"files": ["cucumber.js", "eslint.config.js"],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
}
}

0 comments on commit e4ca7fe

Please sign in to comment.