Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Config file does not work #102

Closed
MrZordex opened this issue Feb 18, 2021 · 4 comments
Closed

Config file does not work #102

MrZordex opened this issue Feb 18, 2021 · 4 comments

Comments

@MrZordex
Copy link
Contributor

Hi,
I've created a config file root-cause-main\integration-examples\another-jest-and-puppeteer\.root-causerc.json with the following code inside (taken from the example):

{
    "features": {
        "screenshots": {
            "format": "png",
            "fullPage": true
        },
        "networkLogs": true,
        "jestAssertions": true,
        "console": false
    }
}

But the saved screenshots are still .jpg
Is there something I'm missing?
Thanks.

  • node v14.15.5
  • npm 6.14.11
@omril1
Copy link
Collaborator

omril1 commented Feb 18, 2021

It might indicate that the default configuration was used instead of the file.
Is the root-causerc.json in your current directory when running the command, I mean did you 'cd' into root-cause-main\integration-examples\another-jest-and-puppeteer\ before running the command?

@MrZordex
Copy link
Contributor Author

MrZordex commented Feb 18, 2021

@omril1
Yes, I run npm test from another-jest-and-puppeteer directory.

@MrZordex
Copy link
Contributor Author

I've created a root-cause.config.js fine in the root directory with the content:

module.exports = {
    features: {
        screenshots: {
            format: "png",
            fullPage: true
        },
        networkLogs: true,
        jestAssertions: true,
        console: true
    }
}

It works fine now, but I get the following message:

 console.warn
    `require.cache` modification is not permitted

      at Object.notPermittedMethod (node_modules/jest-runtime/build/index.js:1512:44)
      at importFresh (node_modules/cosmiconfig/node_modules/import-fresh/index.js:28:23)
      at loader (node_modules/cosmiconfig/src/loaders.ts:15:18)
      at Explorer.loadFileContent (node_modules/cosmiconfig/src/Explorer.ts:81:32)
      at Explorer.createCosmiconfigResult (node_modules/cosmiconfig/src/Explorer.ts:89:36)
      at Explorer.loadSearchPlace (node_modules/cosmiconfig/src/Explorer.ts:65:31)
      at Explorer.searchDirectory (node_modules/cosmiconfig/src/Explorer.ts:47:27)

Should I just ignore it or am I doing something wrong?

@omril1
Copy link
Collaborator

omril1 commented Feb 23, 2021

Possibly a jest bug (jestjs/jest#9916)?
Seems a bit weird since it says released in 25.5.4 and the example is using 26.
I don't think we are doing any changes to require.cache, and the stack trace does point to this place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants