Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When --watch is not supported, restart with --watchAll #329

Merged
merged 1 commit into from
May 20, 2018
Merged

When --watch is not supported, restart with --watchAll #329

merged 1 commit into from
May 20, 2018

Conversation

seanpoulter
Copy link
Member

The change introduced in #325 incorrectly configured the Runner to start with --watchAll enabled. I'll take some of that blame for the unclear API. To use --watchAll you need to set true, true which isn't clear. 😞

Changes proposed in this PR:

  • Change the watch mode flag from a Boolean to an enumeration: none, watch, watchAll
  • Properly start the Runner with --watch and --watchAll
  • Detect the error message when --watch is not supported and restart with --watchAll

Changes not proposed in this PR:

  • No setting to "always use --watchAll" since we can detect when --watch fails
  • Moving the error message detection into jest-editor-support. I know cpojer wants to add integration tests to make sure we catch if the text changes.

Testing:

  • Manually tested using a workspace without a git or hg repo:

    index.test.js:

    describe('Test suite', () => {
      it('Test', () => {
        expect(1).toBe(2);
      })
    })
  • Tests have been updated with a few redundant test cases removed

This will resolve #327.

@seanpoulter seanpoulter requested review from orta and marcinczenko May 20, 2018 07:58
@coveralls
Copy link

Pull Request Test Coverage Report for Build 375

  • 18 of 20 (90.0%) changed or added relevant lines in 4 files are covered.
  • 42 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.006%) to 74.638%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/JestExt.ts 1 3 33.33%
Files with Coverage Reduction New Missed Lines %
src/JestProcessManagement/JestProcess.ts 1 98.11%
src/JestExt.ts 41 53.35%
Totals Coverage Status
Change from base Build 374: 0.006%
Covered Lines: 598
Relevant Lines: 764

💛 - Coveralls

@orta
Copy link
Member

orta commented May 20, 2018

👍 cool, yeah, makes sense

I'll ship a release

@orta orta merged commit 0b726cc into jest-community:master May 20, 2018
legend1202 pushed a commit to legend1202/vscode-jest that referenced this pull request Jun 18, 2023
…ommunity#327/All-tests-should-not-rerun

When --watch is not supported, restart with --watchAll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All tests re-run on every change
3 participants