kibana/x-pack/dev-tools/jest/index.js
2020-06-20 21:05:09 +02:00

26 lines
758 B
JavaScript

/*
* 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 { run } from 'jest';
import { resolve } from 'path';
import { createJestConfig } from './create_jest_config';
export function runJest() {
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
const config = JSON.stringify(
createJestConfig({
kibanaDirectory: resolve(__dirname, '../../..'),
rootDir: resolve(__dirname, '../..'),
xPackKibanaDirectory: resolve(__dirname, '../..'),
})
);
const argv = [...process.argv.slice(2), '--config', config];
return run(argv);
}