Jest multi-project configuration (#77894) (#84826)

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
# Conflicts:
#	src/dev/code_coverage/ingest_coverage/integration_tests/team_assignment.test.js
#	src/plugins/console/jest.config.js
#	x-pack/plugins/canvas/scripts/jest.js
This commit is contained in:
Tyler Smalley 2020-12-02 14:02:21 -08:00 committed by GitHub
parent efeb071da5
commit f9fd733a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
176 changed files with 2921 additions and 7680 deletions

View file

@ -29,9 +29,17 @@
//
// See all cli options in https://facebook.github.io/jest/docs/cli.html
var resolve = require('path').resolve;
process.argv.push('--config', resolve(__dirname, '../src/dev/jest/config.integration.js'));
process.argv.push('--runInBand');
require('../src/setup_node_env');
require('../src/dev/jest/cli');
if (process.argv.indexOf('--config') === -1) {
// append correct jest.config if none is provided
var configPath = require('path').resolve(__dirname, '../jest.config.integration.js');
process.argv.push('--config', configPath);
console.log('Running Jest with --config', configPath);
}
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'test';
}
require('jest').run();