Instead of using globalSetup and globalTeardown, configure and deploy your test environment from within your init. Just use the joke before and after.
e2e / init.js
const detox = require('detox');
const config = require('../package.json').detox;
jest.setTimeout(120000);
beforeAll(async () => {
console.log('Initializing Detox');
await detox.init(config, { launchApp: false });
});
afterAll(async () => {
await detox.cleanup();
});
e2e / config.json
{
"setupTestFrameworkScriptFile" : "./init.js"
}
source
share