Remove defunct E2E test runner script, add docker scripts to package file.

This commit is contained in:
Jeff Stieler 2020-04-15 11:17:48 -06:00
parent 622e47f29f
commit 17d3771273
2 changed files with 4 additions and 48 deletions

View File

@ -13,8 +13,10 @@
"build": "grunt && npm run makepot",
"build-watch": "grunt watch",
"lint:js": "eslint assets/js --ext=js",
"test:e2e": "./tests/bin/e2e-test-integration.js",
"test:e2e-dev": "./tests/bin/e2e-test-integration.js --dev",
"docker:up": "npm explore @woocommerce/e2e-env -- npm run docker:up",
"docker:down": "npm explore @woocommerce/e2e-env -- npm run docker:down",
"test:e2e": "npm explore @woocommerce/e2e-env -- npm run test:e2e",
"test:e2e-dev": "npm explore @woocommerce/e2e-env -- npm run test:e2e-dev",
"makepot": "composer run-script makepot",
"packages:fix:textdomain": "node ./bin/package-update-textdomain.js",
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install"

View File

@ -1,46 +0,0 @@
#!/usr/bin/env node
const { spawnSync } = require( 'child_process' );
const program = require( 'commander' );
const { useJestPuppeteerConfig } = require( 'puppeteer-utils' );
program
.usage( '<file ...> [options]' )
.option( '--dev', 'Development mode' )
.parse( process.argv );
const testEnvVars = {
NODE_ENV: 'test:e2e',
JEST_PUPPETEER_CONFIG: 'tests/e2e-tests/config/jest-puppeteer.config.js',
NODE_CONFIG_DIR: 'tests/e2e-tests/config',
};
if ( program.dev ) {
testEnvVars.PUPPETEER_HEADLESS = 'false';
testEnvVars.PUPPETEER_SLOWMO = '50';
delete testEnvVars.JEST_PUPPETEER_CONFIG;
useJestPuppeteerConfig();
}
const envVars = Object.assign( {}, process.env, testEnvVars );
let jestProcess = spawnSync(
'jest',
[
'--maxWorkers=1',
'--config=tests/e2e-tests/config/jest.config.js',
'--rootDir=./',
'--verbose',
program.args,
],
{
stdio: 'inherit',
env: envVars,
}
);
console.log( 'Jest exit code: ' + jestProcess.status );
// Pass Jest exit code to npm
process.exit( jestProcess.status );