How to use the jest-environment-puppeteer.setup function in jest-environment-puppeteer

To help you get started, we’ve selected a few jest-environment-puppeteer 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-init.js View on Github external
module.exports = async function globalSetup (globalConfig) {
  // global setup first
  await setupPuppeteer(globalConfig)
  // http server with webui build
  await setupDevServer({
    command: `ecstatic build --cache=0 --port=${webuiPort}`,
    launchTimeout: 10000,
    port: webuiPort,
    debug: process.env.DEBUG === 'true'
  })
  const endpoint = process.env.E2E_API_URL
  let ipfsd
  let ipfs
  if (endpoint) {
    // create http client for endpoint passed via E2E_API_URL=
    ipfs = ipfsClient({ apiAddr: endpoint })
  } else {
    // use ipfds-ctl to spawn daemon to expose http api used for e2e tests
    const type = process.env.E2E_IPFSD_TYPE || 'go'
github gidztech / jest-puppeteer-docker / src / setup.js View on Github external
console.log('\n');

    const revision =
        process.env.PUPPETEER_CHROMIUM_REVISION ||
        process.env.npm_config_puppeteer_chromium_revision ||
        require(path.resolve(puppeteerConfigPath)).puppeteer.chromium_revision;

    // set the version of Chromium to use based on Puppeteer
    await dockerSetChromiumConfig({ revision, flags: chromiumFlags });

    // launch Chromium in Docker ready for the first test suite
    const endpointPath = path.join(__dirname, '../', 'wsEndpoint');
    const webSocketUri = await dockerRunChromium();
    fs.writeFileSync(endpointPath, webSocketUri);

    await setupPuppeteer(jestConfig);
};
github ifiokjr / remirror / e2e / puppeteer.ts View on Github external
export const setupServer = async (globalConfig: Config.GlobalConfig) => {
  await setup([server]);

  onExit(() => {
    destroyServer().then(() => {
      process.exit();
    });
  });

  await setupPuppeteer(globalConfig);
};
github ifiokjr / remirror / support / jest / puppeteer.ts View on Github external
export async function setupServer(globalConfig: Config.GlobalConfig) {
  await setup([server]);

  onExit(() =>
    Promise.all([teardown(), teardownPuppeteer()]).then(() => {
      process.exit();
    }),
  );

  await setupPuppeteer(globalConfig);
}

jest-environment-puppeteer

Puppeteer environment for Jest.

MIT
Latest version published 13 days ago

Package Health Score

86 / 100
Full package analysis

Popular jest-environment-puppeteer functions