-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Version
3.0.3
Reproduction link
https://github.com/davidp-ctg/unit-test-example
Node and OS info
Node 10.10.0 / npm 6.4.1 / Windows 10
Steps to reproduce
- Create an example project with vue create unit-test-example using the following options:
Vue CLI v3.0.3
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router, Vuex, Linter, Unit
? Use history mode for router? (Requires proper server setup for index fallback in production) No
? Pick a linter / formatter config: Airbnb
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Mocha
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In dedicated config files
-
Set a breakpoint in the provided example unit test "example.spec.js" - either by debugger command or setting a breakpoint using your IDE (in my case VS Code)
-
Run the tests with command: node --inspect-brk ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit
-
Attach debugger
What is expected?
Breakpoint is hit and attached debugger is waiting on the line of code with the breakpoint
What is actually happening?
Breakpoint is ignored and tests complete without stopping.
I used the documentation on how to debug the tests under jest plugin:
https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest#debugging-tests
since there is no documentation on how to do it using mocha plugin:
https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-mocha