mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-18 19:00:37 +03:00
switch from puppeteer to playwright
This commit is contained in:
+1
-1
@@ -3,4 +3,4 @@ dist
|
|||||||
types
|
types
|
||||||
.build
|
.build
|
||||||
.coverage
|
.coverage
|
||||||
.pptr
|
.nyc_output
|
||||||
+4
-10
@@ -1,8 +1,8 @@
|
|||||||
const resolve = require('./resolve.config');
|
const resolve = require('./resolve.config');
|
||||||
const puppeteerRollupConfig = require('./config/jest-puppeteer.rollup.config.js');
|
const browserRollupConfig = require('./config/jest-puppeteer.rollup.config.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: ['plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'airbnb', 'prettier'],
|
extends: ['plugin:jest-playwright/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'airbnb', 'prettier'],
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
es2020: true,
|
es2020: true,
|
||||||
@@ -73,7 +73,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['*.test.*', `*${puppeteerRollupConfig.js.input}.*`],
|
files: ['*.test.*', `*${browserRollupConfig.js.input}.*`],
|
||||||
rules: {
|
rules: {
|
||||||
'no-restricted-syntax': 'off',
|
'no-restricted-syntax': 'off',
|
||||||
'@typescript-eslint/ban-ts-comment': 'off',
|
'@typescript-eslint/ban-ts-comment': 'off',
|
||||||
@@ -90,16 +90,10 @@ module.exports = {
|
|||||||
'import/no-unresolved': [
|
'import/no-unresolved': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
ignore: [`\\./${puppeteerRollupConfig.build}/${puppeteerRollupConfig.html.output}$`, `^@/.*`],
|
ignore: [`\\./${browserRollupConfig.build}/${browserRollupConfig.html.output}$`, `^@/.*`],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
globals: {
|
|
||||||
page: true,
|
|
||||||
browser: true,
|
|
||||||
context: true,
|
|
||||||
jestPuppeteer: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
files: ['rollup.config.*'],
|
files: ['rollup.config.*'],
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ node_modules/
|
|||||||
# generated
|
# generated
|
||||||
.build/
|
.build/
|
||||||
.coverage/
|
.coverage/
|
||||||
.pptr/
|
.nyc_output/
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ dist
|
|||||||
types
|
types
|
||||||
.coverage
|
.coverage
|
||||||
.build
|
.build
|
||||||
.pptr
|
.nyc_output
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
const PlaywrightEnvironment = require('jest-playwright-preset/lib/PlaywrightEnvironment').default;
|
||||||
|
const { setupRollupTest, cleanupRollupTest } = require('./jest-browser.rollup.js');
|
||||||
|
|
||||||
|
const buildTests = [];
|
||||||
|
|
||||||
|
class BrowserRollupEnvironment extends PlaywrightEnvironment {
|
||||||
|
constructor(envConfig, envContext) {
|
||||||
|
super(envConfig, envContext);
|
||||||
|
|
||||||
|
this.watch = (envConfig.displayName.name || '').includes('-dev');
|
||||||
|
this.ctx = envContext;
|
||||||
|
this.cfg = envConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
async setup() {
|
||||||
|
const { testPath } = this.ctx;
|
||||||
|
|
||||||
|
if (!buildTests.includes(testPath)) {
|
||||||
|
await cleanupRollupTest(testPath, this.cfg.cache);
|
||||||
|
await setupRollupTest(this.cfg.rootDir, this.ctx.testPath, this.cfg.cache && this.cfg.cacheDirectory, this.watch);
|
||||||
|
buildTests.push(testPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
await super.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
async teardown() {
|
||||||
|
await super.teardown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = BrowserRollupEnvironment;
|
||||||
@@ -8,10 +8,10 @@ const rollupPluginHtml = require('@rollup/plugin-html');
|
|||||||
const rollupPluginStyles = require('rollup-plugin-styles');
|
const rollupPluginStyles = require('rollup-plugin-styles');
|
||||||
const rollupPluginServe = require('rollup-plugin-serve');
|
const rollupPluginServe = require('rollup-plugin-serve');
|
||||||
const rollupPluginLivereload = require('rollup-plugin-livereload');
|
const rollupPluginLivereload = require('rollup-plugin-livereload');
|
||||||
const deploymentConfig = require('./jest-puppeteer.rollup.config.js');
|
const deploymentConfig = require('./jest-browser.rollup.config.js');
|
||||||
|
|
||||||
const rollupConfigName = 'rollup.config.js';
|
const rollupConfigName = 'rollup.config.js';
|
||||||
const cacheFilePrefix = 'jest-puppeteer-overlayscrollbars-cache-';
|
const cacheFilePrefix = 'jest-browser-overlayscrollbars-cache-';
|
||||||
const cacheEncoding = 'utf8';
|
const cacheEncoding = 'utf8';
|
||||||
const cacheHash = 'md5';
|
const cacheHash = 'md5';
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ const setupRollupTest = async (rootDir, testPath, cacheDir, watch) => {
|
|||||||
rollupPluginStyles(),
|
rollupPluginStyles(),
|
||||||
...defaultConfig.pipeline,
|
...defaultConfig.pipeline,
|
||||||
rollupPluginHtml({
|
rollupPluginHtml({
|
||||||
title: `Jest-Puppeteer: ${testName}`,
|
title: `Jest-Browser: ${testName}`,
|
||||||
fileName: deploymentConfig.html.output,
|
fileName: deploymentConfig.html.output,
|
||||||
template: genHtmlTemplateFunc(getHtmlFileContent),
|
template: genHtmlTemplateFunc(getHtmlFileContent),
|
||||||
meta: [{ charset: 'utf-8' }, { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' }],
|
meta: [{ charset: 'utf-8' }, { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' }],
|
||||||
@@ -327,9 +327,9 @@ const setupRollupTest = async (rootDir, testPath, cacheDir, watch) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const cleanupRollupTest = (testPath, cache) => {
|
const cleanupRollupTest = async (testPath, cache) => {
|
||||||
if (!cache) {
|
if (!cache) {
|
||||||
del(path.resolve(path.dirname(testPath), deploymentConfig.build));
|
await del(path.resolve(path.dirname(testPath), deploymentConfig.build));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
jest.setTimeout(60000);
|
||||||
|
context.setDefaultTimeout(60000);
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
const PuppeteerEnvironment = require('jest-environment-puppeteer');
|
|
||||||
// const pti = require('puppeteer-to-istanbul');
|
|
||||||
const { setupRollupTest, cleanupRollupTest } = require('./jest-puppeteer.rollup.js');
|
|
||||||
|
|
||||||
class PuppeteerRollupEnvironment extends PuppeteerEnvironment {
|
|
||||||
constructor(envConfig, envContext) {
|
|
||||||
super(envConfig, envContext);
|
|
||||||
|
|
||||||
this.watch = envConfig.displayName.name === 'puppeteer-dev';
|
|
||||||
this.ctx = envContext;
|
|
||||||
this.cfg = envConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
async setup() {
|
|
||||||
// setup
|
|
||||||
await setupRollupTest(this.cfg.rootDir, this.ctx.testPath, this.cfg.cache && this.cfg.cacheDirectory, this.watch);
|
|
||||||
await super.setup();
|
|
||||||
|
|
||||||
// coverage
|
|
||||||
// const { page } = this.global;
|
|
||||||
// await Promise.all([page.coverage.startCSSCoverage(), page.coverage.startJSCoverage()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
async teardown() {
|
|
||||||
// coverage
|
|
||||||
// const { page } = this.global;
|
|
||||||
// const [jsCoverage, cssCoverage] = await Promise.all([page.coverage.stopJSCoverage(), page.coverage.stopCSSCoverage()]);
|
|
||||||
// pti.write([...jsCoverage, ...cssCoverage], { includeHostname: true, storagePath: './.pptr' });
|
|
||||||
|
|
||||||
// cleanup
|
|
||||||
cleanupRollupTest(this.ctx.testPath, this.cfg.cache);
|
|
||||||
await super.teardown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = PuppeteerRollupEnvironment;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
const setDefaultOptions = require('expect-puppeteer').setDefaultOptions;
|
|
||||||
|
|
||||||
jest.setTimeout(60000);
|
|
||||||
setDefaultOptions({ timeout: 60000 });
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const deploymentConfig = require('./jest-puppeteer.rollup.config.js');
|
const deploymentConfig = require('./jest-browser.rollup.config.js');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const deploymentConfig = require('./jest-puppeteer.rollup.config.js');
|
const deploymentConfig = require('./jest-browser.rollup.config.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
process: (src, filePath) => {
|
process: (src, filePath) => {
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const deploymentConfig = path.resolve(__dirname, './config/jest-puppeteer.rollup.config.js');
|
const deploymentConfig = path.resolve(__dirname, './config/jest-browser.rollup.config.js');
|
||||||
const testServerPath = path.resolve(__dirname, './config/jest-test-server.js');
|
const testServerPath = path.resolve(__dirname, './config/jest-test-server.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
browser: 'chromium',
|
browsers: ['chromium', 'firefox'],
|
||||||
browserContext: 'incognito',
|
collectCoverage: true,
|
||||||
launch: {
|
launchType: 'LAUNCH',
|
||||||
|
launchOptions: {
|
||||||
headless: false,
|
headless: false,
|
||||||
},
|
},
|
||||||
server: {
|
serverOptions: {
|
||||||
command: `node ${testServerPath}`,
|
command: `node ${testServerPath}`,
|
||||||
port: deploymentConfig.port,
|
port: deploymentConfig.port,
|
||||||
launchTimeout: 10000,
|
launchTimeout: 10000,
|
||||||
+20
-14
@@ -1,11 +1,11 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const resolve = require('./resolve.config');
|
const resolve = require('./resolve.config');
|
||||||
const puppeteerRollupConfig = require('./config/jest-puppeteer.rollup.config.js');
|
const browserRollupConfig = require('./config/jest-browser.rollup.config.js');
|
||||||
|
|
||||||
const testServerLoaderPath = path.resolve(__dirname, './config/jest-test-server.loader.js');
|
const testServerLoaderPath = path.resolve(__dirname, './config/jest-test-server.loader.js');
|
||||||
const jsdomSetupFile = path.resolve(__dirname, './config/jest-jsdom.setup.js');
|
const jsdomSetupFile = path.resolve(__dirname, './config/jest-jsdom.setup.js');
|
||||||
const puppeteerTestEnvironmentPath = path.resolve(__dirname, './config/jest-puppeteer.env.js');
|
const browserTestEnvironmentPath = path.resolve(__dirname, './config/jest-browser.env.js');
|
||||||
const puppeteerSetupFile = path.resolve(__dirname, './config/jest-puppeteer.setup.js');
|
const browserSetupFile = path.resolve(__dirname, './config/jest-browser.setup.js');
|
||||||
|
|
||||||
// For a detailed explanation regarding each configuration property, visit:
|
// For a detailed explanation regarding each configuration property, visit:
|
||||||
// https://jestjs.io/docs/en/configuration.html
|
// https://jestjs.io/docs/en/configuration.html
|
||||||
@@ -19,16 +19,16 @@ const base = {
|
|||||||
testPathIgnorePatterns: ['\\\\node_modules\\\\'],
|
testPathIgnorePatterns: ['\\\\node_modules\\\\'],
|
||||||
};
|
};
|
||||||
|
|
||||||
const pptrBase = {
|
const browserBase = {
|
||||||
...base,
|
...base,
|
||||||
preset: 'jest-puppeteer',
|
preset: 'jest-playwright-preset',
|
||||||
setupFilesAfterEnv: ['expect-puppeteer', puppeteerSetupFile],
|
setupFilesAfterEnv: [browserSetupFile],
|
||||||
testMatch: ['**/tests/puppeteer/**/*.test.[jt]s?(x)'],
|
testMatch: ['**/tests/browser/**/*.test.[jt]s?(x)'],
|
||||||
testEnvironment: puppeteerTestEnvironmentPath,
|
testEnvironment: browserTestEnvironmentPath,
|
||||||
coveragePathIgnorePatterns: ['/node_modules/', `/${puppeteerRollupConfig.build}/`],
|
coveragePathIgnorePatterns: ['/node_modules/', `/${browserRollupConfig.build}/`],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.[jt]sx?$': 'babel-jest',
|
'^.+\\.[jt]sx?$': 'babel-jest',
|
||||||
[`^.+${puppeteerRollupConfig.build}.+${puppeteerRollupConfig.html.output}?$`]: testServerLoaderPath,
|
[`^.+${browserRollupConfig.build}.+${browserRollupConfig.html.output}?$`]: testServerLoaderPath,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,12 +42,18 @@ module.exports = {
|
|||||||
testMatch: ['**/tests/jsdom/**/*.test.[jt]s?(x)'],
|
testMatch: ['**/tests/jsdom/**/*.test.[jt]s?(x)'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...pptrBase,
|
...browserBase,
|
||||||
displayName: 'puppeteer',
|
displayName: {
|
||||||
|
name: 'browser',
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...pptrBase,
|
...browserBase,
|
||||||
displayName: 'puppeteer-dev',
|
displayName: {
|
||||||
|
name: 'browser-dev',
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
collectCoverage: false,
|
collectCoverage: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
+12
-10
@@ -15,13 +15,11 @@
|
|||||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||||
"@rollup/plugin-typescript": "^5.0.2",
|
"@rollup/plugin-typescript": "^5.0.2",
|
||||||
"@testing-library/dom": "^7.26.3",
|
"@testing-library/dom": "^7.26.3",
|
||||||
"@types/expect-puppeteer": "^4.4.3",
|
|
||||||
"@types/jest": "^25.2.3",
|
"@types/jest": "^25.2.3",
|
||||||
"@types/jest-environment-puppeteer": "^4.3.2",
|
|
||||||
"@types/puppeteer": "^3.0.1",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^3.7.0",
|
"@typescript-eslint/eslint-plugin": "^3.7.0",
|
||||||
"@typescript-eslint/parser": "^3.7.0",
|
"@typescript-eslint/parser": "^3.7.0",
|
||||||
"babel-jest": "^26.0.1",
|
"babel-jest": "^26.0.1",
|
||||||
|
"babel-plugin-istanbul": "^6.0.0",
|
||||||
"bufferutil": "^4.0.1",
|
"bufferutil": "^4.0.1",
|
||||||
"canvas": "^2.6.1",
|
"canvas": "^2.6.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
@@ -31,22 +29,26 @@
|
|||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.11.0",
|
||||||
"eslint-plugin-import": "^2.22.0",
|
"eslint-plugin-import": "^2.22.0",
|
||||||
"eslint-plugin-jest": "^23.18.0",
|
"eslint-plugin-jest": "^23.18.0",
|
||||||
|
"eslint-plugin-jest-playwright": "^0.2.1",
|
||||||
"eslint-plugin-json": "^2.1.2",
|
"eslint-plugin-json": "^2.1.2",
|
||||||
"eslint-plugin-jsx-a11y": "^6.3.1",
|
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"eslint-plugin-react": "^7.20.3",
|
"eslint-plugin-react": "^7.20.3",
|
||||||
"eslint-plugin-react-hooks": "^4.0.8",
|
"eslint-plugin-react-hooks": "^4.0.8",
|
||||||
"expect-puppeteer": "^4.4.0",
|
"expect-playwright": "^0.3.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"jest": "^26.0.1",
|
"jest": "^26.6.0",
|
||||||
"jest-dev-server": "^4.4.0",
|
"jest-dev-server": "^4.4.0",
|
||||||
"jest-puppeteer": "^4.4.0",
|
"jest-playwright-preset": "^1.4.5",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
|
"playwright": "^1.8.0",
|
||||||
|
"playwright-chromium": "^1.8.0",
|
||||||
|
"playwright-core": "^1.8.0",
|
||||||
|
"playwright-firefox": "^1.8.0",
|
||||||
|
"playwright-webkit": "^1.8.0",
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"prettier-eslint": "^11.0.0",
|
"prettier-eslint": "^11.0.0",
|
||||||
"puppeteer": "^5.2.1",
|
|
||||||
"puppeteer-to-istanbul": "^1.4.0",
|
|
||||||
"rollup": "^2.36.1",
|
"rollup": "^2.36.1",
|
||||||
"rollup-plugin-livereload": "^2.0.0",
|
"rollup-plugin-livereload": "^2.0.0",
|
||||||
"rollup-plugin-prettier": "^2.1.0",
|
"rollup-plugin-prettier": "^2.1.0",
|
||||||
@@ -62,8 +64,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "yarn workspaces run test",
|
"test": "yarn workspaces run test",
|
||||||
"test:jsdom": "yarn workspaces run test:jsdom",
|
"test:jsdom": "yarn workspaces run test:jsdom",
|
||||||
"test:pptr": "yarn workspaces run test:pptr",
|
"test:browser": "yarn workspaces run test:browser",
|
||||||
"test:pptr-dev": "yarn workspaces run test:pptr-dev",
|
"test:browser-dev": "yarn workspaces run test:browser-dev",
|
||||||
"build": "yarn workspaces run build",
|
"build": "yarn workspaces run build",
|
||||||
"lint": "npx eslint --fix ."
|
"lint": "npx eslint --fix ."
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>OverlayScrollbars</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="hi">hi</div>
|
||||||
|
<script type="text/javascript" src="./dist_/overlayscrollbars.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../../jest-playwright.config.base');
|
||||||
@@ -1 +0,0 @@
|
|||||||
module.exports = require('../../jest-puppeteer.config.base');
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --coverage --runInBand --detectOpenHandles",
|
"test": "jest --coverage --runInBand --detectOpenHandles",
|
||||||
"test:jsdom": "jest --coverage --runInBand --detectOpenHandles --selectProjects jsdom --testPathPattern",
|
"test:jsdom": "jest --coverage --runInBand --detectOpenHandles --selectProjects jsdom --testPathPattern",
|
||||||
"test:pptr": "jest --coverage --runInBand --detectOpenHandles --selectProjects puppeteer --testPathPattern",
|
"test:browser": "jest --coverage --runInBand --detectOpenHandles --selectProjects browser --testPathPattern",
|
||||||
"test:pptr-dev": "jest --coverage --runInBand --detectOpenHandles --selectProjects puppeteer-dev --testPathPattern",
|
"test:browser-dev": "jest --coverage --runInBand --detectOpenHandles --selectProjects browser-dev --testPathPattern",
|
||||||
"build": "rollup -c"
|
"build": "rollup -c"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
import 'jest-playwright-preset';
|
||||||
|
import 'expect-playwright';
|
||||||
import { Environment } from 'environment';
|
import { Environment } from 'environment';
|
||||||
import url from './.build/build.html';
|
import url from './.build/build.html';
|
||||||
|
|
||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
import 'jest-playwright-preset';
|
||||||
|
import 'expect-playwright';
|
||||||
import { Environment } from 'environment';
|
import { Environment } from 'environment';
|
||||||
import url from './.build/build.html';
|
import url from './.build/build.html';
|
||||||
|
|
||||||
+4
-3
@@ -1,4 +1,5 @@
|
|||||||
import expectPuppeteer from 'expect-puppeteer';
|
import 'jest-playwright-preset';
|
||||||
|
import 'expect-playwright';
|
||||||
import url from './.build/build.html';
|
import url from './.build/build.html';
|
||||||
|
|
||||||
describe('DOMObserver', () => {
|
describe('DOMObserver', () => {
|
||||||
@@ -7,7 +8,7 @@ describe('DOMObserver', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('test', async () => {
|
test('test', async () => {
|
||||||
await expectPuppeteer(page).toClick('#start');
|
await page.click('#start');
|
||||||
await expectPuppeteer(page).toMatchElement('#testResult.passed');
|
await expect(page).toHaveSelector('#testResult.passed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
+4
-3
@@ -1,4 +1,5 @@
|
|||||||
import expectPuppeteer from 'expect-puppeteer';
|
import 'jest-playwright-preset';
|
||||||
|
import 'expect-playwright';
|
||||||
import url from './.build/build.html';
|
import url from './.build/build.html';
|
||||||
|
|
||||||
describe('SizeObserver', () => {
|
describe('SizeObserver', () => {
|
||||||
@@ -7,7 +8,7 @@ describe('SizeObserver', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('test', async () => {
|
test('test', async () => {
|
||||||
await expectPuppeteer(page).toClick('#start');
|
await page.click('#start');
|
||||||
await expectPuppeteer(page).toMatchElement('#testResult.passed');
|
await expect(page).toHaveSelector('#testResult.passed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
+4
-3
@@ -1,4 +1,5 @@
|
|||||||
import expectPuppeteer from 'expect-puppeteer';
|
import 'jest-playwright-preset';
|
||||||
|
import 'expect-playwright';
|
||||||
import url from './.build/build.html';
|
import url from './.build/build.html';
|
||||||
|
|
||||||
describe('TrinsicObserver', () => {
|
describe('TrinsicObserver', () => {
|
||||||
@@ -7,7 +8,7 @@ describe('TrinsicObserver', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('test', async () => {
|
test('test', async () => {
|
||||||
await expectPuppeteer(page).toClick('#start');
|
await page.click('#start');
|
||||||
await expectPuppeteer(page).toMatchElement('#testResult.passed');
|
await expect(page).toHaveSelector('#testResult.passed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -28,6 +28,7 @@ const rollupConfigDefaults = {
|
|||||||
|
|
||||||
const legacyBabelConfig = {
|
const legacyBabelConfig = {
|
||||||
exclude: isTestEnv ? [/\/core-js\//] : [], // /\/@testing-library\//
|
exclude: isTestEnv ? [/\/core-js\//] : [], // /\/@testing-library\//
|
||||||
|
plugins: isTestEnv ? ['babel-plugin-istanbul'] : [],
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/preset-env',
|
'@babel/preset-env',
|
||||||
|
|||||||
Reference in New Issue
Block a user