kibana/x-pack/tasks/test.ts
Jonathan Budzenski 76d475a64c
Refactor test entry by runner (#44679)
Over the last few years we've increased the number of test runners.
Entry points by test type have become too lage of a category for unique
names, so this moves top level test scripts under yarn and replaces test
types with the runner name.

e.g. `yarn test:browser` -> `yarn test:karma`

Closes #41133

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-18 16:21:36 -06:00

31 lines
943 B
TypeScript

/*
* 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 pluginHelpers from '@kbn/plugin-helpers';
import gulp from 'gulp';
import { getEnabledPlugins } from './helpers/flags';
export const testServerTask = async () => {
throw new Error('server mocha tests are now included in the `node scripts/mocha` script');
};
export const testKarmaTask = async () => {
const plugins = await getEnabledPlugins();
await pluginHelpers.run('testKarma', {
plugins: plugins.join(','),
});
};
export const testKarmaDebugTask = async () => {
const plugins = await getEnabledPlugins();
await pluginHelpers.run('testKarma', {
dev: true,
plugins: plugins.join(','),
});
};
export const testTask = gulp.series(testKarmaTask, testServerTask);