Closed ArthurHoaro closed 1 year ago
Hey @ArthurHoaro apologies for the trouble from that change.
I think in this case you should be able to just forward the config that should be getting passed to your setup function into the library's setup function like so:
// jest-setup.js
const mongoSetup = require('@shelf/jest-mongodb/lib/setup');
module.exports = async (config) => {
await mongoSetup(config);
};
Does that resolve the issue?
I didn't account for the case of the setup method being wrapped this way. Normally if the preset is just plugged straight into Jest it will always receive that configuration object. Is there something the library should do here to account for this case?
Thanks for your quick response @ajwootto. It's working as expected when passing the configuration to the setup function, as in your example.
I don't think it's necessary to update anything in the lib following this change, I'm glad that it can be solved easily in the setup call.
Hi, when upgrading to the latest version (4.1.3), I get this error when trying to run jest:
I suppose this was introduced by changes in #389 (line).
projectConfig
is undefined for some reason. Maybe it's because I run setup in a globalconfig script?Here is a minimal project to reproduce the issue: https://stackblitz.com/edit/node-yqpcqz