improve codebase

This commit is contained in:
Rene
2020-10-25 13:28:23 +01:00
parent 29af442b38
commit 3cd6c2b85d
12 changed files with 177 additions and 70 deletions
+3 -9
View File
@@ -8,7 +8,6 @@ const rollupPluginStyles = require('rollup-plugin-styles');
const deploymentConfig = require('./jest-puppeteer.rollup.config.js');
const rollupConfigName = 'rollup.config.js';
const rollupNodeEnv = 'build';
const cacheFilePrefix = 'jest-puppeteer-overlayscrollbars-cache-';
const cacheEncoding = 'utf8';
const cacheHash = 'md5';
@@ -111,7 +110,7 @@ const genHtmlTemplateFunc = (content) => ({ attributes, files, meta, publicPath,
background: lime;
}
#testResult.passed::before {
content: 'success';
content: 'passed';
}
#testResult.failed {
display: block;
@@ -193,9 +192,6 @@ const setupRollupTest = async (rootDir, testPath, cacheDir) => {
const buildFolderExists = fs.existsSync(path.resolve(testDir, deploymentConfig.build));
if (changed || !buildFolderExists) {
const env = process.env.NODE_ENV;
process.env.NODE_ENV = rollupNodeEnv;
const rollupConfigPath = path.resolve(rootDir, rollupConfigName);
if (fs.existsSync(rollupConfigPath)) {
@@ -208,7 +204,7 @@ const setupRollupTest = async (rootDir, testPath, cacheDir) => {
let rollupConfigObj = rollupConfig(undefined, {
project: rootDir,
overwrite: (rollupConfigDefaults, legacyBabelConfig) => {
overwrite: ({ defaultConfig, legacyBabelConfig }) => {
mergeBabelConfigs(legacyBabelConfig, legacyBabelConfigAssign);
return {
input: path.resolve(testDir, deploymentConfig.js.input),
@@ -221,7 +217,7 @@ const setupRollupTest = async (rootDir, testPath, cacheDir) => {
name: testName,
pipeline: [
rollupPluginStyles(),
...rollupConfigDefaults.pipeline,
...defaultConfig.pipeline,
rollupPluginHtml({
title: `Jest-Puppeteer: ${testName}`,
fileName: deploymentConfig.html.output,
@@ -260,8 +256,6 @@ const setupRollupTest = async (rootDir, testPath, cacheDir) => {
}
}
}
process.env.NODE_ENV = env;
}
};