question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validation Error: Module jest-circus/runner in the testRunner option was not found.

See original GitHub issue

Description

I recently updated my version of Detox from 19.4.2 to 19.7.1, and now I’m seeing this error when I attempt to run my Detox tests:

Module jest-circus/runner in the testRunner option was not found.
     <rootDir> is: /Users/myuser/Documents/my-app/e2e

config.json

{
    "maxWorkers": 1,
    "testEnvironment": "./environment",
    "testRunner": "jest-circus/runner",
    "testTimeout": 120000,
    "testRegex": "\\.e2e\\.js$",
    "setupFilesAfterEnv": ["./jest.setup.js"],
    "reporters": ["detox/runners/jest/streamlineReporter"],
    "verbose": true
}

environment.js

const {
  DetoxCircusEnvironment,
  SpecReporter,
  WorkerAssignReporter,
} = require('detox/runners/jest-circus')

class CustomDetoxEnvironment extends DetoxCircusEnvironment {
  constructor(config, context) {
    super(config, context)

    // Can be safely removed, if you are content with the default value (=300000ms)
    this.initTimeout = 300000

    // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
    // This is strictly optional.
    this.registerListeners({
      SpecReporter,
      WorkerAssignReporter,
    })
  }
}

module.exports = CustomDetoxEnvironment

Your environment

Detox version: 19.7.1 React Native version: 0.66.3 Node version: 6.12.0 Device model: MacBook Pro, running tests on an android emulator (Pixel API 29 AOSP) OS: macOS Big Sur (11.6.5) Test-runner: jest-circus

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
noomorphcommented, Jun 15, 2022

You need to install jest-circus then:

npm install --save-dev jest-circus@26
0reactions
noomorphcommented, Jun 15, 2022

I can’t say for sure, but actually jest-circus@26 is an optional dependency – you need it only if you run with the old Jest. The modern versions of Jest (27 and 28) have the circus out of the box. Make sure to upgrade your Jest whenever you can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Module * in the testRunner option was not found" when using ...
I just recently created a new React app using create-react-app and when I ejected, it did this. I had to change the Jest...
Read more >
Module jest-circus/runner in the testRunner option was not ...
Module jest -circus/runner in the testRunner option was not found. do this: npm i -dev jest-circus.
Read more >
Accessing jasmine with testRunner set to jest-circus results in ...
You can't access jasmine when you use jest-circus. This is by design. jest-circus is a new test runner that was built from scratch....
Read more >
Configuring Jest
Thresholds for globs are applied to all files matching the glob. If the file specified by path is not found, an error is...
Read more >
jest-circus | Yarn - Package Manager
Refactored TestRunner into SearchSource and improved the "no tests found" message. Added jest.isMockFunction(jest.fn()) to test for mock functions. Improved ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found