build: fix eslint issues (#124)
* build: fix eslint issues * build: migrate to Node 16
This commit is contained in:
committed by
GitHub
parent
531a952df3
commit
96ad8afe1d
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-proposal-class-properties"
|
||||
]
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "babel-eslint",
|
||||
"parser": "@babel/eslint-parser",
|
||||
"extends": [
|
||||
"airbnb-base",
|
||||
"plugin:prettier/recommended",
|
||||
|
||||
@@ -13,7 +13,7 @@ const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
||||
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
|
||||
const jestPuppeteerConfig = require('./jest-puppeteer.config');
|
||||
|
||||
module.exports = async function() {
|
||||
module.exports = async function globalSetup() {
|
||||
puppeteer.use(StealthPlugin());
|
||||
const browser = await puppeteer.launch(jestPuppeteerConfig.launch);
|
||||
// store the browser instance so we can teardown it later
|
||||
|
||||
@@ -7,7 +7,7 @@ const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
|
||||
module.exports = async function() {
|
||||
module.exports = async function globalTeardown() {
|
||||
// close the browser instance
|
||||
await global.__BROWSER_GLOBAL__.close();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const { openAddon } = require('./utils/open-addon');
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
const isExtended = process.env.IS_EXTENDED == true;
|
||||
const isExtended = `${process.env.IS_EXTENDED}` === 'true';
|
||||
|
||||
const toMatchImageSnapshot = configureToMatchImageSnapshot({
|
||||
failureThreshold: 0.04,
|
||||
|
||||
@@ -11,10 +11,6 @@ const NodeEnvironment = require('jest-environment-node');
|
||||
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
|
||||
|
||||
class PuppeteerEnvironment extends NodeEnvironment {
|
||||
constructor(config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
async setup() {
|
||||
await super.setup();
|
||||
// get the wsEndpoint
|
||||
|
||||
@@ -25,6 +25,7 @@ const openAddon = async page => {
|
||||
await page.click('div[data-accountrecovery]');
|
||||
await page.waitForTimeout(6000);
|
||||
} catch {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('The "choose account recovery method" page isn\'t shown');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user