test:jest improvements to better support our monorepo (#84848)

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2020-12-14 14:07:50 -08:00 committed by GitHub
parent 6bf83fc37a
commit 504c8739de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 287 additions and 199 deletions

View file

@ -17,29 +17,6 @@
* under the License.
*/
// # Run Jest integration tests
//
// All args will be forwarded directly to Jest, e.g. to watch tests run:
//
// node scripts/jest_integration --watch
//
// or to build code coverage:
//
// node scripts/jest_integration --coverage
//
// See all cli options in https://facebook.github.io/jest/docs/cli.html
process.argv.push('--runInBand');
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();
require('@kbn/test').runJest('jest.config.integration.js');