El Dude
El Dude

Reputation: 5618

VueCLI / Node inspect finds no test on windows host while container can

I am trying to enable step by step debugging of a JEST unit test. I have two approaches - on the windows host and in a ubuntu docker container. Ubuntu container

node ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit -- ./path/to/file.spec.ts

runs the test successfully.

On windows host:

node ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit -- .\path\to\file.spec.ts                             
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\Users\HrabeT\Work\Plates\frontend
  266 files checked.
  testMatch: **/tests/unit/**/*.spec.[jt]s?(x), **/__tests__/*.[jt]s?(x) - 4 matches
  testPathIgnorePatterns: \\node_modules\\ - 266 matches
  testRegex:  - 0 matches
Pattern: .\path\to\file.spec.ts - 0 matches

Same node version in container and on host. My aim is to debug the test step by step with node inspect but I can not get the host chrome to connect to the container session so I am trying to run it on the host. Yet it fails with understanding the file?

My tests are in ./tests/unit/path/to/file and here is the jest config

  2 module.exports = {
  3   preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel",
  4   moduleNameMapper: {
  5     "^@/(.*)$": "<rootDir>/src/$1",
  6   },
  7   transformIgnorePatterns: ["/node_modules/"],
  8   // setupFiles: [
  9   //   "./tests/unit/setup.ts",
 10   // ],
 11 };

Dont mind the paths too much, I adjusted them for reading simplicity...

Upvotes: 1

Views: 31

Answers (0)

Related Questions