2019-08-12 10:28:33 +02:00
|
|
|
const dotenv = require( 'dotenv' );
|
|
|
|
const dotenv_expand = require( 'dotenv-expand' );
|
2020-06-26 15:31:11 +02:00
|
|
|
const { sync: spawn } = require( 'cross-spawn' );
|
2019-08-12 10:28:33 +02:00
|
|
|
const { execSync } = require( 'child_process' );
|
|
|
|
|
|
|
|
// WP_BASE_URL interpolates LOCAL_PORT, so needs to be parsed by dotenv_expand().
|
|
|
|
dotenv_expand( dotenv.config() );
|
|
|
|
|
2020-06-26 15:31:11 +02:00
|
|
|
const result = spawn( 'node', [ require.resolve( 'puppeteer/install' ) ], {
|
|
|
|
stdio: 'inherit',
|
|
|
|
} );
|
|
|
|
if ( result.status > 0 ) {
|
|
|
|
process.exit( result.status );
|
|
|
|
}
|
|
|
|
|
2019-08-12 10:28:33 +02:00
|
|
|
// Run the tests, passing additional arguments through to the test script.
|
|
|
|
execSync( 'wp-scripts test-e2e --config tests/e2e/jest.config.js ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
|