Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = async function globalTeardown (globalConfig) {
const teardown = []
// custom teardown
const ipfsd = global.__IPFSD__
if (ipfsd) teardown.push(ipfsd.stop())
// continue with global teardown
teardown.push(teardownDevServer())
teardown.push(teardownPuppeteer(globalConfig))
await Promise.all(teardown)
}
module.exports = async function globalTeardown(jestConfig) {
await teardownPuppeteer(jestConfig);
// shut down Docker container
await dockerShutdownChromium();
// delete websocket from file for next time we run test suites
const endpointPath = path.join(__dirname, '../', 'wsEndpoint');
fs.writeFileSync(endpointPath, '', { encoding: 'utf8' });
};
export async function destroyServer(globalConfig: Config.GlobalConfig) {
serverSetupPromise = undefined;
await teardown();
await teardownPuppeteer(globalConfig);
}
export const destroyServer = async (globalConfig?: Config.GlobalConfig) => {
serverSetupPromise = undefined;
await teardown();
await teardownPuppeteer(globalConfig);
};