run-tests.js 670 B

1234567891011121314151617
  1. const dotenv = require( 'dotenv' );
  2. const dotenv_expand = require( 'dotenv-expand' );
  3. const { sync: spawn } = require( 'cross-spawn' );
  4. const { execSync } = require( 'child_process' );
  5. // WP_BASE_URL interpolates LOCAL_PORT, so needs to be parsed by dotenv_expand().
  6. dotenv_expand( dotenv.config() );
  7. const result = spawn( 'node', [ require.resolve( 'puppeteer/install' ) ], {
  8. stdio: 'inherit',
  9. } );
  10. if ( result.status > 0 ) {
  11. process.exit( result.status );
  12. }
  13. // Run the tests, passing additional arguments through to the test script.
  14. execSync( 'wp-scripts test-e2e --config tests/e2e/jest.config.js ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );