2018-04-20 21:13:37 +02:00
|
|
|
/*
|
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import jest from 'jest';
|
|
|
|
import { resolve } from 'path';
|
|
|
|
|
|
|
|
import { createJestConfig } from './create_jest_config';
|
|
|
|
|
|
|
|
export function runJest() {
|
|
|
|
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
|
2019-12-13 23:44:04 +01:00
|
|
|
const config = JSON.stringify(
|
|
|
|
createJestConfig({
|
|
|
|
kibanaDirectory: resolve(__dirname, '../../..'),
|
|
|
|
xPackKibanaDirectory: resolve(__dirname, '../..'),
|
|
|
|
})
|
|
|
|
);
|
2018-04-20 21:13:37 +02:00
|
|
|
|
2019-12-13 23:44:04 +01:00
|
|
|
const argv = [...process.argv.slice(2), '--config', config];
|
2018-04-20 21:13:37 +02:00
|
|
|
|
|
|
|
return jest.run(argv);
|
|
|
|
}
|