Search code examples
detox

Detox : Please add both arguments to super() call in your environment constructor


I followed the Readme guide to setup detox in a react native project.

detox build works fine. But when I run detox test

I get this error

 FAIL  e2e/firstTest.e2e.jsrun...
  ● Test suite failed to run

    Please add both arguments to super() call in your environment constructor, e.g.:
    
     class CustomDetoxEnvironment extends DetoxCircusEnvironment {
    -  constructor(config) {
    -    super(config);
    +  constructor(config, context) {
    +    super(config, context);
    
    Cannot proceed further. Please fix your custom Detox environment class.
      
      at new CustomDetoxEnvironment (environment.js:9:5)
          at Generator.next (<anonymous>)

detox[227765] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e


Solution

  • Both Jest and jest-circus must be of same version.