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.

Unknown option "setupFilesAfterEnv" error when running my test file

See original GitHub issue

Hey Im using jest-puppeteer (version 4.1.0). when running my tests i got that alert:

Deprecation Warning: “setupTestFrameworkScriptFile” was replaced by configuration “setupFilesAfterEnv”, which supports multiple paths. Please update your configuration.

but when i replace “setupTestFrameworkScriptFile” with: “setupFilesAfterEnv” i get this error:

Unknown option “setupFilesAfterEnv” with value “<rootDir>/reporters/screenshot.js” was found. This is probably a typing mistake. Fixing it will remove this message.

this is my jest.config.js file content:

module.exports = {
  preset: 'jest-puppeteer',
  globalTeardown: './teardown.js',
  reporters: [
    'default',
    './reporters/slack',
  ],
  setupFilesAfterEnv: ['<rootDir>/reporters/screenshot.js'],
};

what am i doing wrong here? (probably something stupid that im missing)

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
galtubi91commented, Aug 19, 2019

@steveswork thanks a lot for your answer! actually when i upgraded jest-cli to latest version it solved the problem…

but thank you anyway 🙏

2reactions
Bhavikpatel576commented, Apr 4, 2019

I had a similar issue that I also wasn’t able to resolve.


  Unknown option "setupFilesAfterEnv" with value ["./test/jest.timeoutSetup.js"] was found.
  This is probably a typing mistake. Fixing it will remove this message. ```
Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest configuration setupFilesAfterEnv option was not found
I have an error with path of setupFilesAfterEnv or transform . the error i get when i run "yarn test" $ jest __testsv2__...
Read more >
Configuring Jest
By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here...
Read more >
Jest runner doesn't execute "setupFilesAfterEnv" with Jest 24
A script specified in "setupFilesAfterEnv" is not executed in IDEA the same setup runs ... The tests are run correctly only when all...
Read more >
Configuring Vitest
To configure vitest itself, add test property in your Vite config. ... Files to include in the test run, using glob pattern.
Read more >
Configuring Jest compiled - w3resource
When you are using the --config option, the JSON file should not contain a ... Jest will run all tests and will produce...
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