question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

behaviour of `test:unit --watch` changed?

See original GitHub issue

Version

3.0.0-beta.11

Reproduction link

https://github.com/doppelreim/vue-test-app/tree/test-watch-behaviour

Steps to reproduce

Install dependencies: npm install

Run the unit-tests in “watch-mode”: ./node_modules/.bin/vue-cli-service test:unit --watch

After they have passed, open “Other.spec.ts” and change something. For example, change the expectation from 8 to 7.

Save the file.

The tests are run again, automatically (because of --watch)

What is expected?

At least in beta6, only the tests contained in the file that changed are run again.

What is actually happening?

In beta12, all tests are run again.


I’m not sure, what the actually intended behaviour is. Maybe it should always have been like this. But it is different 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
baamenabarcommented, Nov 8, 2019

I just added "test:unit:watch": "vue-cli-service test:unit --watch" to the scripts section in my package.json, works like a charm.

12reactions
RickMeijercommented, May 1, 2019

Old issue, but maybe some lone googler can use this: For me running npm run test:unit -- --watch works as expected on a newly instantiated project.

See https://docs.npmjs.com/cli/run-script

npm will pass all the arguments after the – directly to your script:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Behaviour Driven Unit Tests - Luke Merrett
Behaviour Driven Unit Tests. "If we change the implementation details, none of our tests should break" - Ian Cooper.
Read more >
Behavior Driven Unit Testing And Integration Testing
This week we explore the benefits of integration tests and unit tests, and how they fit into your behavior-driven development workflow.
Read more >
Unit Testing Behavior of React Components with Test-Driven ...
How to unit test more complex React components with Jest and Enzyme using a test-driven development (TDD) approach.
Read more >
Unit Testing Tutorial – What is, Types & Test Example - Guru99
Unit Test cases should be independent. In case of any enhancements or change in requirements, unit test cases should not be affected. Test...
Read more >
Behavioral Testing of ML Models (Unit tests for machine ...
How can we empower machine learning models with powerful software engineering techniques like unit testing ?Evaluating ML models using a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found