Jest multi-project configuration (#77894)

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2020-12-02 11:42:23 -08:00 committed by GitHub
parent 2ffdf75b6e
commit b593781009
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
177 changed files with 2923 additions and 7690 deletions

View file

@ -29,8 +29,15 @@
//
// 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.js'));
if (process.argv.indexOf('--config') === -1) {
// append correct jest.config if none is provided
var configPath = require('path').resolve(__dirname, '../jest.config.oss.js');
process.argv.push('--config', configPath);
console.log('Running Jest with --config', configPath);
}
require('../src/setup_node_env');
require('../src/dev/jest/cli');
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'test';
}
require('jest').run();