Vue-cli: Debugger statements quit working with unit tests when there is more than one unit test file

Created on 22 Aug 2018  路  2Comments  路  Source: vuejs/vue-cli

Version

3.0.1

Reproduction link

https://github.com/EricRohlfs/vue-cli-unit-debug-issue/

Node and OS info

Node 8.11, NPM 5.6, Vue3.0.1, Windows 10, Jest

Steps to reproduce

  1. Create a new project or just clone this repo and skip to step 5
vue create hello1
  1. Choose manual config and add unit tests and choose Jest as the runner.

  2. add debugger statement in the HelloWorld.js test file.

  3. Run the current test to see if it works - it should

node --inspect-brk ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit
  1. Add a new unit test in the tests/unit folder. (I just copied the existing test and changed a few strings)

  2. Run the tests again using

node --inspect-brk ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit

Now the debugger does not stop on the debugger statements.

What is expected?

Debugger statements work when debugging unit tests.

What is actually happening?

Debugger statements are passed over in unit tests.

Most helpful comment

Jest runs tests in parallel in multiple child processes - if there is more than or test to run.

You will have to use the jest flag --runInBand to make them run synchronously in one process.

Then debug statements should work again.

See: https://jestjs.io/docs/en/troubleshooting

All 2 comments

Jest runs tests in parallel in multiple child processes - if there is more than or test to run.

You will have to use the jest flag --runInBand to make them run synchronously in one process.

Then debug statements should work again.

See: https://jestjs.io/docs/en/troubleshooting

Command below is works. Thanks @LinusBorg

node --inspect-brk ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit --runInBand
Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshuajohnson814 picture joshuajohnson814  路  3Comments

DrSensor picture DrSensor  路  3Comments

b-zee picture b-zee  路  3Comments

wahidrahim picture wahidrahim  路  3Comments

BusyHe picture BusyHe  路  3Comments