Skip to content

Commit

Permalink
E2E: add app-level node config dir to path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffstieler committed Apr 15, 2020
1 parent e8efb82 commit 622e47f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/e2e-env/bin/e2e-test-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,25 @@ program
.option( '--dev', 'Development mode' )
.parse( process.argv );

const appPath = getAppPath();

const nodeConfigDirs = [
path.resolve( __dirname, '../config' ),
];

if ( appPath ) {
nodeConfigDirs.unshift(
path.resolve( appPath, 'tests/e2e-tests/config' )
);
}

const testEnvVars = {
NODE_ENV: 'test:e2e',
JEST_PUPPETEER_CONFIG: path.resolve(
__dirname,
'../config/jest-puppeteer.config.js'
),
NODE_CONFIG_DIR: path.resolve(
__dirname,
'../config'
),
NODE_CONFIG_DIR: nodeConfigDirs.join( ':' ),
};

let jestCommand = 'jest';
Expand All @@ -42,7 +51,6 @@ if ( program.dev ) {

const envVars = Object.assign( {}, process.env, testEnvVars );

const appPath = getAppPath();
let configPath = path.resolve( __dirname, '../config/jest.config.js' );

// Look for a Jest config in the dependent app's path.
Expand Down

0 comments on commit 622e47f

Please sign in to comment.