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.
|
|
|
|
*/
|
|
|
|
|
2020-06-20 21:05:09 +02:00
|
|
|
import { run } from 'jest';
|
2018-04-20 21:13:37 +02:00
|
|
|
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, '../../..'),
|
2020-06-02 03:38:53 +02:00
|
|
|
rootDir: resolve(__dirname, '../..'),
|
2019-12-13 23:44:04 +01:00
|
|
|
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
|
|
|
|
2020-06-20 21:05:09 +02:00
|
|
|
return run(argv);
|
2018-04-20 21:13:37 +02:00
|
|
|
}
|