Passing in 'config' option to `jestOpts` does not do anything
Describe the bug
If we have two files, jest.config.js and jest.config.integration.js, the latter will always be ignored of the former despite setting jestOpts to jest.config.integration.js
Describe the bug If we have two files,
jest.config.jsandjest.config.integration.js, the latter will always be ignored of the former despite settingjestOptsto `jest.integration.js.
Hey!
You wrote your config file in two different ways - could that be the problem?
jest.integration.js doesn't match either jest.config.js or jest.config.integration.js
Ah its been awhile since this occurred, I believe I did not have a typo when I was actually testing it though.
Ah its been awhile since this occurred, I believe I did not have a typo when I was actually testing it though.
This particular issue does sound familiar, and I'm not entirely sure what the root cause might be 😕I have tested this explicitly in the past and see at least some options work without issues - might there be something with Jest's runCLI method that strips some of the options perhaps?
Do you have a theory of what it might be?
As a workaround, you can import your jest.config.integration.js and use it in your dockest.ts. For example like this:
// dockest.ts
import { Dockest } from 'dockest'
import config from './jest.config.integration.js'
const dockest = new Dockest({
jestOpts: {
...config,
passWithNoTests: true
})
// Specify the services from the Compose file that should be included in the integration test
const dockestServices = [
{
serviceName: 'myRedis', // Must match a service in the Compose file
},
]
dockest.run(dockestServices)
If your jest config is a function you will have to use the returned config object instead.