teardown.js 358 B

12345678910111213
  1. const fs = require('fs').promises;
  2. const os = require('os');
  3. const path = require('path');
  4. const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
  5. module.exports = async () => {
  6. // close the browser instance
  7. await global.__BROWSER_GLOBAL__.close();
  8. // clean-up the wsEndpoint file
  9. await fs.rm(DIR, { recursive: true, force: true });
  10. };