How to use the jest-dev-server.teardown function in jest-dev-server

To help you get started, we’ve selected a few jest-dev-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ipfs-shipyard / ipfs-webui / test / e2e / setup / global-teardown.js View on Github external
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)
}
github ifiokjr / remirror / support / jest / puppeteer.ts View on Github external
export async function destroyServer(globalConfig: Config.GlobalConfig) {
  serverSetupPromise = undefined;
  await teardown();
  await teardownPuppeteer(globalConfig);
}
github smooth-code / jest-puppeteer / packages / jest-environment-puppeteer / src / global.js View on Github external
export async function teardown(jestConfig = {}) {
  const config = await readConfig()

  if (config.connect) {
    await browser.disconnect()
  } else {
    await browser.close()
  }

  if (!jestConfig.watch && !jestConfig.watchAll) {
    await teardownServer()
  }
}

jest-dev-server

Starts a server before your Jest tests and tears it down after.

MIT
Latest version published 22 days ago

Package Health Score

95 / 100
Full package analysis

Popular jest-dev-server functions