diff --git a/docs/developer/architecture/code-exploration.asciidoc b/docs/developer/architecture/code-exploration.asciidoc index f18a6c2f14926..4481dea44795c 100644 --- a/docs/developer/architecture/code-exploration.asciidoc +++ b/docs/developer/architecture/code-exploration.asciidoc @@ -524,9 +524,9 @@ WARNING: Missing README. See Configuring security in Kibana. -- {kib-repo}blob/{branch}/x-pack/plugins/security_solution[securitySolution] +- {kib-repo}blob/{branch}/x-pack/plugins/security_solution/README.md[securitySolution] -WARNING: Missing README. +Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing. - {kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore] diff --git a/docs/developer/contributing/development-tests.asciidoc b/docs/developer/contributing/development-tests.asciidoc index 78a2a90b69ce5..2e40f664faba9 100644 --- a/docs/developer/contributing/development-tests.asciidoc +++ b/docs/developer/contributing/development-tests.asciidoc @@ -26,8 +26,6 @@ root) |Functional |`test/*integration/**/config.js` `test/*functional/**/config.js` `test/accessibility/config.js` |`yarn test:ftr:server --config test/[directory]/config.js``yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp` - -|Karma |`src/**/public/__tests__/*.js` |`yarn test:karma:debug` |=== For X-Pack tests located in `x-pack/` see diff --git a/docs/developer/contributing/development-unit-tests.asciidoc b/docs/developer/contributing/development-unit-tests.asciidoc index 8b4954150bb5b..5322106b17ac1 100644 --- a/docs/developer/contributing/development-unit-tests.asciidoc +++ b/docs/developer/contributing/development-unit-tests.asciidoc @@ -95,38 +95,6 @@ to proceed in this mode. node scripts/mocha --debug ---- -With `yarn test:karma`, you can run only the browser tests. Coverage -reports are available for browser tests by running -`yarn test:coverage`. You can find the results under the `coverage/` -directory that will be created upon completion. - -[source,bash] ----- -yarn test:karma ----- - -Using `yarn test:karma:debug` initializes an environment for debugging -the browser tests. Includes an dedicated instance of the {kib} server -for building the test bundle, and a karma server. When running this task -the build is optimized for the first time and then a karma-owned -instance of the browser is opened. Click the "`debug`" button to open a -new tab that executes the unit tests. - -[source,bash] ----- -yarn test:karma:debug ----- - -In the screenshot below, you’ll notice the URL is -`localhost:9876/debug.html`. You can append a `grep` query parameter -to this URL and set it to a string value which will be used to exclude -tests which don’t match. For example, if you changed the URL to -`localhost:9876/debug.html?query=my test` and then refreshed the -browser, you’d only see tests run which contain "`my test`" in the test -description. - -image:http://i.imgur.com/DwHxgfq.png[Browser test debugging] - [discrete] === Unit Testing Plugins @@ -141,5 +109,4 @@ command from your plugin: [source,bash] ---- yarn test:mocha -yarn test:karma:debug # remove the debug flag to run them once and close ---- \ No newline at end of file diff --git a/package.json b/package.json index ee91c59a8fda6..0c49ec26be194 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,6 @@ "kbn": "node scripts/kbn", "es": "node scripts/es", "test": "grunt test", - "test:karma": "grunt test:karma", - "test:karma:debug": "grunt test:karmaDebug", "test:jest": "node scripts/jest", "test:jest_integration": "node scripts/jest_integration", "test:mocha": "node scripts/mocha", @@ -447,7 +445,6 @@ "grunt-available-tasks": "^0.6.3", "grunt-cli": "^1.2.0", "grunt-contrib-watch": "^1.1.0", - "grunt-karma": "^3.0.2", "grunt-peg": "^2.0.1", "grunt-run": "0.8.1", "gulp-babel": "^8.0.0", @@ -465,14 +462,6 @@ "jest-raw-loader": "^1.0.1", "jimp": "^0.9.6", "json5": "^1.0.1", - "karma": "5.0.2", - "karma-chrome-launcher": "2.2.0", - "karma-coverage": "1.1.2", - "karma-firefox-launcher": "1.1.0", - "karma-ie-launcher": "1.0.0", - "karma-junit-reporter": "1.2.0", - "karma-mocha": "2.0.0", - "karma-safari-launcher": "1.0.0", "license-checker": "^16.0.0", "listr": "^0.14.1", "load-grunt-config": "^3.0.1", diff --git a/packages/kbn-eslint-import-resolver-kibana/lib/get_webpack_config.js b/packages/kbn-eslint-import-resolver-kibana/lib/get_webpack_config.js index 6cb2f3d2901d3..baf5baaf916aa 100755 --- a/packages/kbn-eslint-import-resolver-kibana/lib/get_webpack_config.js +++ b/packages/kbn-eslint-import-resolver-kibana/lib/get_webpack_config.js @@ -28,13 +28,9 @@ exports.getWebpackConfig = function (kibanaPath, projectRoot, config) { const alias = { // Kibana defaults https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/legacy/ui/ui_bundler_env.js#L30-L36 ui: fromKibana('src/legacy/ui/public'), - test_harness: fromKibana('src/test_harness/public'), // Dev defaults for test bundle https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/core_plugins/tests_bundle/index.js#L73-L78 ng_mock$: fromKibana('src/test_utils/public/ng_mock'), - 'angular-mocks$': fromKibana( - 'src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js' - ), fixtures: fromKibana('src/fixtures'), test_utils: fromKibana('src/test_utils/public'), }; diff --git a/packages/kbn-plugin-generator/README.md b/packages/kbn-plugin-generator/README.md index 95de0e93fd075..6ad665f9b87f8 100644 --- a/packages/kbn-plugin-generator/README.md +++ b/packages/kbn-plugin-generator/README.md @@ -71,10 +71,6 @@ Generated plugins receive a handful of scripts that can be used during developme Build a distributable archive of your plugin. - - `yarn test:karma` - - Run the browser tests in a real web browser. - - `yarn test:mocha` Run the server tests using mocha. diff --git a/packages/kbn-plugin-helpers/README.md b/packages/kbn-plugin-helpers/README.md index 4c648fd9bde8c..d7ed3106c1ceb 100644 --- a/packages/kbn-plugin-helpers/README.md +++ b/packages/kbn-plugin-helpers/README.md @@ -30,7 +30,6 @@ $ plugin-helpers help start Start kibana and have it include this plugin build [options] [files...] Build a distributable archive test Run the server and browser tests - test:karma [options] Run the browser tests in a real web browser test:mocha [files...] Run the server tests using mocha Options: diff --git a/packages/kbn-plugin-helpers/src/cli.ts b/packages/kbn-plugin-helpers/src/cli.ts index b894f854a484f..18ddc62cba8a6 100644 --- a/packages/kbn-plugin-helpers/src/cli.ts +++ b/packages/kbn-plugin-helpers/src/cli.ts @@ -62,25 +62,6 @@ program })) ); -program - .command('test') - .description('Run the server and browser tests') - .on('--help', docs('test/all')) - .action(createCommanderAction('testAll')); - -program - .command('test:karma') - .description('Run the browser tests in a real web browser') - .option('--dev', 'Enable dev mode, keeps the test server running') - .option('-p, --plugins ', "Manually specify which plugins' test bundles to run") - .on('--help', docs('test/karma')) - .action( - createCommanderAction('testKarma', (command) => ({ - dev: Boolean(command.dev), - plugins: command.plugins, - })) - ); - program .command('test:mocha [files...]') .description('Run the server tests using mocha') diff --git a/packages/kbn-plugin-helpers/src/lib/tasks.ts b/packages/kbn-plugin-helpers/src/lib/tasks.ts index 7817838760a2e..bd86bb670ff39 100644 --- a/packages/kbn-plugin-helpers/src/lib/tasks.ts +++ b/packages/kbn-plugin-helpers/src/lib/tasks.ts @@ -19,23 +19,17 @@ import { buildTask } from '../tasks/build'; import { startTask } from '../tasks/start'; -import { testAllTask } from '../tasks/test/all'; -import { testKarmaTask } from '../tasks/test/karma'; import { testMochaTask } from '../tasks/test/mocha'; // define a tasks interface that we can extend in the tests export interface Tasks { build: typeof buildTask; start: typeof startTask; - testAll: typeof testAllTask; - testKarma: typeof testKarmaTask; testMocha: typeof testMochaTask; } export const tasks: Tasks = { build: buildTask, start: startTask, - testAll: testAllTask, - testKarma: testKarmaTask, testMocha: testMochaTask, }; diff --git a/packages/kbn-plugin-helpers/src/tasks/test/all/README.md b/packages/kbn-plugin-helpers/src/tasks/test/all/README.md deleted file mode 100644 index 4f5a72ac0d523..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/all/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Runs both the mocha and karma tests, in that order. - -This is just a simple caller to both `test/mocha` and `test/karma` \ No newline at end of file diff --git a/packages/kbn-plugin-helpers/src/tasks/test/all/index.ts b/packages/kbn-plugin-helpers/src/tasks/test/all/index.ts deleted file mode 100644 index be8db50825fc9..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/all/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './test_all_task'; diff --git a/packages/kbn-plugin-helpers/src/tasks/test/all/test_all_task.ts b/packages/kbn-plugin-helpers/src/tasks/test/all/test_all_task.ts deleted file mode 100644 index d07c19291d2cb..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/all/test_all_task.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { TaskContext } from '../../../lib'; - -export function testAllTask({ run }: TaskContext) { - run('testMocha'); - run('testKarma'); -} diff --git a/packages/kbn-plugin-helpers/src/tasks/test/karma/README.md b/packages/kbn-plugin-helpers/src/tasks/test/karma/README.md deleted file mode 100644 index 8d921e8312344..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/karma/README.md +++ /dev/null @@ -1,60 +0,0 @@ -writing tests -============= - -Browser tests are written just like server tests, they are just executed differently. - - - place tests near the code they test, in `__tests__` directories throughout - the public directory - - - Use the same bdd-style `describe()` and `it()` - api to define the suites and cases of your tests. - - ```js - describe('some portion of your code', function () { - it('should do this thing', function () { - expect(true).to.be(false); - }); - }); - ``` - - -starting the test runner -======================== - -Under the covers this command uses the `test:karma` task from kibana. This will execute -your tasks once and exit when complete. - -When run with the `--dev` option, the command uses the `test:karma:debug` task from kibana. -This task sets-up a test runner that will watch your code for changes and rebuild your -tests when necessary. You access the test runner through a browser that it starts itself -(via Karma). - -If your plugin consists of a number of internal plugins, you may wish to keep the tests -isolated to a specific plugin or plugins, instead of executing all of the tests. To do this, -use `--plugins` and passing the plugins you would like to test. Multiple plugins can be -specified by separating them with commas. - - -running the tests -================= - -Once the test runner has started you a new browser window should be opened and you should -see a message saying "connected". Next to that is a "DEBUG" button. This button will open -an interactive version of your tests that you can refresh, inspects, and otherwise debug -while you write your tests. - - -focus on the task at hand -========================= - -To limit the tests that run you can either: - - 1. use the ?grep= query string to filter the test cases/suites by name - 2. Click the suite title or (play) button next to test output - 3. Add `.only` to your `describe()` or `it()` calls: - - ```js - describe.only('suite name', function () { - // ... - }); - ``` diff --git a/packages/kbn-plugin-helpers/src/tasks/test/karma/index.ts b/packages/kbn-plugin-helpers/src/tasks/test/karma/index.ts deleted file mode 100644 index 3089357b49991..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/karma/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export * from './test_karma_task'; diff --git a/packages/kbn-plugin-helpers/src/tasks/test/karma/test_karma_task.ts b/packages/kbn-plugin-helpers/src/tasks/test/karma/test_karma_task.ts deleted file mode 100644 index 2fe8134209894..0000000000000 --- a/packages/kbn-plugin-helpers/src/tasks/test/karma/test_karma_task.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { execFileSync } from 'child_process'; - -import { TaskContext } from '../../../lib'; -import { winCmd } from '../../../lib/win_cmd'; - -export function testKarmaTask({ plugin, options }: TaskContext) { - options = options || {}; - - const kbnServerArgs = ['--kbnServer.plugin-path=' + plugin.root]; - - if (options.plugins) { - kbnServerArgs.push('--kbnServer.tests_bundle.pluginId=' + options.plugins); - } else { - kbnServerArgs.push('--kbnServer.tests_bundle.pluginId=' + plugin.id); - } - - const task = options.dev ? 'test:karma:debug' : 'test:karma'; - const args = [task].concat(kbnServerArgs); - execFileSync(winCmd('yarn'), args, { - cwd: plugin.kibanaRoot, - stdio: ['ignore', 1, 2], - }); -} diff --git a/packages/kbn-test/src/failed_tests_reporter/__fixtures__/index.ts b/packages/kbn-test/src/failed_tests_reporter/__fixtures__/index.ts index 16ebe10ad5426..11d6cb6a2b47b 100644 --- a/packages/kbn-test/src/failed_tests_reporter/__fixtures__/index.ts +++ b/packages/kbn-test/src/failed_tests_reporter/__fixtures__/index.ts @@ -21,6 +21,5 @@ const Fs = jest.requireActual('fs'); export const FTR_REPORT = Fs.readFileSync(require.resolve('./ftr_report.xml'), 'utf8'); export const JEST_REPORT = Fs.readFileSync(require.resolve('./jest_report.xml'), 'utf8'); -export const KARMA_REPORT = Fs.readFileSync(require.resolve('./karma_report.xml'), 'utf8'); export const MOCHA_REPORT = Fs.readFileSync(require.resolve('./mocha_report.xml'), 'utf8'); export const CYPRESS_REPORT = Fs.readFileSync(require.resolve('./cypress_report.xml'), 'utf8'); diff --git a/packages/kbn-test/src/failed_tests_reporter/__fixtures__/karma_report.xml b/packages/kbn-test/src/failed_tests_reporter/__fixtures__/karma_report.xml deleted file mode 100644 index 5c4bdb9f50adf..0000000000000 --- a/packages/kbn-test/src/failed_tests_reporter/__fixtures__/karma_report.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - Error: expected 7069 to be below 64 - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.assert (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13671:11) - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.lessThan.Assertion.below (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13891:8) - at Function.lessThan (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:14078:15) - at _callee3$ (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158985:60) - at tryCatch (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:62:40) - at Generator.invoke [as _invoke] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:288:22) - at Generator.prototype.<computed> [as next] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:114:21) - at asyncGeneratorStep (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158772:103) - at _next (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158774:194) - - - - - - - - - diff --git a/packages/kbn-test/src/failed_tests_reporter/add_messages_to_report.test.ts b/packages/kbn-test/src/failed_tests_reporter/add_messages_to_report.test.ts index 53a74f6cc6af2..505e898c62adf 100644 --- a/packages/kbn-test/src/failed_tests_reporter/add_messages_to_report.test.ts +++ b/packages/kbn-test/src/failed_tests_reporter/add_messages_to_report.test.ts @@ -39,13 +39,7 @@ jest.mock('fs', () => { }; }); -import { - FTR_REPORT, - JEST_REPORT, - MOCHA_REPORT, - KARMA_REPORT, - CYPRESS_REPORT, -} from './__fixtures__'; +import { FTR_REPORT, JEST_REPORT, MOCHA_REPORT, CYPRESS_REPORT } from './__fixtures__'; import { parseTestReport } from './test_report'; import { addMessagesToReport } from './add_messages_to_report'; @@ -338,79 +332,3 @@ it('rewrites cypress reports with minimal changes', async () => { `); }); - -it('rewrites karma reports with minimal changes', async () => { - const xml = await addMessagesToReport({ - report: await parseTestReport(KARMA_REPORT), - messages: [ - { - name: - 'CoordinateMapsVisualizationTest CoordinateMapsVisualization - basics should initialize OK', - classname: 'Browser Unit Tests.CoordinateMapsVisualizationTest', - message: 'foo bar', - }, - ], - log, - reportPath: Path.resolve(__dirname, './__fixtures__/karma_report.xml'), - }); - - expect(createPatch('karma.xml', KARMA_REPORT, xml, { context: 0 })).toMatchInlineSnapshot(` - Index: karma.xml - =================================================================== - --- karma.xml [object Object] - +++ karma.xml - @@ -1,5 +1,5 @@ - -‹?xml version="1.0"?› - +‹?xml version="1.0" encoding="utf-8"?› - ‹testsuite name="Chrome 75.0.3770 (Mac OS X 10.14.5)" package="" timestamp="2019-07-02T19:53:21" id="0" hostname="spalger.lan" tests="648" errors="0" failures="4" time="1.759"› - ‹properties› - ‹property name="browser.fullName" value="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"/› - ‹/properties› - @@ -7,27 +7,31 @@ - ‹testcase name="Vis-Editor-Agg-Params plugin directive should hide custom label parameter" time="0" classname="Browser Unit Tests.Vis-Editor-Agg-Params plugin directive"› - ‹skipped/› - ‹/testcase› - ‹testcase name="CoordinateMapsVisualizationTest CoordinateMapsVisualization - basics should initialize OK" time="0.265" classname="Browser Unit Tests.CoordinateMapsVisualizationTest"› - - ‹failure type=""›Error: expected 7069 to be below 64 - - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.assert (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13671:11) - - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.lessThan.Assertion.below (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13891:8) - - at Function.lessThan (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:14078:15) - - at _callee3$ (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158985:60) - + ‹failure type=""›‹![CDATA[Error: expected 7069 to be below 64 - + at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.assert (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13671:11) - + at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.lessThan.Assertion.below (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13891:8) - + at Function.lessThan (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:14078:15) - + at _callee3$ (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158985:60) - at tryCatch (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:62:40) - at Generator.invoke [as _invoke] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:288:22) - - at Generator.prototype.<computed> [as next] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:114:21) - - at asyncGeneratorStep (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158772:103) - - at _next (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158774:194) - -‹/failure› - + at Generator.prototype.‹computed› [as next] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:114:21) - + at asyncGeneratorStep (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158772:103) - + at _next (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158774:194) - +]]›‹/failure› - + ‹system-out›Failed Tests Reporter: - + - foo bar - + - +‹/system-out› - ‹/testcase› - ‹testcase name="CoordinateMapsVisualizationTest CoordinateMapsVisualization - basics should toggle to Heatmap OK" time="0.055" classname="Browser Unit Tests.CoordinateMapsVisualizationTest"/› - ‹testcase name="VegaParser._parseSchema should warn on vega-lite version too new to be supported" time="0.001" classname="Browser Unit Tests.VegaParser·_parseSchema"/› - ‹system-out› - - ‹![CDATA[Chrome 75.0.3770 (Mac OS X 10.14.5) LOG: 'ready to load tests for shard 1 of 4' - + Chrome 75.0.3770 (Mac OS X 10.14.5) LOG: 'ready to load tests for shard 1 of 4' - ,Chrome 75.0.3770 (Mac OS X 10.14.5) WARN: 'Unmatched GET to http://localhost:9876/api/interpreter/fns' - ... - - -]]› - + - ‹/system-out› - ‹system-err/› - -‹/testsuite› - +‹/testsuite› - \\ No newline at end of file - - `); -}); diff --git a/packages/kbn-test/src/failed_tests_reporter/get_failures.test.ts b/packages/kbn-test/src/failed_tests_reporter/get_failures.test.ts index 23d9805727f32..f570ed36111b3 100644 --- a/packages/kbn-test/src/failed_tests_reporter/get_failures.test.ts +++ b/packages/kbn-test/src/failed_tests_reporter/get_failures.test.ts @@ -19,7 +19,7 @@ import { getFailures } from './get_failures'; import { parseTestReport } from './test_report'; -import { FTR_REPORT, JEST_REPORT, KARMA_REPORT, MOCHA_REPORT } from './__fixtures__'; +import { FTR_REPORT, JEST_REPORT, MOCHA_REPORT } from './__fixtures__'; it('discovers failures in ftr report', async () => { const failures = getFailures(await parseTestReport(FTR_REPORT)); @@ -85,31 +85,6 @@ it('discovers failures in jest report', async () => { `); }); -it('discovers failures in karma report', async () => { - const failures = getFailures(await parseTestReport(KARMA_REPORT)); - expect(failures).toMatchInlineSnapshot(` - Array [ - Object { - "classname": "Browser Unit Tests.CoordinateMapsVisualizationTest", - "failure": "Error: expected 7069 to be below 64 - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.assert (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13671:11) - at Assertion.__kbnBundles__.tests../packages/kbn-expect/expect.js.Assertion.lessThan.Assertion.below (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:13891:8) - at Function.lessThan (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:14078:15) - at _callee3$ (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158985:60) - at tryCatch (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:62:40) - at Generator.invoke [as _invoke] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:288:22) - at Generator.prototype. [as next] (webpack://%5Bname%5D/./node_modules/regenerator-runtime/runtime.js?:114:21) - at asyncGeneratorStep (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158772:103) - at _next (http://localhost:5610/bundles/tests.bundle.js?shards=4&shard_num=1:158774:194) - ", - "likelyIrrelevant": false, - "name": "CoordinateMapsVisualizationTest CoordinateMapsVisualization - basics should initialize OK", - "time": "0.265", - }, - ] - `); -}); - it('discovers failures in mocha report', async () => { const failures = getFailures(await parseTestReport(MOCHA_REPORT)); expect(failures).toMatchInlineSnapshot(` diff --git a/packages/kbn-test/src/failed_tests_reporter/report_metadata.test.ts b/packages/kbn-test/src/failed_tests_reporter/report_metadata.test.ts index 729d80ddfcb44..c079084965609 100644 --- a/packages/kbn-test/src/failed_tests_reporter/report_metadata.test.ts +++ b/packages/kbn-test/src/failed_tests_reporter/report_metadata.test.ts @@ -19,7 +19,7 @@ import { getReportMessageIter } from './report_metadata'; import { parseTestReport } from './test_report'; -import { FTR_REPORT, JEST_REPORT, KARMA_REPORT, MOCHA_REPORT } from './__fixtures__'; +import { FTR_REPORT, JEST_REPORT, MOCHA_REPORT } from './__fixtures__'; it('reads messages and screenshots from metadata-json properties', async () => { const ftrReport = await parseTestReport(FTR_REPORT); @@ -43,7 +43,4 @@ it('reads messages and screenshots from metadata-json properties', async () => { const mochaReport = await parseTestReport(MOCHA_REPORT); expect(Array.from(getReportMessageIter(mochaReport))).toMatchInlineSnapshot(`Array []`); - - const karmaReport = await parseTestReport(KARMA_REPORT); - expect(Array.from(getReportMessageIter(karmaReport))).toMatchInlineSnapshot(`Array []`); }); diff --git a/packages/kbn-ui-shared-deps/theme.ts b/packages/kbn-ui-shared-deps/theme.ts index 4b2758516fc26..a810e1de0a21f 100644 --- a/packages/kbn-ui-shared-deps/theme.ts +++ b/packages/kbn-ui-shared-deps/theme.ts @@ -24,7 +24,7 @@ const globals: any = typeof window === 'undefined' ? {} : window; export type Theme = typeof LightTheme; // in the Kibana app we can rely on this global being defined, but in -// some cases (like jest, or karma tests) the global is undefined +// some cases (like jest) the global is undefined export const tag: string = globals.__kbnThemeTag__ || 'v7light'; export const version = tag.startsWith('v7') ? 7 : 8; export const darkMode = tag.endsWith('dark'); diff --git a/src/core/MIGRATION.md b/src/core/MIGRATION.md index f7acff14915a7..72945597758e2 100644 --- a/src/core/MIGRATION.md +++ b/src/core/MIGRATION.md @@ -1620,14 +1620,6 @@ If others are consuming your plugin's new platform contracts via the `ui/new_pla > Note: The `ui/new_platform` mock is only designed for use by old Jest tests. If you are writing new tests, you should structure your code and tests such that you don't need this mock. Instead, you should import the `core` mock directly and instantiate it. -#### What about karma tests? - -While our plan is to only provide first-class mocks for Jest tests, there are many legacy karma tests that cannot be quickly or easily converted to Jest -- particularly those which are still relying on mocking Angular services via `ngMock`. - -For these tests, we are maintaining a separate set of mocks. Files with a `.karma_mock.{js|ts|tsx}` extension will be loaded _globally_ before karma tests are run. - -It is important to note that this behavior is different from `jest.mock('ui/new_platform')`, which only mocks tests on an individual basis. If you encounter any failures in karma tests as a result of new platform migration efforts, you may need to add a `.karma_mock.js` file for the affected services, or add to the existing karma mock we are maintaining in `ui/new_platform`. - ### Provide Legacy Platform API to the New platform plugin #### On the server side diff --git a/src/core/public/legacy/legacy_service.ts b/src/core/public/legacy/legacy_service.ts index d77676b350f93..78a9219f3d694 100644 --- a/src/core/public/legacy/legacy_service.ts +++ b/src/core/public/legacy/legacy_service.ts @@ -53,7 +53,7 @@ interface BootstrapModule { * The LegacyPlatformService is responsible for initializing * the legacy platform by injecting parts of the new platform * services into the legacy platform modules, like ui/modules, - * and then bootstrapping the ui/chrome or ui/test_harness to + * and then bootstrapping the ui/chrome or ~~ui/test_harness~~ to * setup either the app or browser tests. */ export class LegacyPlatformService { diff --git a/src/core/server/http/http_config.ts b/src/core/server/http/http_config.ts index 83a2e712b424f..e74f6d32e92b0 100644 --- a/src/core/server/http/http_config.ts +++ b/src/core/server/http/http_config.ts @@ -42,21 +42,7 @@ export const config = { validate: match(validBasePathRegex, "must start with a slash, don't end with one"), }) ), - cors: schema.conditional( - schema.contextRef('dev'), - true, - schema.object( - { - origin: schema.arrayOf(schema.string()), - }, - { - defaultValue: { - origin: ['*://localhost:9876'], // karma test server - }, - } - ), - schema.boolean({ defaultValue: false }) - ), + cors: schema.boolean({ defaultValue: false }), customResponseHeaders: schema.recordOf(schema.string(), schema.any(), { defaultValue: {}, }), diff --git a/src/dev/build/tasks/copy_source_task.ts b/src/dev/build/tasks/copy_source_task.ts index 221c9162bd2a9..c8489673b83af 100644 --- a/src/dev/build/tasks/copy_source_task.ts +++ b/src/dev/build/tasks/copy_source_task.ts @@ -33,7 +33,6 @@ export const CopySource: Task = { '!src/**/{__tests__,__snapshots__,__mocks__}/**', '!src/test_utils/**', '!src/fixtures/**', - '!src/legacy/core_plugins/tests_bundle/**', '!src/legacy/core_plugins/console/public/tests/**', '!src/cli/cluster/**', '!src/cli/repl/**', diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index e11668ab57f55..5249b7d652790 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -52,7 +52,6 @@ export default { '!packages/kbn-ui-framework/src/services/**/*/index.js', 'src/legacy/core_plugins/**/*.{js,mjs,jsx,ts,tsx}', '!src/legacy/core_plugins/**/{__test__,__snapshots__}/**/*', - '!src/legacy/core_plugins/tests_bundle/**', ], moduleNameMapper: { '@elastic/eui$': '/node_modules/@elastic/eui/test-env', diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 1e4f048be8ea4..864bf7515053c 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -124,7 +124,6 @@ export const IGNORE_DIRECTORY_GLOBS = [ export const TEMPORARILY_IGNORED_PATHS = [ 'src/legacy/core_plugins/console/public/src/directives/helpExample.txt', 'src/legacy/core_plugins/console/public/src/sense_editor/theme-sense-dark.js', - 'src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js', 'src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png', 'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png', 'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png', diff --git a/src/legacy/core_plugins/tests_bundle/find_source_files.js b/src/legacy/core_plugins/tests_bundle/find_source_files.js deleted file mode 100644 index eed88a5ecb8b0..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/find_source_files.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { fromRoot } from '../../../core/server/utils'; -import { chain } from 'lodash'; -import { resolve } from 'path'; -import { fromNode } from 'bluebird'; -import glob from 'glob-all'; - -const findSourceFiles = async (patterns, cwd = fromRoot('.')) => { - patterns = [].concat(patterns || []); - - const matches = await fromNode((cb) => { - glob( - patterns, - { - cwd: cwd, - ignore: [ - 'node_modules/**/*', - 'bower_components/**/*', - '**/_*.js', - '**/*.test.js', - '**/*.test.mocks.js', - '**/__mocks__/**/*', - ], - symlinks: findSourceFiles.symlinks, - statCache: findSourceFiles.statCache, - realpathCache: findSourceFiles.realpathCache, - cache: findSourceFiles.cache, - }, - cb - ); - }); - - return chain(matches) - .flatten() - .uniq() - .map((match) => resolve(cwd, match)) - .value(); -}; - -findSourceFiles.symlinks = {}; -findSourceFiles.statCache = {}; -findSourceFiles.realpathCache = {}; -findSourceFiles.cache = {}; - -export default findSourceFiles; diff --git a/src/legacy/core_plugins/tests_bundle/index.js b/src/legacy/core_plugins/tests_bundle/index.js deleted file mode 100644 index da7c1c4f4527e..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createReadStream } from 'fs'; -import { resolve } from 'path'; - -import globby from 'globby'; -import MultiStream from 'multistream'; -import webpackMerge from 'webpack-merge'; - -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { fromRoot } from '../../../core/server/utils'; -import { replacePlaceholder } from '../../../optimize/public_path_placeholder'; -import findSourceFiles from './find_source_files'; -import { createTestEntryTemplate } from './tests_entry_template'; - -export default (kibana) => { - return new kibana.Plugin({ - config: (Joi) => { - return Joi.object({ - enabled: Joi.boolean().default(true), - instrument: Joi.boolean().default(false), - pluginId: Joi.string(), - }).default(); - }, - - uiExports: { - styleSheetPaths: resolve(__dirname, 'public/index.scss'), - async __bundleProvider__(kbnServer) { - const modules = new Set(); - - const { - config, - uiApps, - uiBundles, - plugins, - uiExports: { uiSettingDefaults = {} }, - } = kbnServer; - - const testGlobs = []; - - const testingPluginIds = config.get('tests_bundle.pluginId'); - - if (testingPluginIds) { - testingPluginIds.split(',').forEach((pluginId) => { - const plugin = plugins.find((plugin) => plugin.id === pluginId); - - if (!plugin) { - throw new Error('Invalid testingPluginId :: unknown plugin ' + pluginId); - } - - // add the modules from all of this plugins apps - for (const app of uiApps) { - if (app.getPluginId() === pluginId) { - modules.add(app.getMainModuleId()); - } - } - - testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`); - }); - } else { - // add all since we are not just focused on specific plugins - testGlobs.push('src/legacy/ui/public/**/*.js', '!src/legacy/ui/public/flot-charts/**/*'); - // add the modules from all of the apps - for (const app of uiApps) { - modules.add(app.getMainModuleId()); - } - - for (const plugin of plugins) { - testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`); - } - } - - const testFiles = await findSourceFiles(testGlobs); - for (const f of testFiles) modules.add(f); - - if (config.get('tests_bundle.instrument')) { - uiBundles.addPostLoader({ - test: /\.js$/, - exclude: /[\/\\](__tests__|node_modules|bower_components|webpackShims)[\/\\]/, - loader: 'istanbul-instrumenter-loader', - }); - } - - uiBundles.add({ - id: 'tests', - modules: [...modules], - template: createTestEntryTemplate(uiSettingDefaults), - extendConfig(webpackConfig) { - const mergedConfig = webpackMerge( - { - resolve: { - extensions: ['.karma_mock.js', '.karma_mock.tsx', '.karma_mock.ts'], - }, - node: { - fs: 'empty', - child_process: 'empty', - dns: 'empty', - net: 'empty', - tls: 'empty', - }, - }, - webpackConfig - ); - - /** - * [..] it removes the commons bundle creation from the webpack - * config when we're building the bundle for the browser tests. It - * shouldn't be created, and by default isn't, but something is - * triggering it in webpack which breaks the tests so if we just - * remove the optimization config it will never happen and the tests - * will keep working [..] - * - * TLDR: If you have any questions about this line, ask Spencer. - */ - delete mergedConfig.optimization.splitChunks.cacheGroups.commons; - - return mergedConfig; - }, - }); - - kbnServer.server.route({ - method: 'GET', - path: '/test_bundle/built_css.css', - async handler(_, h) { - const cssFiles = await globby( - testingPluginIds - ? testingPluginIds.split(',').map((id) => `built_assets/css/plugins/${id}/**/*.css`) - : `built_assets/css/**/*.css`, - { cwd: fromRoot('.'), absolute: true } - ); - - const stream = replacePlaceholder( - new MultiStream(cssFiles.map((path) => createReadStream(path))), - '/built_assets/css/' - ); - - return h.response(stream).code(200).type('text/css'); - }, - }); - - // Sets global variables normally set by the bootstrap.js script - kbnServer.server.route({ - path: '/test_bundle/karma/globals.js', - method: 'GET', - async handler(req, h) { - const basePath = config.get('server.basePath'); - - const file = `window.__kbnPublicPath__ = { 'kbn-ui-shared-deps': "${basePath}/bundles/kbn-ui-shared-deps/" };`; - - return h.response(file).header('content-type', 'application/json'); - }, - }); - }, - - __globalImportAliases__: { - ng_mock$: fromRoot('src/test_utils/public/ng_mock'), - 'angular-mocks$': require.resolve('./webpackShims/angular-mocks'), - fixtures: fromRoot('src/fixtures'), - test_utils: fromRoot('src/test_utils/public'), - }, - }, - }); -}; diff --git a/src/legacy/core_plugins/tests_bundle/package.json b/src/legacy/core_plugins/tests_bundle/package.json deleted file mode 100644 index 4d2df048d4164..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tests_bundle", - "version": "kibana" -} diff --git a/src/legacy/core_plugins/tests_bundle/public/index.scss b/src/legacy/core_plugins/tests_bundle/public/index.scss deleted file mode 100644 index d8dbf8d6dc885..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/public/index.scss +++ /dev/null @@ -1,4 +0,0 @@ -// This file pulls some styles of NP plugins into the legacy test stylesheet -// so they are available for karma browser tests. -@import '../../../../plugins/vis_type_vislib/public/index'; -@import '../../../../plugins/visualizations/public/index'; diff --git a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js deleted file mode 100644 index 28c26f08621eb..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { Type } from '@kbn/config-schema'; -import pkg from '../../../../package.json'; - -export const createTestEntryTemplate = (defaultUiSettings) => (bundle) => ` -/** - * Test entry file - * - * This is programmatically created and updated, do not modify - * - * context: ${bundle.getContext()} - * - */ - -import fetchMock from 'fetch-mock/es5/client'; -import { CoreSystem } from '__kibanaCore__'; - -// Fake uiCapabilities returned to Core in browser tests -const uiCapabilities = { - navLinks: { - myLink: true, - notMyLink: true, - }, - discover: { - showWriteControls: true - }, - visualize: { - save: true - }, - dashboard: { - showWriteControls: true - }, - timelion: { - save: true - }, - management: { - kibana: { - settings: true, - index_patterns: true, - objects: true - } - } -}; - -// Mock fetch for CoreSystem calls. -fetchMock.config.fallbackToNetwork = true; -fetchMock.post(/\\/api\\/core\\/capabilities/, { - status: 200, - body: JSON.stringify(uiCapabilities), - headers: { 'Content-Type': 'application/json' }, -}); - -// render the core system in a element not attached to the document as the -// default children of the body in the browser tests are needed for mocha and -// other test components to work -const rootDomElement = document.createElement('div'); - -const coreSystem = new CoreSystem({ - injectedMetadata: { - version: '1.2.3', - buildNumber: 1234, - legacyMode: true, - legacyMetadata: { - app: { - id: 'karma', - title: 'Karma', - }, - nav: [], - version: '1.2.3', - buildNum: 1234, - devMode: true, - uiSettings: { - defaults: ${JSON.stringify( - defaultUiSettings, - (key, value) => { - if (value instanceof Type) return null; - return value; - }, - 2 - ) - .split('\n') - .join('\n ')}, - user: {} - }, - nav: [] - }, - csp: { - warnLegacyBrowsers: false, - }, - capabilities: uiCapabilities, - uiPlugins: [], - vars: { - kbnIndex: '.kibana', - esShardTimeout: 1500, - esApiVersion: ${JSON.stringify(pkg.branch)}, - esRequestTimeout: '300000', - tilemapsConfig: { - deprecated: { - isOverridden: false, - config: { - options: { - } - } - } - }, - regionmapsConfig: { - layers: [] - }, - mapConfig: { - includeElasticMapsService: true, - emsFileApiUrl: 'https://vector-staging.maps.elastic.co', - emsTileApiUrl: 'https://tiles.maps.elastic.co', - }, - vegaConfig: { - enabled: true, - enableExternalUrls: true - }, - }, - }, - rootDomElement, - requireLegacyBootstrapModule: () => { - // wrapped in NODE_ENV check so the 'ui/test_harness' module - // is not included in the distributable - if (process.env.IS_KIBANA_DISTRIBUTABLE !== 'true') { - return require('ui/test_harness'); - } - - throw new Error('tests bundle is not available in the distributable'); - }, - requireNewPlatformShimModule: () => require('ui/new_platform'), - requireLegacyFiles: () => { - ${bundle.getRequires().join('\n ')} - } -}) - -coreSystem - .setup() - .then(() => { - return coreSystem.start(); - }); -`; diff --git a/src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js b/src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js deleted file mode 100644 index 24f794cb32990..0000000000000 --- a/src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -require('angular'); -require('../../../../../node_modules/angular-mocks/angular-mocks.js'); diff --git a/src/legacy/ui/public/test_harness/.eslintrc b/src/legacy/ui/public/test_harness/.eslintrc deleted file mode 100644 index b1b85968796dd..0000000000000 --- a/src/legacy/ui/public/test_harness/.eslintrc +++ /dev/null @@ -1,2 +0,0 @@ -rules: - no-console: 0 diff --git a/src/legacy/ui/public/test_harness/index.js b/src/legacy/ui/public/test_harness/index.js deleted file mode 100644 index d66a4b1d67214..0000000000000 --- a/src/legacy/ui/public/test_harness/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { bootstrap } from './test_harness'; diff --git a/src/legacy/ui/public/test_harness/test_harness.css b/src/legacy/ui/public/test_harness/test_harness.css deleted file mode 100644 index d0a0f50c55b9b..0000000000000 --- a/src/legacy/ui/public/test_harness/test_harness.css +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file is only for tests so it is it's own CSS - * to be imported directly by and only by this module. - */ - -body#test-harness-body { - /** - now that tests include the kibana styles, we have - to override the body { display: flex; } rule as it - prevents the visualizations from properly testing - their sizing - */ - display: block; -} - -body#test-harness-body #mocha-stats .progress { - /* bootstrap thinks it is the only one who will use ".progress" */ - height: auto; - background-color: transparent; - overflow: auto; - border-radius: 0; -} diff --git a/src/legacy/ui/public/test_harness/test_harness.js b/src/legacy/ui/public/test_harness/test_harness.js deleted file mode 100644 index 22c981fe0cf54..0000000000000 --- a/src/legacy/ui/public/test_harness/test_harness.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// chrome expects to be loaded first, let it get its way -import chrome from '../chrome'; - -import { parse as parseUrl } from 'url'; -import { Subject } from 'rxjs'; -import sinon from 'sinon'; -import { metadata } from '../metadata'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { UiSettingsClient } from '../../../../core/public/ui_settings'; - -import './test_harness.css'; -import 'ng_mock'; -import { setupTestSharding } from './test_sharding'; - -const { query } = parseUrl(window.location.href, true); -if (query && query.mocha) { - try { - window.mocha.setup(JSON.parse(query.mocha)); - } catch (error) { - throw new Error( - `'?mocha=${query.mocha}' query string param provided but it could not be parsed as json` - ); - } -} - -setupTestSharding(); - -before(() => { - // prevent accidental ajax requests - sinon.useFakeXMLHttpRequest(); -}); - -let stubUiSettings; -let done$; -function createStubUiSettings() { - if (stubUiSettings) { - done$.complete(); - } - done$ = new Subject(); - - stubUiSettings = new UiSettingsClient({ - api: { - async batchSet() { - return { settings: stubUiSettings.getAll() }; - }, - }, - onUpdateError: () => {}, - defaults: metadata.uiSettings.defaults, - initialSettings: {}, - done$, - }); -} - -createStubUiSettings(); -sinon.stub(chrome, 'getUiSettingsClient').callsFake(() => stubUiSettings); - -afterEach(function () { - createStubUiSettings(); -}); - -// Kick off mocha, called at the end of test entry files -export function bootstrap(targetDomElement) { - // allows test_harness.less to have higher priority selectors - targetDomElement.setAttribute('id', 'test-harness-body'); - - // load the hacks since we aren't actually bootstrapping the - // chrome, which is where the hacks would normally be loaded - require('uiExports/hacks'); - chrome.setupAngular(); -} diff --git a/src/legacy/ui/public/test_harness/test_sharding/find_test_bundle_url.js b/src/legacy/ui/public/test_harness/test_sharding/find_test_bundle_url.js deleted file mode 100644 index 53800d08ca05b..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/find_test_bundle_url.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * We don't have a lot of options for passing arguments to the page that karma - * creates, so we tack some query string params onto the test bundle script url. - * - * This function finds that url by looking for a script tag that has - * the "/tests.bundle.js" segment - * - * @return {string} url - */ -export function findTestBundleUrl() { - const scriptTags = document.querySelectorAll('script[src]'); - const scriptUrls = [].map.call(scriptTags, (el) => el.getAttribute('src')); - const testBundleUrl = scriptUrls.find((url) => url.includes('/tests.bundle.js')); - - if (!testBundleUrl) { - throw new Error("test bundle url couldn't be found"); - } - - return testBundleUrl; -} diff --git a/src/legacy/ui/public/test_harness/test_sharding/get_shard_num.js b/src/legacy/ui/public/test_harness/test_sharding/get_shard_num.js deleted file mode 100644 index 55a33fc295191..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/get_shard_num.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import murmurHash3 from 'murmurhash3js'; - -// murmur hashes are 32bit unsigned integers -const MAX_HASH = Math.pow(2, 32); - -/** - * Determine the shard number for a suite by hashing - * its name and placing it based on the hash - * - * @param {number} shardTotal - the total number of shards - * @param {string} suiteName - the suite name to hash - * @return {number} shardNum - 1-based shard number - */ -export function getShardNum(shardTotal, suiteName) { - const hashIntsPerShard = MAX_HASH / shardTotal; - - const hashInt = murmurHash3.x86.hash32(suiteName); - - // murmur3 produces 32bit integers, so we devide it by the number of chunks - // to determine which chunk the suite should fall in. +1 because the current - // chunk is 1-based - const shardNum = Math.floor(hashInt / hashIntsPerShard) + 1; - - // It's not clear if hash32 can produce the MAX_HASH or not, - // but this just ensures that shard numbers don't go out of bounds - // and cause tests to be ignored unnecessarily - return Math.max(1, Math.min(shardNum, shardTotal)); -} diff --git a/src/legacy/ui/public/test_harness/test_sharding/get_sharding_params_from_url.js b/src/legacy/ui/public/test_harness/test_sharding/get_sharding_params_from_url.js deleted file mode 100644 index 65e41dbc84b63..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/get_sharding_params_from_url.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { parse as parseUrl } from 'url'; - -/** - * This function extracts the relevant "shards" and "shard_num" - * params from the url. - * - * @param {string} testBundleUrl - * @return {object} params - * @property {number} params.shards - the total number of shards - * @property {number} params.shard_num - the current shard number, 1 based - */ -export function getShardingParamsFromUrl(url) { - const parsedUrl = parseUrl(url, true); - const parsedQuery = parsedUrl.query || {}; - - const params = {}; - if (parsedQuery.shards) { - params.shards = parseInt(parsedQuery.shards, 10); - } - - if (parsedQuery.shard_num) { - params.shard_num = parseInt(parsedQuery.shard_num, 10); - } - - return params; -} diff --git a/src/legacy/ui/public/test_harness/test_sharding/index.js b/src/legacy/ui/public/test_harness/test_sharding/index.js deleted file mode 100644 index cdca50725a058..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { setupTestSharding } from './setup_test_sharding'; diff --git a/src/legacy/ui/public/test_harness/test_sharding/setup_test_sharding.js b/src/legacy/ui/public/test_harness/test_sharding/setup_test_sharding.js deleted file mode 100644 index fce1876162387..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/setup_test_sharding.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { uniq, defaults } from 'lodash'; - -import { findTestBundleUrl } from './find_test_bundle_url'; -import { getShardingParamsFromUrl } from './get_sharding_params_from_url'; -import { setupTopLevelDescribeFilter } from './setup_top_level_describe_filter'; -import { getShardNum } from './get_shard_num'; - -const DEFAULT_PARAMS = { - shards: 1, - shard_num: 1, -}; - -export function setupTestSharding() { - const pageUrl = window.location.href; - const bundleUrl = findTestBundleUrl(); - - // supports overriding params via the debug page - // url in dev mode - const params = defaults( - {}, - getShardingParamsFromUrl(pageUrl), - getShardingParamsFromUrl(bundleUrl), - DEFAULT_PARAMS - ); - - const { shards: shardTotal, shard_num: shardNum } = params; - if (shardNum < 1 || shardNum > shardTotal) { - throw new TypeError( - `shard_num param of ${shardNum} must be greater 0 and less than the total, ${shardTotal}` - ); - } - - // track and log the number of ignored describe calls - const ignoredDescribeShards = []; - before(() => { - const ignoredCount = ignoredDescribeShards.length; - const ignoredFrom = uniq(ignoredDescribeShards).join(', '); - console.log(`Ignored ${ignoredCount} top-level suites from ${ignoredFrom}`); - }); - - // Filter top-level describe statements as they come - setupTopLevelDescribeFilter((describeName) => { - const describeShardNum = getShardNum(shardTotal, describeName); - if (describeShardNum === shardNum) return true; - // track shard numbers that we ignore - ignoredDescribeShards.push(describeShardNum); - }); - - console.log(`ready to load tests for shard ${shardNum} of ${shardTotal}`); -} diff --git a/src/legacy/ui/public/test_harness/test_sharding/setup_top_level_describe_filter.js b/src/legacy/ui/public/test_harness/test_sharding/setup_top_level_describe_filter.js deleted file mode 100644 index 726f890077b94..0000000000000 --- a/src/legacy/ui/public/test_harness/test_sharding/setup_top_level_describe_filter.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Intercept all calls to mocha.describe() and determine - * which calls make it through using a filter function. - * - * The filter function is also only called for top-level - * describe() calls; all describe calls nested within another - * are allowed based on the filter value for the parent - * describe - * - * ## example - * - * assume tests that look like this: - * - * ```js - * describe('section 1', () => { - * describe('item 1', () => { - * - * }) - * }) - * ``` - * - * If the filter function returned true for "section 1" then "item 1" - * would automatically be defined. If it returned false for "section 1" - * then "section 1" would be ignored and "item 1" would never be defined - * - * @param {function} test - a function that takes the first argument - * passed to describe, the sections name, and - * returns true if the describe call should - * be delegated to mocha, any other value causes - * the describe call to be ignored - * @return {undefined} - */ -export function setupTopLevelDescribeFilter(test) { - const originalDescribe = window.describe; - - if (!originalDescribe) { - throw new TypeError( - 'window.describe must be defined by mocha before test sharding can be setup' - ); - } - - /** - * When describe is called it is likely to make additional, nested, - * calls to describe. We track how deeply nested we are at any time - * with a depth counter, `describeCallDepth`. - * - * Before delegating a describe call to mocha we increment - * that counter, and once mocha is done we decrement it. - * - * This way, we can check if `describeCallDepth > 0` at any time - * to know if we are already within a describe call. - * - * ```js - * // +1 - * describe('section 1', () => { - * // describeCallDepth = 1 - * // +1 - * describe('item 1', () => { - * // describeCallDepth = 2 - * }) - * // -1 - * }) - * // -1 - * // describeCallDepth = 0 - * ``` - * - * @type {Number} - */ - let describeCallDepth = 0; - - const describeInterceptor = function (describeName, describeBody) { - const context = this; - - const isTopLevelCall = describeCallDepth === 0; - const shouldIgnore = isTopLevelCall && Boolean(test(describeName)) === false; - if (shouldIgnore) return; - - /** - * we wrap the delegation to mocha in a try/finally block - * to ensure that our describeCallDepth counter stays up - * to date even if the call throws an error. - * - * note that try/finally won't actually catch the error, it - * will continue to propagate up the call stack - */ - let result; - try { - describeCallDepth += 1; - result = originalDescribe.call(context, describeName, describeBody); - } finally { - describeCallDepth -= 1; - } - return result; - }; - - // to allow describe.only calls. we dont need interceptor as it will call describe internally - describeInterceptor.only = originalDescribe.only; - describeInterceptor.skip = originalDescribe.skip; - - // ensure that window.describe isn't messed with by other code - Object.defineProperty(window, 'describe', { - configurable: false, - enumerable: true, - value: describeInterceptor, - }); -} diff --git a/src/legacy/ui/ui_exports/ui_export_defaults.js b/src/legacy/ui/ui_exports/ui_export_defaults.js index f7ee9aa056762..348f4ee77fab4 100644 --- a/src/legacy/ui/ui_exports/ui_export_defaults.js +++ b/src/legacy/ui/ui_exports/ui_export_defaults.js @@ -30,7 +30,6 @@ export const UI_EXPORT_DEFAULTS = { webpackAliases: { ui: resolve(ROOT, 'src/legacy/ui/public'), __kibanaCore__$: resolve(ROOT, 'src/core/public'), - test_harness: resolve(ROOT, 'src/test_harness/public'), }, styleSheetPaths: ['light', 'dark'].map((theme) => ({ diff --git a/tasks/config/karma.js b/tasks/config/karma.js deleted file mode 100644 index 114e09876406c..0000000000000 --- a/tasks/config/karma.js +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { dirname } from 'path'; -import { times } from 'lodash'; -import { makeJunitReportPath } from '@kbn/test'; -import * as UiSharedDeps from '@kbn/ui-shared-deps'; - -const TOTAL_CI_SHARDS = 4; -const ROOT = dirname(require.resolve('../../package.json')); -const buildHash = String(Number.MAX_SAFE_INTEGER); - -module.exports = function (grunt) { - function pickBrowser() { - if (grunt.option('browser')) { - return grunt.option('browser'); - } - if (process.env.TEST_BROWSER_HEADLESS === '1') { - return 'Chrome_Headless'; - } - return 'Chrome'; - } - - function pickReporters() { - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - if (process.env.CI && process.env.DISABLE_JUNIT_REPORTER) { - return ['dots']; - } - - if (process.env.CI) { - return ['dots', 'junit']; - } - - return ['progress']; - } - - function getKarmaFiles(shardNum) { - return [ - 'http://localhost:5610/test_bundle/built_css.css', - // Sets global variables normally set by the bootstrap.js script - 'http://localhost:5610/test_bundle/karma/globals.js', - - ...UiSharedDeps.jsDepFilenames.map( - (chunkFilename) => - `http://localhost:5610/${buildHash}/bundles/kbn-ui-shared-deps/${chunkFilename}` - ), - `http://localhost:5610/${buildHash}/bundles/kbn-ui-shared-deps/${UiSharedDeps.jsFilename}`, - - shardNum === undefined - ? `http://localhost:5610/${buildHash}/bundles/tests.bundle.js` - : `http://localhost:5610/${buildHash}/bundles/tests.bundle.js?shards=${TOTAL_CI_SHARDS}&shard_num=${shardNum}`, - - `http://localhost:5610/${buildHash}/bundles/kbn-ui-shared-deps/${UiSharedDeps.baseCssDistFilename}`, - // this causes tilemap tests to fail, probably because the eui styles haven't been - // included in the karma harness a long some time, if ever - // `http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.lightCssDistFilename}`, - `http://localhost:5610/${buildHash}/bundles/tests.style.css`, - ]; - } - - const config = { - options: { - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - captureTimeout: 30000, - browserNoActivityTimeout: 120000, - frameworks: ['mocha'], - plugins: [ - 'karma-chrome-launcher', - 'karma-coverage', - 'karma-firefox-launcher', - 'karma-ie-launcher', - 'karma-junit-reporter', - 'karma-mocha', - 'karma-safari-launcher', - ], - port: 9876, - colors: true, - logLevel: grunt.option('debug') || grunt.option('verbose') ? 'DEBUG' : 'INFO', - autoWatch: false, - browsers: [pickBrowser()], - customLaunchers: { - Chrome_Headless: { - base: 'Chrome', - flags: ['--headless', '--disable-gpu', '--remote-debugging-port=9222'], - }, - }, - - reporters: pickReporters(), - - junitReporter: { - outputFile: makeJunitReportPath(ROOT, 'karma'), - useBrowserName: false, - nameFormatter: (_, result) => [...result.suite, result.description].join(' '), - classNameFormatter: (_, result) => { - const rootSuite = result.suite[0] || result.description; - return `Browser Unit Tests.${rootSuite.replace(/\./g, '·')}`; - }, - }, - - // list of files / patterns to load in the browser - files: getKarmaFiles(), - - proxies: { - '/tests/': 'http://localhost:5610/tests/', - '/test_bundle/': 'http://localhost:5610/test_bundle/', - [`/${buildHash}/bundles/`]: `http://localhost:5610/${buildHash}/bundles/`, - }, - - client: { - mocha: { - reporter: 'html', // change Karma's debug.html to the mocha web reporter - timeout: 10000, - slow: 5000, - }, - }, - }, - - dev: { singleRun: false }, - unit: { singleRun: true }, - coverage: { - singleRun: true, - reporters: ['coverage'], - coverageReporter: { - reporters: [{ type: 'html', dir: 'coverage' }, { type: 'text-summary' }], - }, - }, - }; - - /** - * ------------------------------------------------------------ - * CI sharding - * ------------------------------------------------------------ - * - * Every test retains nearly all of the memory it causes to be allocated, - * which has started to kill the test browser as the size of the test suite - * increases. This is a deep-rooted problem that will take some serious - * work to fix. - * - * CI sharding is a short-term solution that splits the top-level describe - * calls into different "shards" and instructs karma to only run one shard - * at a time, reloading the browser in between each shard and forcing the - * memory from the previous shard to be released. - * - * ## how - * - * Rather than modify the bundling process to produce multiple testing - * bundles, top-level describe calls are sharded by their first argument, - * the suite name. - * - * The number of shards to create is controlled with the TOTAL_CI_SHARDS - * constant defined at the top of this file. - * - * ## controlling sharding - * - * To control sharding in a specific karma configuration, the total number - * of shards to create (?shards=X), and the current shard number - * (&shard_num=Y), are added to the testing bundle url and read by the - * test_harness/setup_test_sharding[1] module. This allows us to use a - * different number of shards in different scenarios (ie. running - * `yarn test:karma` runs the tests in a single shard, effectively - * disabling sharding) - * - * These same parameters can also be defined in the URL/query string of the - * karma debug page (started when you run `yarn test:karma:debug`). - * - * ## debugging - * - * It is *possible* that some tests will only pass if run after/with certain - * other suites. To debug this, make sure that your tests pass in isolation - * (by clicking the suite name on the karma debug page) and that it runs - * correctly in it's given shard (using the `?shards=X&shard_num=Y` query - * string params on the karma debug page). You can spot the shard number - * a test is running in by searching for the "ready to load tests for shard X" - * log message. - * - * [1]: src/legacy/ui/public/test_harness/test_sharding/setup_test_sharding.js - */ - times(TOTAL_CI_SHARDS, (i) => { - const n = i + 1; - config[`ciShard-${n}`] = { - singleRun: true, - options: { - files: getKarmaFiles(n), - }, - }; - }); - - return config; -}; diff --git a/tasks/config/run.js b/tasks/config/run.js index 98a1226834bc6..9ac8f72d56d4a 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -17,7 +17,6 @@ * under the License. */ -import { resolve } from 'path'; import { getFunctionalTestGroupRunConfigs } from '../function_test_groups'; const { version } = require('../../package.json'); @@ -25,44 +24,7 @@ const KIBANA_INSTALL_DIR = process.env.KIBANA_INSTALL_DIR || `./build/oss/kibana-${version}-SNAPSHOT-${process.platform}-x86_64`; -module.exports = function (grunt) { - function createKbnServerTask({ runBuild, flags = [] }) { - return { - options: { - wait: false, - ready: /http server running/, - quiet: false, - failOnError: false, - }, - cmd: runBuild ? `./build/${runBuild}/bin/kibana` : process.execPath, - args: [ - ...(runBuild ? [] : [require.resolve('../../scripts/kibana'), '--oss']), - - '--logging.json=false', - - ...flags, - - // allow the user to override/inject flags by defining cli args starting with `--kbnServer.` - ...grunt.option.flags().reduce(function (flags, flag) { - if (flag.startsWith('--kbnServer.')) { - flags.push(`--${flag.slice(12)}`); - } - - return flags; - }, []), - ], - }; - } - - const karmaTestServerFlags = [ - '--env.name=development', - '--plugins.initialize=false', - '--optimize.bundleFilter=tests', - '--optimize.validateSyntaxOfNodeModules=false', - '--server.port=5610', - '--migrations.skip=true', - ]; - +module.exports = function () { const NODE = 'node'; const YARN = 'yarn'; const scriptWithGithubChecks = ({ title, options, cmd, args }) => @@ -177,37 +139,6 @@ module.exports = function (grunt) { ], }), - // used by the test:karma task - // runs the kibana server to serve the browser test bundle - karmaTestServer: createKbnServerTask({ - flags: [...karmaTestServerFlags], - }), - browserSCSS: createKbnServerTask({ - flags: [...karmaTestServerFlags, '--optimize', '--optimize.enabled=false'], - }), - - // used by the test:coverage task - // runs the kibana server to serve the instrumented version of the browser test bundle - karmaTestCoverageServer: createKbnServerTask({ - flags: [...karmaTestServerFlags, '--tests_bundle.instrument=true'], - }), - - // used by the test:karma:debug task - // runs the kibana server to serve the browser test bundle, but listens for changes - // to the public/browser code and rebuilds the test bundle on changes - karmaTestDebugServer: createKbnServerTask({ - flags: [ - ...karmaTestServerFlags, - '--dev', - '--no-dev-config', - '--no-watch', - '--no-base-path', - '--optimize.watchPort=5611', - '--optimize.watchPrebuild=true', - '--optimize.bundleDir=' + resolve(__dirname, '../../data/optimize/testdev'), - ], - }), - verifyNotice: scriptWithGithubChecks({ title: 'Verify NOTICE.txt', options: { @@ -325,7 +256,6 @@ module.exports = function (grunt) { 'test:jest_integration' ), test_projects: gruntTaskWithGithubChecks('Project tests', 'test:projects'), - test_karma_ci: gruntTaskWithGithubChecks('Browser tests', 'test:karma-ci'), ...getFunctionalTestGroupRunConfigs({ kibanaInstallDir: KIBANA_INSTALL_DIR, diff --git a/tasks/jenkins.js b/tasks/jenkins.js index eece5df61a7d1..adfb6f0f46868 100644 --- a/tasks/jenkins.js +++ b/tasks/jenkins.js @@ -37,7 +37,6 @@ module.exports = function (grunt) { 'run:test_jest', 'run:test_jest_integration', 'run:test_projects', - 'run:test_karma_ci', 'run:test_hardening', 'run:test_package_safer_lodash_set', 'run:apiIntegrationTests', diff --git a/tasks/test.js b/tasks/test.js index 09821b97fe2e8..f370ea0b948c6 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -17,8 +17,6 @@ * under the License. */ -import _, { keys } from 'lodash'; - import { run } from '../utilities/visual_regression'; module.exports = function (grunt) { @@ -31,25 +29,6 @@ module.exports = function (grunt) { } ); - grunt.registerTask('test:karma', [ - 'checkPlugins', - 'run:browserSCSS', - 'run:karmaTestServer', - 'karma:unit', - ]); - - grunt.registerTask('test:karma-ci', () => { - const ciShardTasks = keys(grunt.config.get('karma')) - .filter((key) => key.startsWith('ciShard-')) - .map((key) => `karma:${key}`); - - grunt.log.ok(`Running UI tests in ${ciShardTasks.length} shards`); - grunt.task.run(['run:browserSCSS']); - grunt.task.run(['run:karmaTestServer', ...ciShardTasks]); - }); - - grunt.registerTask('test:coverage', ['run:karmaTestCoverageServer', 'karma:coverage']); - grunt.registerTask('test:quick', [ 'checkPlugins', 'run:mocha', @@ -57,18 +36,16 @@ module.exports = function (grunt) { 'test:jest', 'test:jest_integration', 'test:projects', - 'test:karma', 'run:apiIntegrationTests', ]); - grunt.registerTask('test:karmaDebug', ['checkPlugins', 'run:karmaTestDebugServer', 'karma:dev']); grunt.registerTask('test:mochaCoverage', ['run:mochaCoverage']); grunt.registerTask('test', (subTask) => { if (subTask) grunt.fail.fatal(`invalid task "test:${subTask}"`); grunt.task.run( - _.compact([ + [ !grunt.option('quick') && 'run:eslint', !grunt.option('quick') && 'run:sasslint', !grunt.option('quick') && 'run:checkTsProjects', @@ -78,7 +55,7 @@ module.exports = function (grunt) { 'run:checkFileCasing', 'run:licenses', 'test:quick', - ]) + ].filter(Boolean) ); }); diff --git a/test/scripts/jenkins_xpack.sh b/test/scripts/jenkins_xpack.sh index bc927b1ed7b4d..77480554f738c 100755 --- a/test/scripts/jenkins_xpack.sh +++ b/test/scripts/jenkins_xpack.sh @@ -3,9 +3,9 @@ source test/scripts/jenkins_test_setup.sh if [[ -z "$CODE_COVERAGE" ]] ; then - echo " -> Running mocha tests" - cd "$XPACK_DIR" - checks-reporter-with-killswitch "X-Pack Karma Tests" yarn test:karma + echo " -> Building legacy styles for x-pack canvas storyshot tests" + cd "$KIBANA_DIR" + node scripts/build_sass echo "" echo "" diff --git a/x-pack/README.md b/x-pack/README.md index 03d2e3287c0f0..0449f1fc1bdab 100644 --- a/x-pack/README.md +++ b/x-pack/README.md @@ -44,14 +44,6 @@ If you want to run tests only for a specific plugin (to save some time), you can yarn test --plugins [,]* # where is "reporting", etc. ``` -#### Debugging browser tests -``` -yarn test:karma:debug -``` -Initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests. - -Run single tests by appending `grep` parameter to the end of the URL. For example `http://localhost:9876/debug.html?grep=ML%20-%20Explorer%20Controller` will only run tests with 'ML - Explorer Controller' in the describe block. - #### Running server unit tests You can run mocha unit tests by running: diff --git a/x-pack/gulpfile.js b/x-pack/gulpfile.js index 7e5ab9b18f019..78ed2bff8cb01 100644 --- a/x-pack/gulpfile.js +++ b/x-pack/gulpfile.js @@ -8,7 +8,6 @@ require('../src/setup_node_env'); const { buildTask } = require('./tasks/build'); const { devTask } = require('./tasks/dev'); -const { testTask, testKarmaTask, testKarmaDebugTask } = require('./tasks/test'); const { downloadChromium } = require('./tasks/download_chromium'); // export the tasks that are runnable from the CLI @@ -16,7 +15,4 @@ module.exports = { build: buildTask, dev: devTask, downloadChromium, - test: testTask, - 'test:karma': testKarmaTask, - 'test:karma:debug': testKarmaDebugTask, }; diff --git a/x-pack/package.json b/x-pack/package.json index c93aa95f97adb..b69c1776366b2 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -11,8 +11,6 @@ "build": "gulp build", "testonly": "echo 'Deprecated, use `yarn test`' && gulp test", "test": "gulp test", - "test:karma:debug": "gulp test:karma:debug", - "test:karma": "gulp test:karma", "test:jest": "node scripts/jest", "test:mocha": "node scripts/mocha" }, diff --git a/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js b/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js deleted file mode 100644 index c159f478766ce..0000000000000 --- a/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 React from 'react'; -import expect from '@kbn/expect'; -import { shallow } from 'enzyme'; -import { EuiLoadingSpinner, EuiIcon } from '@elastic/eui'; -import { Loading } from '../loading'; - -describe('', () => { - it('uses EuiIcon by default', () => { - const wrapper = shallow(); - expect(wrapper.contains()).to.be.ok; - expect(wrapper.contains()).to.not.be.ok; - }); - - it('uses EuiLoadingSpinner when animating', () => { - const wrapper = shallow(); - expect(wrapper.contains()).to.not.be.ok; - expect(wrapper.contains()).to.be.ok; - }); -}); diff --git a/x-pack/plugins/canvas/public/components/loading/loading.test.tsx b/x-pack/plugins/canvas/public/components/loading/loading.test.tsx new file mode 100644 index 0000000000000..004ecc19c42e2 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/loading/loading.test.tsx @@ -0,0 +1,36 @@ +/* + * 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 React from 'react'; +import { shallow } from 'enzyme'; +import { Loading } from './loading'; + +describe('', () => { + it('uses EuiIcon by default', () => { + expect(shallow()).toMatchInlineSnapshot(` +
+ +
+ `); + }); + + it('uses EuiLoadingSpinner when animating', () => { + expect(shallow()).toMatchInlineSnapshot(` +
+ +
+ `); + }); +}); diff --git a/x-pack/plugins/canvas/public/functions/__tests__/asset.js b/x-pack/plugins/canvas/public/functions/__tests__/asset.js deleted file mode 100644 index c21faf9a2e227..0000000000000 --- a/x-pack/plugins/canvas/public/functions/__tests__/asset.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; -import { functionWrapper } from '../../../__tests__/helpers/function_wrapper'; -import { asset } from '../asset'; - -// TODO: restore this test -// will require the ability to mock the store, or somehow remove the function's dependency on getState -describe.skip('asset', () => { - const fn = functionWrapper(asset); - - it('throws if asset could not be retrieved by ID', () => { - const throwsErr = () => { - return fn(null, { id: 'boo' }); - }; - expect(throwsErr).to.throwException((err) => { - expect(err.message).to.be('Could not get the asset by ID: boo'); - }); - }); - - it('returns the asset for found asset ID', () => { - expect(fn(null, { id: 'yay' })).to.be('here is your image'); - }); -}); diff --git a/x-pack/plugins/canvas/public/lib/__tests__/find_expression_type.js b/x-pack/plugins/canvas/public/lib/__tests__/find_expression_type.js deleted file mode 100644 index 58f5c5eb303bd..0000000000000 --- a/x-pack/plugins/canvas/public/lib/__tests__/find_expression_type.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 expect from 'expect.js'; -// import proxyquire from 'proxyquire'; -// import { Registry } from '../../../common/lib/registry'; - -// const registries = { -// datasource: new Registry(), -// transform: new Registry(), -// model: new Registry(), -// view: new Registry(), -// }; - -// const { findExpressionType } = proxyquire.noCallThru().load('../find_expression_type', { -// '../expression_types/datasource': { -// datasourceRegistry: registries.datasource, -// }, -// '../expression_types/transform': { -// transformRegistry: registries.transform, -// }, -// '../expression_types/model': { -// modelRegistry: registries.model, -// }, -// '../expression_types/view': { -// viewRegistry: registries.view, -// }, -// }); - -// describe('findExpressionType', () => { -// let expTypes; - -// beforeEach(() => { -// expTypes = []; -// const keys = Object.keys(registries); -// keys.forEach(key => { -// const reg = registries[key]; -// reg.reset(); - -// const expObj = () => ({ -// name: `__test_${key}`, -// key, -// }); -// expTypes.push(expObj); -// reg.register(expObj); -// }); -// }); - -// describe('all types', () => { -// it('returns the matching item, by name', () => { -// const match = findExpressionType('__test_model'); -// expect(match).to.eql(expTypes[2]()); -// }); - -// it('returns null when nothing is found', () => { -// const match = findExpressionType('@@nope_nope_nope'); -// expect(match).to.equal(null); -// }); - -// it('throws with multiple matches', () => { -// const commonName = 'commonName'; -// registries.transform.register(() => ({ -// name: commonName, -// })); -// registries.model.register(() => ({ -// name: commonName, -// })); - -// const check = () => { -// findExpressionType(commonName); -// }; -// expect(check).to.throwException(/Found multiple expressions/i); -// }); -// }); - -// describe('specific type', () => { -// it('return the match item, by name and type', () => { -// const match = findExpressionType('__test_view', 'view'); -// expect(match).to.eql(expTypes[3]()); -// }); - -// it('returns null with no match by name and type', () => { -// const match = findExpressionType('__test_view', 'datasource'); -// expect(match).to.equal(null); -// }); -// }); -// }); - -// TODO: restore this test -// proxyquire can not be used to inject mock registries - -describe.skip('findExpressionType', () => {}); diff --git a/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js b/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js deleted file mode 100644 index 99d8305768240..0000000000000 --- a/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; -import lzString from 'lz-string'; -import { historyProvider } from '../history_provider'; - -function createState() { - return { - transient: { - selectedPage: 'page-f3ce-4bb7-86c8-0417606d6592', - selectedToplevelNodes: ['element-d88c-4bbd-9453-db22e949b92e'], - resolvedArgs: {}, - }, - persistent: { - schemaVersion: 0, - time: new Date().getTime(), - }, - }; -} - -describe.skip('historyProvider', () => { - let history; - let state; - - beforeEach(() => { - history = historyProvider(); - state = createState(); - }); - - describe('instances', () => { - it('should return the same instance for the same window object', () => { - expect(historyProvider()).to.equal(history); - }); - - it('should return different instance for different window object', () => { - const newWindow = {}; - expect(historyProvider(newWindow)).not.to.be(history); - }); - }); - - describe('push updates', () => { - beforeEach(() => { - history.push(state); - }); - - afterEach(() => { - // reset state back to initial after each test - history.undo(); - }); - - describe('push', () => { - it('should add state to location', () => { - expect(history.getLocation().state).to.eql(state); - }); - - it('should push compressed state into history', () => { - const hist = history.historyInstance; - expect(hist.location.state).to.equal(lzString.compress(JSON.stringify(state))); - }); - }); - - describe.skip('undo', () => { - it('should move history back', () => { - // pushed location has state value - expect(history.getLocation().state).to.eql(state); - - // back to initial location with null state - history.undo(); - expect(history.getLocation().state).to.be(null); - }); - }); - - describe.skip('redo', () => { - it('should move history forward', () => { - // back to initial location, with null state - history.undo(); - expect(history.getLocation().state).to.be(null); - - // return to pushed location, with state value - history.redo(); - expect(history.getLocation().state).to.eql(state); - }); - }); - }); - - describe.skip('replace updates', () => { - beforeEach(() => { - history.replace(state); - }); - - afterEach(() => { - // reset history to default after each test - history.replace(null); - }); - - describe('replace', () => { - it('should replace state in window history', () => { - expect(history.getLocation().state).to.eql(state); - }); - - it('should replace compressed state into history', () => { - const hist = history.historyInstance; - expect(hist.location.state).to.equal(lzString.compress(JSON.stringify(state))); - }); - }); - }); - - describe('onChange', () => { - const createOnceHandler = (history, done, fn) => { - const teardown = history.onChange((location, prevLocation) => { - if (typeof fn === 'function') { - fn(location, prevLocation); - } - teardown(); - done(); - }); - }; - - it('should return a method to remove the listener', () => { - const handler = () => 'hello world'; - const teardownFn = history.onChange(handler); - - expect(teardownFn).to.be.a('function'); - - // teardown the listener - teardownFn(); - }); - - it('should call handler on state change', (done) => { - createOnceHandler(history, done, (loc) => { - expect(loc).to.be.a('object'); - }); - - history.push({}); - }); - - it('should pass location object to handler', (done) => { - createOnceHandler(history, done, (location) => { - expect(location.pathname).to.be.a('string'); - expect(location.hash).to.be.a('string'); - expect(location.state).to.be.an('object'); - expect(location.action).to.equal('push'); - }); - - history.push(state); - }); - - it('should pass decompressed state to handler', (done) => { - createOnceHandler(history, done, ({ state: curState }) => { - expect(curState).to.eql(state); - }); - - history.push(state); - }); - - it('should pass in the previous location object to handler', (done) => { - createOnceHandler(history, done, (location, prevLocation) => { - expect(prevLocation.pathname).to.be.a('string'); - expect(prevLocation.hash).to.be.a('string'); - expect(prevLocation.state).to.be(null); - expect(prevLocation.action).to.equal('push'); - }); - - history.push(state); - }); - }); - - describe('resetOnChange', () => { - // the history onChange handler was made async and now there's no way to know when the handler was called - // TODO: restore these tests. - it.skip('removes listeners', () => { - const createHandler = () => { - let callCount = 0; - - function handlerFn() { - callCount += 1; - } - handlerFn.getCallCount = () => callCount; - - return handlerFn; - }; - - const handler1 = createHandler(); - const handler2 = createHandler(); - - // attach and test the first handler - history.onChange(handler1); - - expect(handler1.getCallCount()).to.equal(0); - history.push({}); - expect(handler1.getCallCount()).to.equal(1); - - // attach and test the second handler - history.onChange(handler2); - - expect(handler2.getCallCount()).to.equal(0); - history.push({}); - expect(handler1.getCallCount()).to.equal(2); - expect(handler2.getCallCount()).to.equal(1); - - // remove all handlers - history.resetOnChange(); - history.push({}); - expect(handler1.getCallCount()).to.equal(2); - expect(handler2.getCallCount()).to.equal(1); - }); - }); - - describe('parse', () => { - it('returns the decompressed object', () => { - history.push(state); - - const hist = history.historyInstance; - const rawState = hist.location.state; - - expect(rawState).to.be.a('string'); - expect(history.parse(rawState)).to.eql(state); - }); - - it('returns null with invalid JSON', () => { - expect(history.parse('hello')).to.be(null); - }); - }); - - describe('encode', () => { - it('returns the compressed string', () => { - history.push(state); - - const hist = history.historyInstance; - const rawState = hist.location.state; - - expect(rawState).to.be.a('string'); - expect(history.encode(state)).to.eql(rawState); - }); - }); -}); diff --git a/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js b/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js deleted file mode 100644 index 75454890f9717..0000000000000 --- a/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; -import { prepend, append } from '../modify_path'; - -describe('modify paths', () => { - describe('prepend', () => { - it('prepends a string path', () => { - expect(prepend('a.b.c', '0')).to.eql([0, 'a', 'b', 'c']); - expect(prepend('a.b.c', ['0', '1'])).to.eql([0, 1, 'a', 'b', 'c']); - }); - - it('prepends an array path', () => { - expect(prepend(['a', 1, 'last'], '0')).to.eql([0, 'a', 1, 'last']); - expect(prepend(['a', 1, 'last'], [0, 1])).to.eql([0, 1, 'a', 1, 'last']); - }); - }); - - describe('append', () => { - it('appends to a string path', () => { - expect(append('one.2.3', 'zero')).to.eql(['one', 2, 3, 'zero']); - expect(append('one.2.3', ['zero', 'one'])).to.eql(['one', 2, 3, 'zero', 'one']); - }); - - it('appends to an array path', () => { - expect(append(['testString'], 'huzzah')).to.eql(['testString', 'huzzah']); - expect(append(['testString'], ['huzzah', 'yosh'])).to.eql(['testString', 'huzzah', 'yosh']); - }); - }); -}); diff --git a/x-pack/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts b/x-pack/plugins/canvas/public/lib/get_pretty_shortcut.test.ts similarity index 98% rename from x-pack/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts rename to x-pack/plugins/canvas/public/lib/get_pretty_shortcut.test.ts index 783b085f3da7e..95cffefde7b1c 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts +++ b/x-pack/plugins/canvas/public/lib/get_pretty_shortcut.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getPrettyShortcut } from '../get_pretty_shortcut'; +import { getPrettyShortcut } from './get_pretty_shortcut'; describe('getPrettyShortcut', () => { test('uppercases shortcuts', () => { diff --git a/x-pack/plugins/canvas/public/lib/modify_path.test.ts b/x-pack/plugins/canvas/public/lib/modify_path.test.ts new file mode 100644 index 0000000000000..245b91ca4ccd4 --- /dev/null +++ b/x-pack/plugins/canvas/public/lib/modify_path.test.ts @@ -0,0 +1,33 @@ +/* + * 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 { prepend, append } from './modify_path'; + +describe('modify paths', () => { + describe('prepend', () => { + it('prepends a string path', () => { + expect(prepend('a.b.c', '0')).toEqual(['0', 'a', 'b', 'c']); + expect(prepend('a.b.c', ['0', '1'])).toEqual(['0', '1', 'a', 'b', 'c']); + }); + + it('prepends an array path', () => { + expect(prepend(['a', 1, 'last'], '0')).toEqual(['0', 'a', '1', 'last']); + expect(prepend(['a', 1, 'last'], [0, 1])).toEqual(['0', '1', 'a', '1', 'last']); + }); + }); + + describe('append', () => { + it('appends to a string path', () => { + expect(append('one.2.3', 'zero')).toEqual(['one', '2', '3', 'zero']); + expect(append('one.2.3', ['zero', 'one'])).toEqual(['one', '2', '3', 'zero', 'one']); + }); + + it('appends to an array path', () => { + expect(append(['testString'], 'huzzah')).toEqual(['testString', 'huzzah']); + expect(append(['testString'], ['huzzah', 'yosh'])).toEqual(['testString', 'huzzah', 'yosh']); + }); + }); +}); diff --git a/x-pack/plugins/canvas/public/lib/modify_path.js b/x-pack/plugins/canvas/public/lib/modify_path.ts similarity index 61% rename from x-pack/plugins/canvas/public/lib/modify_path.js rename to x-pack/plugins/canvas/public/lib/modify_path.ts index 714a616679bc9..a5b8f0316d23e 100644 --- a/x-pack/plugins/canvas/public/lib/modify_path.js +++ b/x-pack/plugins/canvas/public/lib/modify_path.ts @@ -6,14 +6,16 @@ import { toPath } from 'lodash'; -export function prepend(path, value) { +export type Path = Array; + +export function prepend(path: string | Path, value: string | Path): Path { return toPath(value).concat(toPath(path)); } -export function append(path, value) { +export function append(path: string | Path, value: string | Path): Path { return toPath(path).concat(toPath(value)); } -export function convert(path) { +export function convert(path: string | Path): Path { return toPath(path); } diff --git a/x-pack/plugins/canvas/public/lib/__tests__/readable_color.test.ts b/x-pack/plugins/canvas/public/lib/readable_color.test.ts similarity index 94% rename from x-pack/plugins/canvas/public/lib/__tests__/readable_color.test.ts rename to x-pack/plugins/canvas/public/lib/readable_color.test.ts index bd79655ca727b..ce7cf03c2889c 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/readable_color.test.ts +++ b/x-pack/plugins/canvas/public/lib/readable_color.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { readableColor } from '../readable_color'; +import { readableColor } from './readable_color'; describe('readableColor', () => { test('light', () => { diff --git a/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js b/x-pack/plugins/canvas/public/lib/resolved_arg.test.ts similarity index 57% rename from x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js rename to x-pack/plugins/canvas/public/lib/resolved_arg.test.ts index 9e582ddd1858b..fac2023fb2ce5 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js +++ b/x-pack/plugins/canvas/public/lib/resolved_arg.test.ts @@ -4,39 +4,38 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; -import { getState, getValue, getError } from '../resolved_arg'; +import { getState, getValue, getError } from './resolved_arg'; describe('resolved arg helper', () => { describe('getState', () => { it('returns pending by default', () => { - expect(getState()).to.be(null); + expect(getState()).toBe(null); }); it('returns the state', () => { - expect(getState({ state: 'pending' })).to.equal('pending'); - expect(getState({ state: 'ready' })).to.equal('ready'); - expect(getState({ state: 'error' })).to.equal('error'); + expect(getState({ state: 'pending' })).toEqual('pending'); + expect(getState({ state: 'ready' })).toEqual('ready'); + expect(getState({ state: 'error' })).toEqual('error'); }); }); describe('getValue', () => { it('returns null by default', () => { - expect(getValue()).to.be(null); + expect(getValue()).toBe(null); }); it('returns the value', () => { - expect(getValue({ value: 'hello test' })).to.equal('hello test'); + expect(getValue({ value: 'hello test' })).toEqual('hello test'); }); }); describe('getError', () => { it('returns null by default', () => { - expect(getError()).to.be(null); + expect(getError()).toBe(null); }); it('returns null when state is not error', () => { - expect(getError({ state: 'pending', error: 'nope' })).to.be(null); + expect(getError({ state: 'pending', error: 'nope' })).toBe(null); }); it('returns the error', () => { @@ -46,8 +45,7 @@ describe('resolved arg helper', () => { error: new Error('i failed'), }; - expect(getError(arg)).to.be.an(Error); - expect(getError(arg).toString()).to.match(/i failed/); + expect(getError(arg)).toMatchInlineSnapshot(`[Error: i failed]`); }); }); }); diff --git a/x-pack/plugins/canvas/public/lib/resolved_arg.js b/x-pack/plugins/canvas/public/lib/resolved_arg.ts similarity index 75% rename from x-pack/plugins/canvas/public/lib/resolved_arg.js rename to x-pack/plugins/canvas/public/lib/resolved_arg.ts index 8a9da8e466f7e..77f8a6cf8e5e0 100644 --- a/x-pack/plugins/canvas/public/lib/resolved_arg.js +++ b/x-pack/plugins/canvas/public/lib/resolved_arg.ts @@ -6,15 +6,15 @@ import { get } from 'lodash'; -export function getState(resolvedArg) { +export function getState(resolvedArg?: any): any { return get(resolvedArg, 'state', null); } -export function getValue(resolvedArg) { +export function getValue(resolvedArg?: any): any { return get(resolvedArg, 'value', null); } -export function getError(resolvedArg) { +export function getError(resolvedArg?: any): any { if (getState(resolvedArg) !== 'error') { return null; } diff --git a/x-pack/plugins/canvas/public/lib/__tests__/time_interval.test.ts b/x-pack/plugins/canvas/public/lib/time_interval.test.ts similarity index 98% rename from x-pack/plugins/canvas/public/lib/__tests__/time_interval.test.ts rename to x-pack/plugins/canvas/public/lib/time_interval.test.ts index 2dab00631cce1..8a057793ead79 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/time_interval.test.ts +++ b/x-pack/plugins/canvas/public/lib/time_interval.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getTimeInterval, createTimeInterval, isValidTimeInterval } from '../time_interval'; +import { getTimeInterval, createTimeInterval, isValidTimeInterval } from './time_interval'; describe('time_interval', () => { test('getTimeInterval', () => { diff --git a/x-pack/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js b/x-pack/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js deleted file mode 100644 index 198ccb2ffc381..0000000000000 --- a/x-pack/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; -import { getSiblingContext } from '../elements'; - -const state = { - transient: { - resolvedArgs: { - 'element-foo': { - expressionContext: { - '0': { - state: 'ready', - value: { - type: 'datatable', - columns: [ - { name: 'project', type: 'string' }, - { name: 'cost', type: 'string' }, - { name: 'age', type: 'string' }, - ], - rows: [ - { project: 'pandas', cost: '500', age: '18' }, - { project: 'tigers', cost: '200', age: '12' }, - ], - }, - error: null, - }, - '1': { - state: 'ready', - value: { - type: 'datatable', - columns: [ - { name: 'project', type: 'string' }, - { name: 'cost', type: 'string' }, - { name: 'age', type: 'string' }, - ], - rows: [ - { project: 'tigers', cost: '200', age: '12' }, - { project: 'pandas', cost: '500', age: '18' }, - ], - }, - error: null, - }, - '2': { - state: 'ready', - value: { - type: 'pointseries', - columns: { - x: { type: 'string', role: 'dimension', expression: 'cost' }, - y: { type: 'string', role: 'dimension', expression: 'project' }, - color: { type: 'string', role: 'dimension', expression: 'project' }, - }, - rows: [ - { x: '200', y: 'tigers', color: 'tigers' }, - { x: '500', y: 'pandas', color: 'pandas' }, - ], - }, - error: null, - }, - }, - }, - }, - }, -}; - -describe('actions/elements getSiblingContext', () => { - it('should find context when a previous context value is found', () => { - // pointseries map - expect(getSiblingContext(state, 'element-foo', 2)).to.eql({ - index: 2, - context: { - type: 'pointseries', - columns: { - x: { type: 'string', role: 'dimension', expression: 'cost' }, - y: { type: 'string', role: 'dimension', expression: 'project' }, - color: { type: 'string', role: 'dimension', expression: 'project' }, - }, - rows: [ - { x: '200', y: 'tigers', color: 'tigers' }, - { x: '500', y: 'pandas', color: 'pandas' }, - ], - }, - }); - }); - - it('should find context when a previous context value is not found', () => { - // pointseries map - expect(getSiblingContext(state, 'element-foo', 1000)).to.eql({ - index: 2, - context: { - type: 'pointseries', - columns: { - x: { type: 'string', role: 'dimension', expression: 'cost' }, - y: { type: 'string', role: 'dimension', expression: 'project' }, - color: { type: 'string', role: 'dimension', expression: 'project' }, - }, - rows: [ - { x: '200', y: 'tigers', color: 'tigers' }, - { x: '500', y: 'pandas', color: 'pandas' }, - ], - }, - }); - }); -}); diff --git a/x-pack/plugins/canvas/public/state/actions/elements.test.js b/x-pack/plugins/canvas/public/state/actions/elements.test.js new file mode 100644 index 0000000000000..a790e81e65e25 --- /dev/null +++ b/x-pack/plugins/canvas/public/state/actions/elements.test.js @@ -0,0 +1,106 @@ +/* + * 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 { getSiblingContext } from './elements'; + +describe('getSiblingContext', () => { + const state = { + transient: { + resolvedArgs: { + 'element-foo': { + expressionContext: { + '0': { + state: 'ready', + value: { + type: 'datatable', + columns: [ + { name: 'project', type: 'string' }, + { name: 'cost', type: 'string' }, + { name: 'age', type: 'string' }, + ], + rows: [ + { project: 'pandas', cost: '500', age: '18' }, + { project: 'tigers', cost: '200', age: '12' }, + ], + }, + error: null, + }, + '1': { + state: 'ready', + value: { + type: 'datatable', + columns: [ + { name: 'project', type: 'string' }, + { name: 'cost', type: 'string' }, + { name: 'age', type: 'string' }, + ], + rows: [ + { project: 'tigers', cost: '200', age: '12' }, + { project: 'pandas', cost: '500', age: '18' }, + ], + }, + error: null, + }, + '2': { + state: 'ready', + value: { + type: 'pointseries', + columns: { + x: { type: 'string', role: 'dimension', expression: 'cost' }, + y: { type: 'string', role: 'dimension', expression: 'project' }, + color: { type: 'string', role: 'dimension', expression: 'project' }, + }, + rows: [ + { x: '200', y: 'tigers', color: 'tigers' }, + { x: '500', y: 'pandas', color: 'pandas' }, + ], + }, + error: null, + }, + }, + }, + }, + }, + }; + + it('should find context when a previous context value is found', () => { + // pointseries map + expect(getSiblingContext(state, 'element-foo', 2)).toEqual({ + index: 2, + context: { + type: 'pointseries', + columns: { + x: { type: 'string', role: 'dimension', expression: 'cost' }, + y: { type: 'string', role: 'dimension', expression: 'project' }, + color: { type: 'string', role: 'dimension', expression: 'project' }, + }, + rows: [ + { x: '200', y: 'tigers', color: 'tigers' }, + { x: '500', y: 'pandas', color: 'pandas' }, + ], + }, + }); + }); + + it('should find context when a previous context value is not found', () => { + // pointseries map + expect(getSiblingContext(state, 'element-foo', 1000)).toEqual({ + index: 2, + context: { + type: 'pointseries', + columns: { + x: { type: 'string', role: 'dimension', expression: 'cost' }, + y: { type: 'string', role: 'dimension', expression: 'project' }, + color: { type: 'string', role: 'dimension', expression: 'project' }, + }, + rows: [ + { x: '200', y: 'tigers', color: 'tigers' }, + { x: '500', y: 'pandas', color: 'pandas' }, + ], + }, + }); + }); +}); diff --git a/x-pack/plugins/canvas/public/state/middleware/in_flight.ts b/x-pack/plugins/canvas/public/state/middleware/in_flight.ts index 028b9f214133f..d564a44b0b5f7 100644 --- a/x-pack/plugins/canvas/public/state/middleware/in_flight.ts +++ b/x-pack/plugins/canvas/public/state/middleware/in_flight.ts @@ -9,7 +9,6 @@ import { loadingIndicator as defaultLoadingIndicator, LoadingIndicatorInterface, } from '../../lib/loading_indicator'; -// @ts-expect-error import { convert } from '../../lib/modify_path'; interface InFlightMiddlewareOptions { diff --git a/x-pack/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js b/x-pack/plugins/canvas/public/state/reducers/__fixtures__/action_creator.js similarity index 100% rename from x-pack/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js rename to x-pack/plugins/canvas/public/state/reducers/__fixtures__/action_creator.js diff --git a/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js b/x-pack/plugins/canvas/public/state/reducers/elements.test.js similarity index 78% rename from x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js rename to x-pack/plugins/canvas/public/state/reducers/elements.test.js index e1f7509325a7a..23f684879ce06 100644 --- a/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js +++ b/x-pack/plugins/canvas/public/state/reducers/elements.test.js @@ -4,10 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; -import { get } from 'lodash'; -import { elementsReducer } from '../elements'; -import { actionCreator } from './fixtures/action_creator'; +import { elementsReducer } from './elements'; +import { actionCreator } from './__fixtures__/action_creator'; describe('elements reducer', () => { let state; @@ -46,8 +44,8 @@ describe('elements reducer', () => { }); const newState = elementsReducer(state, action); - const newElement = get(newState, ['pages', 0, 'elements', 1]); + const newElement = newState?.pages?.[0]?.elements?.[1]; - expect(newElement).to.eql(expected); + expect(newElement).toEqual(expected); }); }); diff --git a/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js similarity index 62% rename from x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js rename to x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js index ee1d0fc1ca9ba..74f1544403e67 100644 --- a/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js +++ b/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js @@ -4,11 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; -import * as actions from '../../actions/resolved_args'; -import { flushContextAfterIndex } from '../../actions/elements'; -import { resolvedArgsReducer } from '../resolved_args'; -import { actionCreator } from './fixtures/action_creator'; +import * as actions from '../actions/resolved_args'; +import { flushContextAfterIndex } from '../actions/elements'; +import { resolvedArgsReducer } from './resolved_args'; +import { actionCreator } from './__fixtures__/action_creator'; describe('resolved args reducer', () => { let state; @@ -41,13 +40,15 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-1']).to.eql([ - { - state: 'pending', - value: null, - error: null, - }, - ]); + expect(newState.resolvedArgs['element-1']).toMatchInlineSnapshot(` + Object { + "0": Object { + "error": null, + "state": "pending", + "value": null, + }, + } + `); }); it('sets state to loading, with array path', () => { @@ -56,13 +57,15 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-1']).to.eql([ - { - state: 'pending', - value: null, - error: null, - }, - ]); + expect(newState.resolvedArgs['element-1']).toMatchInlineSnapshot(` + Object { + "0": Object { + "error": null, + "state": "pending", + "value": null, + }, + } + `); }); }); @@ -75,13 +78,15 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-1']).to.eql([ - { - state: 'ready', - value, - error: null, - }, - ]); + expect(newState.resolvedArgs['element-1']).toMatchInlineSnapshot(` + Object { + "0": Object { + "error": null, + "state": "ready", + "value": "hello world", + }, + } + `); }); it('handles error values', () => { @@ -92,13 +97,15 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-1']).to.eql([ - { - state: 'error', - value: null, - error: err, - }, - ]); + expect(newState.resolvedArgs['element-1']).toMatchInlineSnapshot(` + Object { + "0": Object { + "error": [Error: farewell world], + "state": "error", + "value": null, + }, + } + `); }); it('preserves old value on error', () => { @@ -109,11 +116,13 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-0'][0]).to.eql({ - state: 'error', - value: 'testing', - error: err, - }); + expect(newState.resolvedArgs['element-0'][0]).toMatchInlineSnapshot(` + Object { + "error": [Error: farewell world], + "state": "error", + "value": "testing", + } + `); }); }); @@ -124,14 +133,15 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-0']).to.have.length(1); - expect(newState.resolvedArgs['element-0']).to.eql([ - { - state: 'ready', - value: 'testing', - error: null, - }, - ]); + expect(newState.resolvedArgs['element-0']).toMatchInlineSnapshot(` + Array [ + Object { + "error": null, + "state": "ready", + "value": "testing", + }, + ] + `); }); it('deeply removes resolved values', () => { @@ -140,7 +150,7 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-0']).to.be(undefined); + expect(newState.resolvedArgs['element-0']).toBe(undefined); }); }); @@ -183,12 +193,22 @@ describe('resolved args reducer', () => { }); const newState = resolvedArgsReducer(state, action); - expect(newState.resolvedArgs['element-1']).to.eql({ - expressionContext: { - '1': { state: 'ready', value: 'test-1', error: null }, - '2': { state: 'ready', value: 'test-2', error: null }, - }, - }); + expect(newState.resolvedArgs['element-1']).toMatchInlineSnapshot(` + Object { + "expressionContext": Object { + "1": Object { + "error": null, + "state": "ready", + "value": "test-1", + }, + "2": Object { + "error": null, + "state": "ready", + "value": "test-2", + }, + }, + } + `); }); }); }); diff --git a/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/selectors/resolved_args.test.js similarity index 55% rename from x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js rename to x-pack/plugins/canvas/public/state/selectors/resolved_args.test.js index 3157201927854..1710d6704f980 100644 --- a/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js +++ b/x-pack/plugins/canvas/public/state/selectors/resolved_args.test.js @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; -import * as selector from '../resolved_args'; +import * as selector from './resolved_args'; describe('resolved args selector', () => { let state; @@ -35,21 +34,20 @@ describe('resolved args selector', () => { }); it('getValue returns the state', () => { - expect(selector.getState(state, 'test1')).to.equal('ready'); - expect(selector.getState(state, 'test2')).to.equal('pending'); - expect(selector.getState(state, 'test3')).to.equal('error'); + expect(selector.getState(state, 'test1')).toEqual('ready'); + expect(selector.getState(state, 'test2')).toEqual('pending'); + expect(selector.getState(state, 'test3')).toEqual('error'); }); it('getValue returns the value', () => { - expect(selector.getValue(state, 'test1')).to.equal('test value'); - expect(selector.getValue(state, 'test2')).to.equal(null); - expect(selector.getValue(state, 'test3')).to.equal('some old value'); + expect(selector.getValue(state, 'test1')).toEqual('test value'); + expect(selector.getValue(state, 'test2')).toEqual(null); + expect(selector.getValue(state, 'test3')).toEqual('some old value'); }); it('getError returns the error', () => { - expect(selector.getError(state, 'test1')).to.equal(null); - expect(selector.getError(state, 'test2')).to.equal(null); - expect(selector.getError(state, 'test3')).to.be.an(Error); - expect(selector.getError(state, 'test3').toString()).to.match(/i\ have\ failed$/); + expect(selector.getError(state, 'test1')).toEqual(null); + expect(selector.getError(state, 'test2')).toEqual(null); + expect(selector.getError(state, 'test3')).toMatchInlineSnapshot(`[Error: i have failed]`); }); }); diff --git a/x-pack/plugins/canvas/public/state/selectors/resolved_args.ts b/x-pack/plugins/canvas/public/state/selectors/resolved_args.ts index 770d4403f8587..b557ff04921ca 100644 --- a/x-pack/plugins/canvas/public/state/selectors/resolved_args.ts +++ b/x-pack/plugins/canvas/public/state/selectors/resolved_args.ts @@ -5,9 +5,7 @@ */ import { get } from 'lodash'; -// @ts-expect-error untyped local import * as argHelper from '../../lib/resolved_arg'; -// @ts-expect-error untyped local import { prepend } from '../../lib/modify_path'; import { State } from '../../../types'; diff --git a/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js b/x-pack/plugins/canvas/public/state/selectors/workpad.test.js similarity index 80% rename from x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js rename to x-pack/plugins/canvas/public/state/selectors/workpad.test.js index 5fdc662c592cc..d5f7e003af858 100644 --- a/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js +++ b/x-pack/plugins/canvas/public/state/selectors/workpad.test.js @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; -import * as selector from '../workpad'; +import * as selector from './workpad'; describe('workpad selectors', () => { let asts; @@ -125,42 +124,42 @@ describe('workpad selectors', () => { describe('empty state', () => { it('returns undefined', () => { - expect(selector.getSelectedPage({})).to.be(undefined); - expect(selector.getPageById({}, 'page-1')).to.be(undefined); - expect(selector.getSelectedElement({})).to.be(undefined); - expect(selector.getElementById({}, 'element-1')).to.be(undefined); - expect(selector.getResolvedArgs({}, 'element-1')).to.be(undefined); - expect(selector.getSelectedResolvedArgs({})).to.be(undefined); - expect(selector.isWriteable({})).to.be(true); + expect(selector.getSelectedPage({})).toBe(undefined); + expect(selector.getPageById({}, 'page-1')).toBe(undefined); + expect(selector.getSelectedElement({})).toBe(undefined); + expect(selector.getElementById({}, 'element-1')).toBe(undefined); + expect(selector.getResolvedArgs({}, 'element-1')).toBe(undefined); + expect(selector.getSelectedResolvedArgs({})).toBe(undefined); + expect(selector.isWriteable({})).toBe(true); }); }); describe('getSelectedPage', () => { it('returns the selected page', () => { - expect(selector.getSelectedPage(state)).to.equal('page-1'); + expect(selector.getSelectedPage(state)).toEqual('page-1'); }); }); describe('getPages', () => { it('return an empty array with no pages', () => { - expect(selector.getPages({})).to.eql([]); + expect(selector.getPages({})).toEqual([]); }); it('returns all pages in persisent state', () => { - expect(selector.getPages(state)).to.eql(state.persistent.workpad.pages); + expect(selector.getPages(state)).toEqual(state.persistent.workpad.pages); }); }); describe('getPageById', () => { it('should return matching page', () => { - expect(selector.getPageById(state, 'page-1')).to.eql(state.persistent.workpad.pages[0]); + expect(selector.getPageById(state, 'page-1')).toEqual(state.persistent.workpad.pages[0]); }); }); describe('getSelectedElement', () => { it('returns selected element', () => { const { elements } = state.persistent.workpad.pages[0]; - expect(selector.getSelectedElement(state)).to.eql({ + expect(selector.getSelectedElement(state)).toEqual({ ...elements[1], ast: asts['element-1'], }); @@ -169,7 +168,7 @@ describe('workpad selectors', () => { describe('getElements', () => { it('is an empty array with no state', () => { - expect(selector.getElements({})).to.eql([]); + expect(selector.getElements({})).toEqual([]); }); it('returns all elements on the page', () => { @@ -179,18 +178,18 @@ describe('workpad selectors', () => { ...element, ast: asts[element.id], })); - expect(selector.getElements(state)).to.eql(expected); + expect(selector.getElements(state)).toEqual(expected); }); }); describe('getElementById', () => { it('returns element matching id', () => { const { elements } = state.persistent.workpad.pages[0]; - expect(selector.getElementById(state, 'element-0')).to.eql({ + expect(selector.getElementById(state, 'element-0')).toEqual({ ...elements[0], ast: asts['element-0'], }); - expect(selector.getElementById(state, 'element-1')).to.eql({ + expect(selector.getElementById(state, 'element-1')).toEqual({ ...elements[1], ast: asts['element-1'], }); @@ -199,18 +198,18 @@ describe('workpad selectors', () => { describe('getResolvedArgs', () => { it('returns resolved args by element id', () => { - expect(selector.getResolvedArgs(state, 'element-0')).to.equal('test resolved arg, el 0'); + expect(selector.getResolvedArgs(state, 'element-0')).toEqual('test resolved arg, el 0'); }); it('returns resolved args at given path', () => { const arg = selector.getResolvedArgs(state, 'element-2', 'example1'); - expect(arg).to.equal('first thing'); + expect(arg).toEqual('first thing'); }); }); describe('getSelectedResolvedArgs', () => { it('returns resolved args for selected element', () => { - expect(selector.getSelectedResolvedArgs(state)).to.equal('test resolved arg, el 1'); + expect(selector.getSelectedResolvedArgs(state)).toEqual('test resolved arg, el 1'); }); it('returns resolved args at given path', () => { @@ -222,7 +221,7 @@ describe('workpad selectors', () => { }, }; const arg = selector.getSelectedResolvedArgs(tmpState, 'example2'); - expect(arg).to.eql(['why not', 'an array?']); + expect(arg).toEqual(['why not', 'an array?']); }); it('returns resolved args at given deep path', () => { @@ -234,14 +233,14 @@ describe('workpad selectors', () => { }, }; const arg = selector.getSelectedResolvedArgs(tmpState, ['example3', 'deeper', 'object']); - expect(arg).to.be(true); + expect(arg).toBe(true); }); }); describe('getGlobalFilters', () => { it('gets filters from all elements', () => { const filters = selector.getGlobalFilters(state); - expect(filters).to.eql([ + expect(filters).toEqual([ 'exactly value="beats" column="project"', 'timefilter filterGroup=one column=@timestamp from=now-24h to=now', ]); @@ -249,17 +248,14 @@ describe('workpad selectors', () => { it('gets returns empty array with no elements', () => { const filters = selector.getGlobalFilters({}); - expect(filters).to.be.an(Array); - expect(filters).to.have.length(0); + expect(filters).toEqual([]); }); }); describe('getGlobalFilterGroups', () => { it('gets filter group from elements', () => { const filterGroups = selector.getGlobalFilterGroups(state); - expect(filterGroups).to.be.an(Array); - expect(filterGroups).to.have.length(1); - expect(filterGroups[0]).to.equal('one'); + expect(filterGroups).toEqual(['one']); }); it('gets all unique filter groups', () => { @@ -282,7 +278,7 @@ describe('workpad selectors', () => { }); // filters are alphabetical - expect(filterGroups).to.eql(['one', 'two']); + expect(filterGroups).toEqual(['one', 'two']); }); it('gets filter groups in filter function args', () => { @@ -311,13 +307,13 @@ describe('workpad selectors', () => { // {string two} is skipped, only primitive values are extracted // filterGroup=one and {filters one} are de-duped // filters are alphabetical - expect(filterGroups).to.eql(['four', 'one', 'three']); + expect(filterGroups).toEqual(['four', 'one', 'three']); }); }); describe('isWriteable', () => { it('returns boolean for if the workpad is writeable', () => { - expect(selector.isWriteable(state)).to.equal(false); + expect(selector.isWriteable(state)).toEqual(false); }); }); }); diff --git a/x-pack/plugins/canvas/public/state/selectors/workpad.ts b/x-pack/plugins/canvas/public/state/selectors/workpad.ts index a677bcaf29e61..b05615b7930c5 100644 --- a/x-pack/plugins/canvas/public/state/selectors/workpad.ts +++ b/x-pack/plugins/canvas/public/state/selectors/workpad.ts @@ -7,7 +7,6 @@ import { get, omit } from 'lodash'; // @ts-expect-error untyped local import { safeElementFromExpression, fromExpression } from '@kbn/interpreter/common'; -// @ts-expect-error untyped local import { append } from '../../lib/modify_path'; import { getAssets } from './assets'; import { diff --git a/x-pack/plugins/security_solution/README.md b/x-pack/plugins/security_solution/README.md new file mode 100644 index 0000000000000..6680dbf1a149b --- /dev/null +++ b/x-pack/plugins/security_solution/README.md @@ -0,0 +1,130 @@ +# Security Solution + +Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing. + +## Development + +## Tests + +The endpoint specific tests leverage the ingest manager to install the endpoint package. Before the api integration +and functional tests are run the ingest manager is initialized. This initialization process includes reaching out to +a package registry service to install the endpoint package. The endpoint tests support three different ways to run +the tests given the constraint on an available package registry. + +1. Using Docker +2. Running your own local package registry +3. Using the default external package registry + +These scenarios will be outlined the sections below. + +### Endpoint API Integration Tests Location + +The endpoint api integration tests are located [here](../../test/security_solution_endpoint_api_int) + +### Endpoint Functional Tests Location + +The endpoint functional tests are located [here](../../test/security_solution_endpoint) + +### Using Docker + +To run the tests using the recommended docker image version you must have `docker` installed. The testing infrastructure +will stand up a docker container using the image defined [here](../../test/ingest_manager_api_integration/config.ts#L15) + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` + +### Running your own package registry + +If you are doing endpoint package development it will be useful to run your own package registry to serve the latest package you're building. +To do this use the following commands: + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE= yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE= yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE= yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE= yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` + +### Using the default public registry + +If you don't have docker installed and don't want to run your own registry, you can run the tests using the ingest manager's default public package registry. The actual package registry used is [here](../../plugins/ingest_manager/common/constants/epm.ts#L9) + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts index 1c59a4b7ea5d0..90373ee676121 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts @@ -183,7 +183,7 @@ export const getExceptions = async ({ listId: foundList.list_id, namespaceType, page: 1, - perPage: 5000, + perPage: 10000, filter: undefined, sortOrder: undefined, sortField: undefined, diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index c568b92e85515..eeff81d492d26 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -53,6 +53,7 @@ const onlyNotInCoverageTests = [ require.resolve('../test/licensing_plugin/config.legacy.ts'), require.resolve('../test/endpoint_api_integration_no_ingest/config.ts'), require.resolve('../test/reporting_api_integration/config.js'), + require.resolve('../test/security_solution_endpoint_api_int/config.ts'), require.resolve('../test/ingest_manager_api_integration/config.ts'), ]; diff --git a/x-pack/tasks/test.ts b/x-pack/tasks/test.ts deleted file mode 100644 index 0d990bff9f44e..0000000000000 --- a/x-pack/tasks/test.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 * as 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); diff --git a/x-pack/test/api_integration/apis/endpoint/index.ts b/x-pack/test/api_integration/apis/endpoint/index.ts deleted file mode 100644 index 5ada2bd094d4b..0000000000000 --- a/x-pack/test/api_integration/apis/endpoint/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { FtrProviderContext } from '../../ftr_provider_context'; - -export default function endpointAPIIntegrationTests({ - loadTestFile, - getService, -}: FtrProviderContext) { - describe('Endpoint plugin', function () { - const ingestManager = getService('ingestManager'); - this.tags(['endpoint']); - before(async () => { - await ingestManager.setup(); - }); - loadTestFile(require.resolve('./resolver')); - loadTestFile(require.resolve('./metadata')); - loadTestFile(require.resolve('./policy')); - }); -} diff --git a/x-pack/test/api_integration/apis/index.js b/x-pack/test/api_integration/apis/index.js index 05b305ccd833f..23532d1311754 100644 --- a/x-pack/test/api_integration/apis/index.js +++ b/x-pack/test/api_integration/apis/index.js @@ -28,7 +28,6 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./lens')); loadTestFile(require.resolve('./ml')); loadTestFile(require.resolve('./transform')); - loadTestFile(require.resolve('./endpoint')); loadTestFile(require.resolve('./lists')); loadTestFile(require.resolve('./upgrade_assistant')); }); diff --git a/x-pack/test/api_integration/services/index.ts b/x-pack/test/api_integration/services/index.ts index 75cc2b451ea2e..7113e117582dd 100644 --- a/x-pack/test/api_integration/services/index.ts +++ b/x-pack/test/api_integration/services/index.ts @@ -27,7 +27,6 @@ import { InfraOpsSourceConfigurationProvider } from './infraops_source_configura import { InfraLogSourceConfigurationProvider } from './infra_log_source_configuration'; import { MachineLearningProvider } from './ml'; import { IngestManagerProvider } from '../../common/services/ingest_manager'; -import { ResolverGeneratorProvider } from './resolver'; import { TransformProvider } from './transform'; export const services = { @@ -48,6 +47,5 @@ export const services = { usageAPI: UsageAPIProvider, ml: MachineLearningProvider, ingestManager: IngestManagerProvider, - resolverGenerator: ResolverGeneratorProvider, transform: TransformProvider, }; diff --git a/x-pack/test/ingest_manager_api_integration/config.ts b/x-pack/test/ingest_manager_api_integration/config.ts index 2aa2e62a4b9e1..ddb49a09a7afa 100644 --- a/x-pack/test/ingest_manager_api_integration/config.ts +++ b/x-pack/test/ingest_manager_api_integration/config.ts @@ -9,6 +9,11 @@ import path from 'path'; import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; import { defineDockerServersConfig } from '@kbn/test'; +// Docker image to use for Ingest Manager API integration tests. +// This hash comes from the commit hash here: https://github.com/elastic/package-storage/commit/48f3935a72b0c5aacc6fec8ef36d559b089a238b +export const dockerImage = + 'docker.elastic.co/package-registry/distribution:48f3935a72b0c5aacc6fec8ef36d559b089a238b'; + export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); @@ -29,10 +34,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { )}:/packages/test-packages`, ]; - // Docker image to use for Ingest Manager API integration tests. - const dockerImage = - 'docker.elastic.co/package-registry/distribution:184b85f19e8fd14363e36150173d338ff9659f01'; - return { testFiles: [require.resolve('./apis')], servers: xPackAPITestsConfig.get('servers'), diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_list.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_list.ts index 6971d9f523e7e..07667a140d090 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_list.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_list.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { deleteMetadataStream } from '../../../api_integration/apis/endpoint/data_stream_helper'; +import { deleteMetadataStream } from '../../../security_solution_endpoint_api_int/apis/data_stream_helper'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'endpoint', 'header', 'endpointPageUtils']); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts index bd933c9a136f2..eec3da4ce1c5e 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts @@ -3,12 +3,28 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { DEFAULT_REGISTRY_URL } from '../../../../plugins/ingest_manager/common'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { + isRegistryEnabled, + getRegistryUrl, +} from '../../../security_solution_endpoint_api_int/registry'; + +export default function (providerContext: FtrProviderContext) { + const { loadTestFile, getService } = providerContext; -export default function ({ loadTestFile, getService }: FtrProviderContext) { describe('endpoint', function () { this.tags('ciGroup7'); const ingestManager = getService('ingestManager'); + const log = getService('log'); + + if (!isRegistryEnabled()) { + log.warning('These tests are being run with an external package registry'); + } + + const registryUrl = getRegistryUrl() ?? DEFAULT_REGISTRY_URL; + log.info(`Package registry URL for tests: ${registryUrl}`); + before(async () => { await ingestManager.setup(); }); diff --git a/x-pack/test/security_solution_endpoint/config.ts b/x-pack/test/security_solution_endpoint/config.ts index 2d94163fa1018..5aa5e42ffd4ee 100644 --- a/x-pack/test/security_solution_endpoint/config.ts +++ b/x-pack/test/security_solution_endpoint/config.ts @@ -8,6 +8,10 @@ import { resolve } from 'path'; import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; import { pageObjects } from './page_objects'; import { services } from './services'; +import { + getRegistryUrlAsArray, + createEndpointDockerConfig, +} from '../security_solution_endpoint_api_int/registry'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const xpackFunctionalConfig = await readConfigFile(require.resolve('../functional/config.js')); @@ -16,6 +20,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xpackFunctionalConfig.getAll(), pageObjects, testFiles: [resolve(__dirname, './apps/endpoint')], + dockerServers: createEndpointDockerConfig(), junit: { reportName: 'X-Pack Endpoint Functional Tests', }, @@ -31,6 +36,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { serverArgs: [ ...xpackFunctionalConfig.get('kbnTestServer.serverArgs'), '--xpack.ingestManager.enabled=true', + // if you return an empty string here the kibana server will not start properly but an empty array works + ...getRegistryUrlAsArray(), ], }, }; diff --git a/x-pack/test/api_integration/apis/endpoint/artifacts/index.ts b/x-pack/test/security_solution_endpoint_api_int/apis/artifacts/index.ts similarity index 98% rename from x-pack/test/api_integration/apis/endpoint/artifacts/index.ts rename to x-pack/test/security_solution_endpoint_api_int/apis/artifacts/index.ts index b37522ed52b5c..a4a8de418157f 100644 --- a/x-pack/test/api_integration/apis/endpoint/artifacts/index.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/artifacts/index.ts @@ -8,11 +8,8 @@ import expect from '@kbn/expect'; import { createHash } from 'crypto'; import { inflateSync } from 'zlib'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { - getSupertestWithoutAuth, - setupIngest, -} from '../../../../ingest_manager_api_integration/apis/fleet/agents/services'; +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { getSupertestWithoutAuth } from '../../../ingest_manager_api_integration/apis/fleet/agents/services'; export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; @@ -22,7 +19,6 @@ export default function (providerContext: FtrProviderContext) { let agentAccessAPIKey: string; describe('artifact download', () => { - setupIngest(providerContext); before(async () => { await esArchiver.load('endpoint/artifacts/api_feature', { useCreate: true }); diff --git a/x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts similarity index 94% rename from x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts rename to x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts index b239ab41e41f1..b16da16b3137f 100644 --- a/x-pack/test/api_integration/apis/endpoint/data_stream_helper.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/data_stream_helper.ts @@ -10,7 +10,7 @@ import { eventsIndexPattern, alertsIndexPattern, policyIndexPattern, -} from '../../../../plugins/security_solution/common/endpoint/constants'; +} from '../../../plugins/security_solution/common/endpoint/constants'; export async function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) { const client = getService('es'); diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/fixtures/package_registry_config.yml b/x-pack/test/security_solution_endpoint_api_int/apis/fixtures/package_registry_config.yml new file mode 100644 index 0000000000000..4d93386b4d4e1 --- /dev/null +++ b/x-pack/test/security_solution_endpoint_api_int/apis/fixtures/package_registry_config.yml @@ -0,0 +1,2 @@ +package_paths: + - /packages/production diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/index.ts b/x-pack/test/security_solution_endpoint_api_int/apis/index.ts new file mode 100644 index 0000000000000..fb11a7c52fd35 --- /dev/null +++ b/x-pack/test/security_solution_endpoint_api_int/apis/index.ts @@ -0,0 +1,34 @@ +/* + * 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 { FtrProviderContext } from '../ftr_provider_context'; +import { isRegistryEnabled, getRegistryUrl } from '../registry'; +import { DEFAULT_REGISTRY_URL } from '../../../plugins/ingest_manager/common'; + +export default function endpointAPIIntegrationTests(providerContext: FtrProviderContext) { + const { loadTestFile, getService } = providerContext; + + describe('Endpoint plugin', function () { + const ingestManager = getService('ingestManager'); + + this.tags('ciGroup7'); + const log = getService('log'); + + if (!isRegistryEnabled()) { + log.warning('These tests are being run with an external package registry'); + } + + const registryUrl = getRegistryUrl() ?? DEFAULT_REGISTRY_URL; + log.info(`Package registry URL for tests: ${registryUrl}`); + + before(async () => { + await ingestManager.setup(); + }); + loadTestFile(require.resolve('./resolver')); + loadTestFile(require.resolve('./metadata')); + loadTestFile(require.resolve('./policy')); + loadTestFile(require.resolve('./artifacts')); + }); +} diff --git a/x-pack/test/api_integration/apis/endpoint/metadata.ts b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts similarity index 99% rename from x-pack/test/api_integration/apis/endpoint/metadata.ts rename to x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts index 41531269ddeb9..719327e5f9b79 100644 --- a/x-pack/test/api_integration/apis/endpoint/metadata.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; import { deleteMetadataStream } from './data_stream_helper'; /** diff --git a/x-pack/test/api_integration/apis/endpoint/policy.ts b/x-pack/test/security_solution_endpoint_api_int/apis/policy.ts similarity index 96% rename from x-pack/test/api_integration/apis/endpoint/policy.ts rename to x-pack/test/security_solution_endpoint_api_int/apis/policy.ts index e33423d172567..66bcc0e759916 100644 --- a/x-pack/test/api_integration/apis/endpoint/policy.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/policy.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; import { deletePolicyStream } from './data_stream_helper'; export default function ({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/endpoint/resolver.ts b/x-pack/test/security_solution_endpoint_api_int/apis/resolver.ts similarity index 98% rename from x-pack/test/api_integration/apis/endpoint/resolver.ts rename to x-pack/test/security_solution_endpoint_api_int/apis/resolver.ts index fa980aed30502..3b515f86c6761 100644 --- a/x-pack/test/api_integration/apis/endpoint/resolver.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/resolver.ts @@ -16,12 +16,12 @@ import { LegacyEndpointEvent, ResolverNodeStats, ResolverRelatedAlerts, -} from '../../../../plugins/security_solution/common/endpoint/types'; +} from '../../../plugins/security_solution/common/endpoint/types'; import { parentEntityId, eventId, -} from '../../../../plugins/security_solution/common/endpoint/models/event'; -import { FtrProviderContext } from '../../ftr_provider_context'; +} from '../../../plugins/security_solution/common/endpoint/models/event'; +import { FtrProviderContext } from '../ftr_provider_context'; import { Event, Tree, @@ -29,8 +29,8 @@ import { RelatedEventCategory, RelatedEventInfo, categoryMapping, -} from '../../../../plugins/security_solution/common/endpoint/generate_data'; -import { Options, GeneratedTrees } from '../../services/resolver'; +} from '../../../plugins/security_solution/common/endpoint/generate_data'; +import { Options, GeneratedTrees } from '../services/resolver'; /** * Check that the given lifecycle is in the resolver tree's corresponding map diff --git a/x-pack/test/security_solution_endpoint_api_int/config.ts b/x-pack/test/security_solution_endpoint_api_int/config.ts new file mode 100644 index 0000000000000..726059a8d73fe --- /dev/null +++ b/x-pack/test/security_solution_endpoint_api_int/config.ts @@ -0,0 +1,31 @@ +/* + * 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 { FtrConfigProviderContext } from '@kbn/test/types/ftr'; +import { createEndpointDockerConfig, getRegistryUrlAsArray } from './registry'; +import { services } from './services'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts')); + + return { + ...xPackAPITestsConfig.getAll(), + testFiles: [require.resolve('./apis')], + dockerServers: createEndpointDockerConfig(), + services, + junit: { + reportName: 'X-Pack Endpoint API Integration Tests', + }, + kbnTestServer: { + ...xPackAPITestsConfig.get('kbnTestServer'), + serverArgs: [ + ...xPackAPITestsConfig.get('kbnTestServer.serverArgs'), + // if you return an empty string here the kibana server will not start properly but an empty array works + ...getRegistryUrlAsArray(), + ], + }, + }; +} diff --git a/x-pack/plugins/canvas/scripts/test_browser.js b/x-pack/test/security_solution_endpoint_api_int/ftr_provider_context.d.ts similarity index 56% rename from x-pack/plugins/canvas/scripts/test_browser.js rename to x-pack/test/security_solution_endpoint_api_int/ftr_provider_context.d.ts index e04fac0615284..e3add3748f56d 100644 --- a/x-pack/plugins/canvas/scripts/test_browser.js +++ b/x-pack/test/security_solution_endpoint_api_int/ftr_provider_context.d.ts @@ -4,4 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -require('./_helpers').runGulpTask('canvas:test:karma'); +import { GenericFtrProviderContext } from '@kbn/test/types/ftr'; + +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/test/security_solution_endpoint_api_int/registry.ts b/x-pack/test/security_solution_endpoint_api_int/registry.ts new file mode 100644 index 0000000000000..cc474cbf29aaf --- /dev/null +++ b/x-pack/test/security_solution_endpoint_api_int/registry.ts @@ -0,0 +1,77 @@ +/* + * 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 path from 'path'; + +import { defineDockerServersConfig } from '@kbn/test'; +import { dockerImage as ingestDockerImage } from '../ingest_manager_api_integration/config'; + +/** + * This is used by CI to set the docker registry port + * you can also define this environment variable locally when running tests which + * will spin up a local docker package registry locally for you + * if this is defined it takes precedence over the `packageRegistryOverride` variable + */ +const dockerRegistryPort: string | undefined = process.env.INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT; + +/** + * If you don't want to use the docker image version pinned below and instead want to run your own + * registry or use an external registry you can define this environment variable when running + * the tests to use that registry url instead. + * + * This is particularly useful when a developer needs to test a new package against the kibana + * integration or functional tests. Instead of having to publish a whole new docker image we + * can set this environment variable which will point to the location of where your package registry + * is serving the updated package. + * + * This variable will not and should not be used by CI. CI should always use the pinned docker image below. + */ +const packageRegistryOverride: string | undefined = process.env.PACKAGE_REGISTRY_URL_OVERRIDE; + +const defaultRegistryConfigPath = path.join( + __dirname, + './apis/fixtures/package_registry_config.yml' +); + +export function createEndpointDockerConfig( + packageRegistryConfig: string = defaultRegistryConfigPath, + dockerImage: string = ingestDockerImage, + dockerArgs: string[] = [] +) { + const args: string[] = [ + '-v', + `${packageRegistryConfig}:/package-registry/config.yml`, + ...dockerArgs, + ]; + return defineDockerServersConfig({ + registry: { + enabled: !!dockerRegistryPort, + image: dockerImage, + portInContainer: 8080, + port: dockerRegistryPort, + args, + waitForLogLine: 'package manifests loaded', + }, + }); +} + +export function getRegistryUrl(): string | undefined { + let registryUrl: string | undefined; + if (dockerRegistryPort !== undefined) { + registryUrl = `--xpack.ingestManager.registryUrl=http://localhost:${dockerRegistryPort}`; + } else if (packageRegistryOverride !== undefined) { + registryUrl = `--xpack.ingestManager.registryUrl=${packageRegistryOverride}`; + } + return registryUrl; +} + +export function getRegistryUrlAsArray(): string[] { + const registryUrl: string | undefined = getRegistryUrl(); + return registryUrl !== undefined ? [registryUrl] : []; +} + +export function isRegistryEnabled() { + return getRegistryUrl() !== undefined; +} diff --git a/x-pack/plugins/canvas/scripts/test_dev.js b/x-pack/test/security_solution_endpoint_api_int/services/index.ts similarity index 50% rename from x-pack/plugins/canvas/scripts/test_dev.js rename to x-pack/test/security_solution_endpoint_api_int/services/index.ts index 8b03d7930d473..47d45557022d3 100644 --- a/x-pack/plugins/canvas/scripts/test_dev.js +++ b/x-pack/test/security_solution_endpoint_api_int/services/index.ts @@ -4,4 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -require('./_helpers').runGulpTask('canvas:karma:debug'); +import { services as xPackAPIServices } from '../../api_integration/services'; +import { ResolverGeneratorProvider } from './resolver'; + +export const services = { + ...xPackAPIServices, + resolverGenerator: ResolverGeneratorProvider, +}; diff --git a/x-pack/test/api_integration/services/resolver.ts b/x-pack/test/security_solution_endpoint_api_int/services/resolver.ts similarity index 100% rename from x-pack/test/api_integration/services/resolver.ts rename to x-pack/test/security_solution_endpoint_api_int/services/resolver.ts diff --git a/yarn.lock b/yarn.lock index f4990ab3cfe27..c507d139b8235 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6501,11 +6501,6 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= - abort-controller@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-2.0.3.tgz#b174827a732efadff81227ed4b8d1cc569baf20a" @@ -6663,11 +6658,6 @@ after-all-results@^2.0.0: resolved "https://registry.yarnpkg.com/after-all-results/-/after-all-results-2.0.0.tgz#6ac2fc202b500f88da8f4f5530cfa100f4c6a2d0" integrity sha1-asL8ICtQD4jaj09VMM+hAPTGotA= -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= - agent-base@4: version "4.2.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" @@ -7618,11 +7608,6 @@ array.prototype.flatmap@^1.2.3: es-abstract "^1.17.0-next.1" function-bind "^1.1.1" -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== - arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -7788,11 +7773,6 @@ async-value@^1.2.2: resolved "https://registry.yarnpkg.com/async-value/-/async-value-1.2.2.tgz#84517a1e7cb6b1a5b5e181fa31be10437b7fb125" integrity sha1-hFF6Hny2saW14YH6Mb4QQ3t/sSU= -async@1.x, async@^1.4.2, async@^1.5.2, async@~1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - async@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" @@ -7800,6 +7780,11 @@ async@2.4.0: dependencies: lodash "^4.14.0" +async@^1.4.2, async@^1.5.2, async@~1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + async@^2.0.0, async@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" @@ -7814,7 +7799,7 @@ async@^2.6.0, async@^2.6.1: dependencies: lodash "^4.17.10" -async@^2.6.2, async@^2.6.3: +async@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== @@ -8503,11 +8488,6 @@ bach@^1.0.0: async-settle "^1.0.0" now-and-later "^2.0.0" -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= - backport@5.5.1: version "5.5.1" resolved "https://registry.yarnpkg.com/backport/-/backport-5.5.1.tgz#2eeddbdc4cfc0530119bdb2b0c3c30bc7ef574dd" @@ -8539,11 +8519,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= - base64-js@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" @@ -8559,11 +8534,6 @@ base64-js@^1.1.2, base64-js@^1.2.1, base64-js@^1.3.0, base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= - base64url@^3.0.0, base64url@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" @@ -8611,13 +8581,6 @@ before-after-hook@^1.4.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.4.0.tgz#2b6bf23dca4f32e628fd2747c10a37c74a4b484d" integrity sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg== -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= - dependencies: - callsite "1.0.0" - big-integer@^1.6.16: version "1.6.48" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" @@ -8696,11 +8659,6 @@ bl@^3.0.0: dependencies: readable-stream "^3.0.1" -blob@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" - integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -8785,22 +8743,6 @@ body-parser@1.19.0, body-parser@^1.18.1, body-parser@^1.18.3: raw-body "2.4.0" type-is "~1.6.17" -body-parser@^1.16.1: - version "1.18.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" - integrity sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.1" - http-errors "~1.6.2" - iconv-lite "0.4.19" - on-finished "~2.3.0" - qs "6.5.1" - raw-body "2.3.2" - type-is "~1.6.15" - body@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" @@ -8944,7 +8886,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -9448,11 +9390,6 @@ caller-path@^2.0.0: dependencies: caller-callsite "^2.0.0" -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= - callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" @@ -9919,7 +9856,7 @@ chokidar@^2.0.0, chokidar@^2.1.2, chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.0.0, chokidar@^3.2.2: +chokidar@^3.2.2: version "3.3.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg== @@ -10450,16 +10387,16 @@ colors@1.0.3: resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= -colors@^1.1.0, colors@^1.2.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== - colors@^1.1.2, colors@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== +colors@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" + integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== + colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -10571,21 +10508,11 @@ compare-versions@3.5.1: resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.5.1.tgz#26e1f5cf0d48a77eced5046b9f67b6b61075a393" integrity sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg== -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= - -component-emitter@1.2.1, component-emitter@^1.2.0, component-emitter@^1.2.1: +component-emitter@^1.2.0, component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= - compose-function@3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/compose-function/-/compose-function-3.0.3.tgz#9ed675f13cc54501d30950a486ff6a7ba3ab185f" @@ -10769,16 +10696,6 @@ connect@^3.4.0: parseurl "~1.3.3" utils-merge "1.0.1" -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" @@ -11511,11 +11428,6 @@ custom-event-polyfill@^0.3.0: resolved "https://registry.yarnpkg.com/custom-event-polyfill/-/custom-event-polyfill-0.3.0.tgz#99807839be62edb446b645832e0d80ead6fa1888" integrity sha1-mYB4Ob5i7bRGtkWDLg2A6tb6GIg= -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" @@ -11825,24 +11737,11 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" integrity sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw== -date-format@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf" - integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA== - date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -dateformat@^1.0.6, dateformat@~1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - integrity sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk= - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - dateformat@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" @@ -11853,6 +11752,14 @@ dateformat@^3.0.2: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== +dateformat@~1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" + integrity sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk= + dependencies: + get-stdin "^4.0.1" + meow "^3.3.0" + debug-fabulous@1.X: version "1.1.0" resolved "https://registry.yarnpkg.com/debug-fabulous/-/debug-fabulous-1.1.0.tgz#af8a08632465224ef4174a9f06308c3c2a1ebc8e" @@ -11869,7 +11776,7 @@ debug@2.6.9, debug@^2.0.0, debug@^2.1.0, debug@^2.1.1, debug@^2.2.0, debug@^2.3. dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0, debug@~3.1.0: +debug@3.1.0, debug@=3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== @@ -12243,7 +12150,7 @@ depd@1.1.1: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" integrity sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k= -depd@~1.1.1, depd@~1.1.2: +depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= @@ -12452,11 +12359,6 @@ dfa@^1.2.0: resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.2.0.tgz#96ac3204e2d29c49ea5b57af8d92c2ae12790657" integrity sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q== -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - diacritics@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" @@ -12611,16 +12513,6 @@ dom-helpers@^5.0.0: "@babel/runtime" "^7.6.3" csstype "^2.6.7" -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - dom-serializer@0, dom-serializer@~0.1.0, dom-serializer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" @@ -13073,7 +12965,7 @@ enabled@2.0.x: resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== -encodeurl@^1.0.2, encodeurl@~1.0.1, encodeurl@~1.0.2: +encodeurl@^1.0.2, encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= @@ -13099,46 +12991,6 @@ end-of-stream@^1.4.1, end-of-stream@^1.4.4: dependencies: once "^1.4.0" -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" - integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.5" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - enhanced-resolve@4.1.0, enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" @@ -13157,11 +13009,6 @@ enhanced-resolve@~0.9.0: memory-fs "^0.2.0" tapable "^0.1.8" -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - entities@^1.1.1, entities@^1.1.2, entities@~1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" @@ -13513,18 +13360,6 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.0, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - escodegen@^1.11.0: version "1.14.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" @@ -13926,11 +13761,6 @@ espree@^6.1.2: acorn-jsx "^5.1.0" eslint-visitor-keys "^1.1.0" -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - esprima@^3.1.3, esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" @@ -13960,11 +13790,6 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -14018,11 +13843,6 @@ eventemitter2@~0.4.13: resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" integrity sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas= -eventemitter3@1.x.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508" - integrity sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg= - eventemitter3@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -14819,19 +14639,6 @@ filter-obj@^1.1.0: resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - finalhandler@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" @@ -15283,13 +15090,6 @@ front-matter@2.1.2: dependencies: js-yaml "^3.4.6" -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= - dependencies: - null-check "^1.0.0" - fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" @@ -15818,17 +15618,6 @@ glob@7.1.4, glob@~7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^5.0.15, glob@~5.0.0: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^6.0.1, glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -15852,6 +15641,17 @@ glob@^7.0.5, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +glob@~5.0.0: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@~7.0.0: version "7.0.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a" @@ -16563,13 +16363,6 @@ grunt-contrib-watch@^1.1.0: lodash "^4.17.10" tiny-lr "^1.1.1" -grunt-karma@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/grunt-karma/-/grunt-karma-3.0.2.tgz#4f14386d43ee45f8f6b98081862e4910f5056764" - integrity sha512-imNhQO1bR1O7X6/3F5vO0o7mKy4xdkpSd40QVfxGO70cBAFcOqjv2Zu5QzsfEsSrppuu3N0vIQPbfBRjeGdpWg== - dependencies: - lodash "^4.17.10" - grunt-known-options@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/grunt-known-options/-/grunt-known-options-1.1.0.tgz#a4274eeb32fa765da5a7a3b1712617ce3b144149" @@ -16860,23 +16653,11 @@ has-ansi@^3.0.0: dependencies: ansi-regex "^3.0.0" -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== - dependencies: - isarray "2.0.1" - has-color@~0.1.0: version "0.1.7" resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" integrity sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8= -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= - has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -17291,16 +17072,6 @@ http-deceiver@^1.2.7: resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= -http-errors@1.6.2, http-errors@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" - integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= - dependencies: - depd "1.1.1" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" - http-errors@1.6.3, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -17322,6 +17093,16 @@ http-errors@1.7.2, http-errors@~1.7.2: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" +http-errors@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" + integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= + dependencies: + depd "1.1.1" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + http-errors@~1.7.0: version "1.7.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" @@ -17368,14 +17149,6 @@ http-proxy-middleware@0.19.1: lodash "^4.17.11" micromatch "^3.1.10" -http-proxy@^1.13.0: - version "1.16.2" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.16.2.tgz#06dff292952bf64dbe8471fa9df73066d4f37742" - integrity sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I= - dependencies: - eventemitter3 "1.x.x" - requires-port "1.x.x" - http-proxy@^1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" @@ -18872,11 +18645,6 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= - isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" @@ -18887,11 +18655,6 @@ isbinaryfile@4.0.2: resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.2.tgz#bfc45642da645681c610cca831022e30af426488" integrity sha512-C3FSxJdNrEr2F4z6uFtNzECDM5hXk+46fxaa+cwBe5/XrWSmzdG8DDgyjfX6/NRdBB21q2JXuRAzPCUs+fclnQ== -isbinaryfile@^4.0.2: - version "4.0.6" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b" - integrity sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg== - isemail@3.x.x: version "3.1.4" resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.4.tgz#76e2187ff7bee59d57522c6fd1c3f09a331933cf" @@ -19049,26 +18812,6 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -istanbul@^0.4.0: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - istextorbinary@^2.1.0: version "2.2.1" resolved "https://registry.yarnpkg.com/istextorbinary/-/istextorbinary-2.2.1.tgz#a5231a08ef6dd22b268d0895084cf8d58b5bec53" @@ -19741,7 +19484,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.13.1, js-yaml@3.x, js-yaml@^3.10.0, js-yaml@^3.13.1, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@^3.9.0, js-yaml@~3.13.0, js-yaml@~3.13.1: +js-yaml@3.13.1, js-yaml@^3.10.0, js-yaml@^3.13.1, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@^3.9.0, js-yaml@~3.13.0, js-yaml@~3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -20152,87 +19895,6 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-coverage@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-1.1.2.tgz#cc09dceb589a83101aca5fe70c287645ef387689" - integrity sha512-eQawj4Cl3z/CjxslYy9ariU4uDh7cCNFZHNWXWRpl0pNeblY/4wHR7M7boTYXWrn9bY0z2pZmr11eKje/S/hIw== - dependencies: - dateformat "^1.0.6" - istanbul "^0.4.0" - lodash "^4.17.0" - minimatch "^3.0.0" - source-map "^0.5.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== - -karma-ie-launcher@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz#497986842c490190346cd89f5494ca9830c6d59c" - integrity sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw= - dependencies: - lodash "^4.6.1" - -karma-junit-reporter@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz#4f9c40cedfb1a395f8aef876abf96189917c6396" - integrity sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y= - dependencies: - path-is-absolute "^1.0.0" - xmlbuilder "8.2.2" - -karma-mocha@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-2.0.0.tgz#ad6b56b6a72e9b191e4c432dd30f4a44fc2435bc" - integrity sha512-qiZkZDJnn2kb9t2m4LoM4cYJHJVPoxvAYYe0B+go5s+A/3vc/3psUT05zW4yFz4vT0xHf+XzTTery8zdr8GWgA== - dependencies: - minimist "^1.2.3" - -karma-safari-launcher@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz#96982a2cc47d066aae71c553babb28319115a2ce" - integrity sha1-lpgqLMR9BmquccVTursoMZEVos4= - -karma@5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/karma/-/karma-5.0.2.tgz#e404373dac6e3fa08409ae4d9eda7d83adb43ee5" - integrity sha512-RpUuCuGJfN3WnjYPGIH+VBF8023Lfm3TQH6D1kcNL+FxtEPc2UUz/nVjbVAGXH4Pm+Q7FVOAQjdAeFUpXpQ3IA== - dependencies: - body-parser "^1.16.1" - braces "^3.0.2" - chokidar "^3.0.0" - colors "^1.1.0" - connect "^3.6.0" - di "^0.0.1" - dom-serialize "^2.2.0" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^4.0.2" - lodash "^4.17.14" - log4js "^4.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - ua-parser-js "0.7.21" - yargs "^15.3.1" - kdbush@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0" @@ -21070,7 +20732,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.11, lodash@4.17.15, lodash@>4.17.4, lodash@^4, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.10.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.6.1, lodash@~4.17.10, lodash@~4.17.15, lodash@~4.17.5: +lodash@4.17.11, lodash@4.17.15, lodash@>4.17.4, lodash@^4, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.10.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10, lodash@~4.17.15, lodash@~4.17.5: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -21143,17 +20805,6 @@ log-update@^1.0.2: ansi-escapes "^1.0.0" cli-cursor "^1.0.2" -log4js@^4.0.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-4.5.1.tgz#e543625e97d9e6f3e6e7c9fc196dd6ab2cae30b5" - integrity sha512-EEEgFcE9bLgaYUKuozyFfytQM2wDHtXn4tAN41pkaxpNjAykv11GVdeI4tHtmPWW4Xrgh9R/2d7XYghDVjbKKw== - dependencies: - date-format "^2.0.0" - debug "^4.1.1" - flatted "^2.0.0" - rfdc "^1.1.4" - streamroller "^1.0.6" - logform@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/logform/-/logform-2.1.2.tgz#957155ebeb67a13164069825ce67ddb5bb2dd360" @@ -21991,7 +21642,7 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@1.2.5, minimist@^1.2.3, minimist@^1.2.5: +minimist@1.2.5, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== @@ -22918,7 +22569,7 @@ nodemon@^2.0.2: chalk "~0.4.0" underscore "~1.6.0" -"nopt@2 || 3", nopt@3.x, nopt@~3.0.1, nopt@~3.0.6: +"nopt@2 || 3", nopt@~3.0.1, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= @@ -23120,11 +22771,6 @@ nth-check@^1.0.2, nth-check@~1.0.1: dependencies: boolbase "~1.0.0" -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= - null-loader@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/null-loader/-/null-loader-3.0.0.tgz#3e2b6c663c5bda8c73a54357d8fa0708dc61b245" @@ -23210,11 +22856,6 @@ object-assign@^3.0.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -23432,7 +23073,7 @@ on-headers@~1.0.2: resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -24125,20 +23766,6 @@ parse5@^3.0.1: dependencies: "@types/node" "*" -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= - dependencies: - better-assert "~1.0.0" - parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -25282,16 +24909,6 @@ q@^1.1.2: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - -qs@6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" - integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A== - qs@6.5.2, qs@^6.4.0, qs@^6.5.1, qs@~6.5.1, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -25440,25 +25057,15 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -range-parser@^1.2.0, range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - range-parser@^1.2.1, range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" - integrity sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k= - dependencies: - bytes "3.0.0" - http-errors "1.6.2" - iconv-lite "0.4.19" - unpipe "1.0.0" +range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= raw-body@2.3.3: version "2.3.3" @@ -27344,7 +26951,7 @@ requirejs@^2.3.5: resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.6.tgz#e5093d9601c2829251258c0b9445d4d19fa9e7c9" integrity sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg== -requires-port@1.x.x, requires-port@^1.0.0: +requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= @@ -27463,7 +27070,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.7, resolve@1.1.x, resolve@~1.1.0, resolve@~1.1.7: +resolve@1.1.7, resolve@~1.1.0, resolve@~1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= @@ -27581,11 +27188,6 @@ rework@1.0.1: convert-source-map "^0.3.3" css "^2.0.0" -rfdc@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" - integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== - right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" @@ -27593,7 +27195,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.0, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== @@ -28664,52 +28266,6 @@ socket-location@^1.0.0: dependencies: await-event "^2.1.0" -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - sockjs-client@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.3.0.tgz#12fc9d6cb663da5739d3dc5fb6e8687da95cb177" @@ -28841,13 +28397,6 @@ source-map@~0.1.30: dependencies: amdefine ">=0.0.4" -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= - dependencies: - amdefine ">=0.0.4" - sourcemap-codec@^1.4.1: version "1.4.6" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz#e30a74f0402bad09807640d39e971090a08ce1e9" @@ -29190,11 +28739,6 @@ stats-lite@^2.2.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= - stdout-stream@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" @@ -29268,17 +28812,6 @@ stream-spigot@~2.1.2: dependencies: readable-stream "~1.1.0" -streamroller@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-1.0.6.tgz#8167d8496ed9f19f05ee4b158d9611321b8cacd9" - integrity sha512-3QC47Mhv3/aZNFpDDVO44qQb9gwB9QggMEE0sQmkTAwBVYdBRWISdsywlkfm5II1Q5y/pmrHflti/IgmIzdDBg== - dependencies: - async "^2.6.2" - date-format "^2.0.0" - debug "^3.2.6" - fs-extra "^7.0.1" - lodash "^4.17.14" - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -29782,7 +29315,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^3.1.0, supports-color@^3.1.2: +supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= @@ -30479,7 +30012,7 @@ tmp@0.0.30: dependencies: os-tmpdir "~1.0.1" -tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33: +tmp@0.0.x, tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== @@ -30513,11 +30046,6 @@ to-absolute-glob@^2.0.0: is-absolute "^1.0.0" is-negated-glob "^1.0.0" -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= - to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -31411,7 +30939,7 @@ type-fest@^0.8.0, type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-is@~1.6.15, type-is@~1.6.16: +type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== @@ -31492,7 +31020,7 @@ typings-tester@^0.3.2: dependencies: commander "^2.12.2" -ua-parser-js@0.7.21, ua-parser-js@^0.7.18, ua-parser-js@^0.7.9: +ua-parser-js@^0.7.18, ua-parser-js@^0.7.9: version "0.7.21" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" integrity sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ== @@ -31542,11 +31070,6 @@ uid-safe@2.1.5: dependencies: random-bytes "~1.0.0" -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - unbzip2-stream@^1.0.9: version "1.2.5" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz#73a033a567bbbde59654b193c44d48a7e4f43c47" @@ -32773,7 +32296,7 @@ vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== -void-elements@^2.0.0, void-elements@^2.0.1: +void-elements@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= @@ -33198,7 +32721,7 @@ which@1, which@1.3.1, which@^1.2.9, which@^1.3.1, which@~1.3.0: dependencies: isexe "^2.0.0" -which@^1.1.1, which@^1.2.1, which@^1.2.14, which@^1.2.8: +which@^1.2.14, which@^1.2.8: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" integrity sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg== @@ -33538,15 +33061,6 @@ ws@^7.0.0: dependencies: async-limiter "^1.0.0" -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - x-is-function@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" @@ -33629,11 +33143,6 @@ xmlbuilder@13.0.2: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-13.0.2.tgz#02ae33614b6a047d1c32b5389c1fdacb2bce47a7" integrity sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ== -xmlbuilder@8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" - integrity sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M= - xmlbuilder@~11.0.0: version "11.0.1" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" @@ -33654,11 +33163,6 @@ xmldom@0.1.27: resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9" integrity sha1-1QH5ezvbQDr4757MIFcxh6rawOk= -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= - xpath@0.0.27: version "0.0.27" resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.27.tgz#dd3421fbdcc5646ac32c48531b4d7e9d0c2cfa92" @@ -33958,11 +33462,6 @@ yazl@^2.5.1: dependencies: buffer-crc32 "~0.2.3" -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= - yeoman-character@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/yeoman-character/-/yeoman-character-1.1.0.tgz#90d4b5beaf92759086177015b2fdfa2e0684d7c7"