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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: options.sourcesRelatedToTestsInChangedFiles.has is not a function #9910

Closed
denchen opened this issue Apr 28, 2020 · 7 comments 路 Fixed by #9915
Closed

TypeError: options.sourcesRelatedToTestsInChangedFiles.has is not a function #9910

denchen opened this issue Apr 28, 2020 · 7 comments 路 Fixed by #9915

Comments

@denchen
Copy link

denchen commented Apr 28, 2020

馃悰 Bug Report

After upgrading to 25.5.0, started seeing an error in Watch mode.

To Reproduce

Run jest as jest --watch, then update some test files. Sample error output:

    TypeError: options.sourcesRelatedToTestsInChangedFiles.has is not a function

      1 | import awsMock from 'aws-sdk-mock';
    > 2 | import {
        | ^
      3 |   asyncWrapper,
      4 |   getEnv,
      5 |   getS3Data,

      at shouldInstrument (node_modules/@jest/transform/build/shouldInstrument.js:191:54)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:614:39)
      at Object.<anonymous> (test/lib/common.test.js:2:1)

envinfo

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.13.0/bin/npm
  npmPackages:
    jest: ^25.5.0 => 25.5.0 

@SimenB
Copy link
Member

SimenB commented Apr 28, 2020

Probably from #9769, /cc @chenesan

@denchen
Copy link
Author

denchen commented Apr 28, 2020

Yeah, seems like it. If I set collectCoverage: false (I was using lcov), then the errors go away.

@SimenB
Copy link
Member

SimenB commented Apr 28, 2020

I'm guessing we're missing serialization and deserialization

https://github.com/facebook/jest/blob/d425a49bd575e7167bc786f3c4f2833589091fa1/packages/jest-runner/src/index.ts#L156-L161
https://github.com/facebook/jest/blob/d425a49bd575e7167bc786f3c4f2833589091fa1/packages/jest-runner/src/testWorker.ts#L89-L92

Ideally we'd somehow tell TS about it so it would have warned us, but for now we should just hotfix this so I can get a patch out. It's 23:30 here though, so I won't get to it until tomorrow.

@chenesan
Copy link
Contributor

I Will look into this tonight, though I'm in UTC+8 and it's 10:00 now here.

@SimenB
Copy link
Member

SimenB commented Apr 29, 2020

Fixed in 25.5.1

@chenesan
Copy link
Contributor

Thanks for the fix!

@github-actions
Copy link

This issue 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 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants