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

Fix --watchAll #4254

Merged
merged 1 commit into from
Aug 14, 2017
Merged

Fix --watchAll #4254

merged 1 commit into from
Aug 14, 2017

Conversation

rogeliog
Copy link
Contributor

@rogeliog rogeliog commented Aug 11, 2017

Summary

Fixes #4251. To be honest i'm not sure if this is the right fix cc:@cpojer

Test plan

It would be great to add a test to prevent this regression

@aaronabramov
Copy link
Contributor

@rogeliog i made a POC for watch testing, but got stuck on writing to stdin of the subprocess.
#4086

I haven't look much into it, but it seems like we can mock stdin of the spawned process (if we use a jest.js wrapper or something) and have full control over it by dispatching events we need to test it.
I'm pretty sure the solution should be super simple, i just can't figure out what it is :D

@cpojer cpojer merged commit 34f6d3a into jestjs:master Aug 14, 2017
@pedrottimark
Copy link
Contributor

● maps special values to valid options

    expect(received).toMatchObject(expected)
    
    Expected value to match object:
      {"collectCoverage": true, "testEnvironment": "node", "useStderr": true, "watch": true}
    Received:
      {"collectCoverage": true, "testEnvironment": "node", "useStderr": true, "watch": false, "watchAll": true}
    Difference:
    - Expected
    + Received
    
     Object {
       "collectCoverage": true,
       "testEnvironment": "node",
       "useStderr": true,
    -  "watch": true,
    +  "watch": false,
     }

Yeah, it seems like not quite complete:

  • watch in default case doesn’t set watchAll false, parallel with change:
            case 'watchAll':
              options.watch = false;
              options.watchAll = argv[key];
              break;
  • module.exports in jest-config/src/defaults.js doesn’t include watchAll
  • DefaultOptions in types/Config.js doesn’t include watchAll

tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@mts
Copy link

mts commented Sep 6, 2017

Hi there folks,

I intend to upgrade from jest version 20.0.4 to 21.0.1.

I would like to report a behaviour change in 21.0.1 and ask a question with regards to running tests using the --watchAll option.

I am running the following script: jest --watchAll --silent and then filtering tests by filename using w and p to switch to the output of a certain test file. With version 21.0.1 jest does not pick up further changes anymore either in test or implementation files like it used to earlier in version 20.0.4.

Is this change intentional or is it a regression in existing functionality subject to a new fix ?

I would very much like to have the former behaviour because I would like to start with a full list of test output and then switch to the output of one particular test file afterwards and still be able to watch the output reflecting changes in test or implementation files.

Thanks in advance.

@rogeliog
Copy link
Contributor Author

rogeliog commented Sep 8, 2017

@mts seems like a regression... here is the issue for it #4448

@mts
Copy link

mts commented Sep 9, 2017

@rogeliog Thank you very much 👍

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jest --watchAll is broken
6 participants