I am creating a custom runner for jest
with create-jest-runner
I am following the examples, but I keep receiving the error
TypeError: Cannot read properties of undefined (reading 'startsWith')
at new Worker (/Users/redacted/git/redacted/redacted/redacted/node_modules/create-jest-runner/node_modules/jest-worker/build/index.js:120:20)
at BaseTestRunner._createParallelTestRun (/Users/redacted/git/redacted/redacted/redacted/node_modules/create-jest-runner/build/createJestRunner.js:63:22)
at BaseTestRunner.runTests (/Users/redacted/git/redacted/redacted/redacted/node_modules/create-jest-runner/build/createJestRunner.js:40:119)
at TestScheduler.scheduleTests (/Users/redacted/git/redacted/redacted/redacted/node_modules/@jest/core/build/TestScheduler.js:331:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runJest (/Users/redacted/git/redacted/redacted/redacted/node_modules/@jest/core/build/runJest.js:376:19)
at async _run10000 (/Users/redacted/git/redacted/redacted/redacted/node_modules/@jest/core/build/cli/index.js:416:7)
at async runCLI (/Users/redacted/git/redacted/redacted/redacted/node_modules/@jest/core/build/cli/index.js:271:3)
at async Object.run (/Users/redacted/git/redacted/redacted/redacted/node_modules/jest-cli/build/cli/index.js:163:37)
I am very confused. It doesn’t even get to the runner
before it throws the error. I haven’t seen any documentation on how to fix this. I must be missing something.
Here is the setup I have:
"jest": "^26.6.3",
"create-jest-runner": "^0.12.3",
custom-runner.js
const { createJestRunner } = require("create-jest-runner");
const runner = async ({ testPath }) => {
// Do Something
};
module.exports = createJestRunner(runner);
jest.config.js
module.exports = {
...regularSettings,
runner: "./custom-runner.js",
};