We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to move a load of Lambda functions to MJS, so I have set the type to "module" in package.json.
However, this means the jest-dynamodb-config.js gets interpreted as a module file, buts its commonjs.
I tried changing jest-dynamodb-config.js to jest-dynamodb-config.cjs but it fails with the following:
Error: Jest: Got error running globalSetup - /Users/me/Programming/Work/myproject/node_modules/@shelf/jest-dynamodb/setup.js, reason: Cannot find module '/Users/me/Programming/Work/myproject/jest-dynamodb-config.js'
The text was updated successfully, but these errors were encountered:
Had the same issue, it's covered in the README. My solution:
jest.config.cjs
const {resolve} = require('path'); process.env.JEST_DYNAMODB_CONFIG = resolve(__dirname, './jest-dynamodb-config.cjs'); module.exports = { "preset": "@shelf/jest-dynamodb" }
Sorry, something went wrong.
@brucelay that does work, but in the README, the solution description doesn't mention anything about ESM, modules, mjs etc
No branches or pull requests
I'm trying to move a load of Lambda functions to MJS, so I have set the type to "module" in package.json.
However, this means the jest-dynamodb-config.js gets interpreted as a module file, buts its commonjs.
I tried changing jest-dynamodb-config.js to jest-dynamodb-config.cjs but it fails with the following:
The text was updated successfully, but these errors were encountered: