Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation warnings from jest with jest-mongodb configuration #342

Open
paymog opened this issue May 30, 2022 · 0 comments
Open

Validation warnings from jest with jest-mongodb configuration #342

paymog opened this issue May 30, 2022 · 0 comments

Comments

@paymog
Copy link

paymog commented May 30, 2022

I'm getting the following validation warnings when I try to use jest-mongodb:

● Validation Warning:

  Unknown option "mongodbMemoryServerOptions" with value {"autoStart": false, "binary": {"skipMD5": true, "version": "4.0.3"}, "instance": {}} was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

● Validation Warning:

  Unknown option "mongoURLEnvName" with value "MONGO_URI" was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

here's the jest config I'm using which seems to work because it made the globalConfig.json file upon first usage:

const { jsWithTsESM: tsjPreset } = require("ts-jest/presets");
const mongoServerPreset = require("@shelf/jest-mongodb/jest-preset");

module.exports = {
  ...tsjPreset,
  ...mongoServerPreset,
  globals: {
    "ts-jest": {
      tsconfig: "tsconfig.json"
    }
  },
  moduleFileExtensions: ["ts", "js"],
  testRegex: ".*.test.ts",
  mongodbMemoryServerOptions: {
    binary: {
      version: "4.0.3",
      skipMD5: true
    },
    instance: {},
    autoStart: false
  },
  mongoURLEnvName: "MONGO_URI",
  watchPathIgnorePatterns: ['globalConfig'],
};

I'm starting jest with the following npm script:

  "scripts": {
   // ...
    "test": "jest",
   // ...
  },

How can I configure jest or jest-mongodb correctly such that I don't get the above validation warnings?

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

No branches or pull requests

1 participant