mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-21 22:30:36 +03:00
Add development watch mode to puppeteer jest tests
This commit is contained in:
+22
-10
@@ -4,6 +4,8 @@ const puppeteerRollupConfig = require('./config/jest-puppeteer.rollup.config.js'
|
||||
|
||||
const testEnvironmentPath = path.resolve(__dirname, './config/jest-puppeteer.env.js');
|
||||
const testServerLoaderPath = path.resolve(__dirname, './config/jest-test-server.loader.js');
|
||||
const jsdomSetupFile = path.resolve(__dirname, './config/jest-jsdom.setup.js');
|
||||
const puppeteerSetupFile = path.resolve(__dirname, './config/jest-puppeteer.setup.js');
|
||||
|
||||
// For a detailed explanation regarding each configuration property, visit:
|
||||
// https://jestjs.io/docs/en/configuration.html
|
||||
@@ -20,26 +22,36 @@ const base = {
|
||||
},
|
||||
};
|
||||
|
||||
const pptrBase = {
|
||||
...base,
|
||||
preset: 'jest-puppeteer',
|
||||
setupFilesAfterEnv: ['expect-puppeteer', puppeteerSetupFile],
|
||||
testMatch: ['**/tests/puppeteer/**/*.test.[jt]s?(x)'],
|
||||
testEnvironment: testEnvironmentPath,
|
||||
coveragePathIgnorePatterns: ['/node_modules/', `/${puppeteerRollupConfig.build}/`],
|
||||
transform: {
|
||||
'^.+\\.[jt]sx?$': 'babel-jest',
|
||||
[`^.+${puppeteerRollupConfig.build}.+${puppeteerRollupConfig.html.output}?$`]: testServerLoaderPath,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
...base,
|
||||
projects: [
|
||||
{
|
||||
...base,
|
||||
displayName: 'jsdom',
|
||||
setupFilesAfterEnv: [jsdomSetupFile],
|
||||
testMatch: ['**/tests/jsdom/**/*.test.[jt]s?(x)'],
|
||||
},
|
||||
{
|
||||
...base,
|
||||
preset: 'jest-puppeteer',
|
||||
...pptrBase,
|
||||
displayName: 'puppeteer',
|
||||
setupFilesAfterEnv: ['expect-puppeteer'],
|
||||
testMatch: ['**/tests/puppeteer/**/*.test.[jt]s?(x)'],
|
||||
testEnvironment: testEnvironmentPath,
|
||||
coveragePathIgnorePatterns: ['/node_modules/', `/${puppeteerRollupConfig.build}/`],
|
||||
transform: {
|
||||
'^.+\\.[jt]sx?$': 'babel-jest',
|
||||
[`^.+${puppeteerRollupConfig.build}.+${puppeteerRollupConfig.html.output}?$`]: testServerLoaderPath,
|
||||
},
|
||||
},
|
||||
{
|
||||
...pptrBase,
|
||||
displayName: 'puppeteer-dev',
|
||||
collectCoverage: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user