Skip to content

Issue with version 24.3.0 using --changedSince flag #8084

@fakiolinho

Description

@fakiolinho

🐛 Bug Report

I am using Babel 7 and Jest 24. After upgrading to v24.3.0 i have issues with command:

jest --config ./jest.config.json --changedSince=develop

The error i get is this:

ERROR: options.changedFiles.has is not a function
STACK: TypeError: options.changedFiles.has is not a function
    at shouldInstrument (/node_modules/@jest/transform/build/shouldInstrument.js:142:53)
    at _default (/node_modules/@jest/reporters/build/generateEmptyCoverage.js:56:41)
    at Object.worker (/node_modules/@jest/reporters/build/coverage_worker.js:80:45)
    at execFunction (/node_modules/jest-worker/build/workers/processChild.js:155:17)
    at execHelper (/node_modules/jest-worker/build/workers/processChild.js:139:5)
    at execMethod (/node_modules/jest-worker/build/workers/processChild.js:143:5)
    at process.on.request (/node_modules/jest-worker/build/workers/processChild.js:64:7)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Failed to collect coverage from /Header/index.jsx

If i don't use the --changedSince flag at all then tests run smoothly.

In order to tackle this now i am using resolutions in package.json:

"resolutions": {
    "jest": "24.1.0",
    "jest-cli": "24.1.0",
    "jest-config": "24.1.0",
    "babel-jest": "24.1.0"
}

To Reproduce

Add in package.json:

"babel-jest": "^24.3.0",
"jest": "^24.3.0",

and then clear everything with rm -rf node_modules yarn.lock and then install the new ones with yarn

Finally run jest with --changedSince flag:

jest --changedSince=develop

Expected behavior

Jest tests should not fail and run flawlessly

Link to repl or repo (highly encouraged)


Run npx envinfo --preset jest

Paste the results here:

System:
    OS: macOS 10.14
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 10.15.1 - /usr/local/opt/node@10/bin/node
    Yarn: 1.3.2 - ~/.yarn/bin/yarn
    npm: 6.4.1 - /usr/local/opt/node@10/bin/npm
  npmPackages:
    jest: ^24.3.0 => 24.3.1 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions