From 8aa8c55002a343adf8d11a154a273f3c84241968 Mon Sep 17 00:00:00 2001 From: Josh Dover Date: Mon, 25 Mar 2019 10:01:20 -0500 Subject: [PATCH 01/25] Rename `newPlatform.start` to `newPlatform.setup` in legacy (#33708) --- src/legacy/core_plugins/console/index.js | 2 +- src/legacy/core_plugins/elasticsearch/index.js | 8 ++++---- .../vis_data/__tests__/helpers/get_es_shard_timeout.js | 2 +- .../server/lib/vis_data/helpers/get_es_shard_timeout.js | 2 +- .../series_functions/__tests__/fixtures/tlConfig.js | 2 +- .../timelion/server/series_functions/es/index.js | 2 +- src/legacy/server/kbn_server.js | 2 +- src/legacy/ui/ui_render/ui_render_mixin.js | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/legacy/core_plugins/console/index.js b/src/legacy/core_plugins/console/index.js index 64d3c04db242..652696bc7bfd 100644 --- a/src/legacy/core_plugins/console/index.js +++ b/src/legacy/core_plugins/console/index.js @@ -103,7 +103,7 @@ export default function (kibana) { } const config = server.config(); - const legacyEsConfig = await server.newPlatform.start.core.elasticsearch.legacy.config$.pipe(first()).toPromise(); + const legacyEsConfig = await server.newPlatform.setup.core.elasticsearch.legacy.config$.pipe(first()).toPromise(); const proxyConfigCollection = new ProxyConfigCollection(options.proxyConfig); const proxyPathFilters = options.proxyFilter.map(str => new RegExp(str)); diff --git a/src/legacy/core_plugins/elasticsearch/index.js b/src/legacy/core_plugins/elasticsearch/index.js index 6abeceb300a0..8dc9c77e79d9 100644 --- a/src/legacy/core_plugins/elasticsearch/index.js +++ b/src/legacy/core_plugins/elasticsearch/index.js @@ -36,9 +36,9 @@ export default function (kibana) { // value from all observables here to be able to synchronously return and create // cluster clients afterwards. const [esConfig, adminCluster, dataCluster] = await combineLatest( - server.newPlatform.start.core.elasticsearch.legacy.config$, - server.newPlatform.start.core.elasticsearch.adminClient$, - server.newPlatform.start.core.elasticsearch.dataClient$ + server.newPlatform.setup.core.elasticsearch.legacy.config$, + server.newPlatform.setup.core.elasticsearch.adminClient$, + server.newPlatform.setup.core.elasticsearch.dataClient$ ).pipe( first(), map(([config, adminClusterClient, dataClusterClient]) => [ @@ -80,7 +80,7 @@ export default function (kibana) { // We fill all the missing properties in the `clientConfig` using the default // Elasticsearch config so that we don't depend on default values set and // controlled by underlying Elasticsearch JS client. - const cluster = new Cluster(server.newPlatform.start.core.elasticsearch.createClient(name, { + const cluster = new Cluster(server.newPlatform.setup.core.elasticsearch.createClient(name, { ...esConfig, ...clientConfig, })); diff --git a/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/get_es_shard_timeout.js b/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/get_es_shard_timeout.js index a3174d0b2c6c..123922ea6a56 100644 --- a/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/get_es_shard_timeout.js +++ b/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/get_es_shard_timeout.js @@ -27,7 +27,7 @@ describe('getEsShardTimeout', () => { const req = { server: { newPlatform: { - start: { + setup: { core: { elasticsearch: { legacy: { config$: of({ shardTimeout: moment.duration(12345) }) } } } diff --git a/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/get_es_shard_timeout.js b/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/get_es_shard_timeout.js index 7f3b8c157cda..a49cc7a6de7c 100644 --- a/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/get_es_shard_timeout.js +++ b/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/get_es_shard_timeout.js @@ -19,7 +19,7 @@ import { first, map } from 'rxjs/operators'; export async function getEsShardTimeout(req) { - return await req.server.newPlatform.start.core.elasticsearch.legacy.config$.pipe( + return await req.server.newPlatform.setup.core.elasticsearch.legacy.config$.pipe( first(), map(config => config.shardTimeout.asMilliseconds()) ).toPromise(); diff --git a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/tlConfig.js b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/tlConfig.js index aaabfc420031..3ad6b0a549b8 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/tlConfig.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/tlConfig.js @@ -42,7 +42,7 @@ export default function () { } }, newPlatform: { - start: { + setup: { core: { elasticsearch: { legacy: { config$: of({ shardTimeout: moment.duration(30000) }) } diff --git a/src/legacy/core_plugins/timelion/server/series_functions/es/index.js b/src/legacy/core_plugins/timelion/server/series_functions/es/index.js index c38d1c2a4af4..1497b7e1953f 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/es/index.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/es/index.js @@ -127,7 +127,7 @@ export default new Datasource('es', { }); } - const esShardTimeout = await tlConfig.server.newPlatform.start.core.elasticsearch.legacy.config$.pipe( + const esShardTimeout = await tlConfig.server.newPlatform.setup.core.elasticsearch.legacy.config$.pipe( first(), map(config => config.shardTimeout.asMilliseconds()) ).toPromise(); diff --git a/src/legacy/server/kbn_server.js b/src/legacy/server/kbn_server.js index a0426869d736..c571785dd51e 100644 --- a/src/legacy/server/kbn_server.js +++ b/src/legacy/server/kbn_server.js @@ -57,7 +57,7 @@ export default class KbnServer { const { plugins, elasticsearch, serverOptions, handledConfigPaths } = core; this.newPlatform = { - start: { + setup: { core: { elasticsearch, }, diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index de17e8d09472..cab15b2017f4 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -216,7 +216,7 @@ export function uiRenderMixin(kbnServer, server, config) { // Get the list of new platform plugins. // Convert the Map into an array of objects so it is JSON serializable and order is preserved. const uiPlugins = [ - ...kbnServer.newPlatform.start.plugins.uiPlugins.public.entries() + ...kbnServer.newPlatform.setup.plugins.uiPlugins.public.entries() ].map(([id, plugin]) => ({ id, plugin })); const nonce = await generateCSPNonce(); From 2c48da24178e07650ca98fcfec36bd8d953da29b Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Mon, 25 Mar 2019 09:26:53 -0700 Subject: [PATCH 02/25] [APM] Rename "Tags" -> "Labels" in span flyout (#33688) * [APM] Closes #33486. Rename "Tags" -> "Labels" in span flyout. * Remove unused translation 'xpack.apm.transactionDetails.spanFlyout.tagsTabLabel' --- .../Waterfall/SpanFlyout/index.tsx | 14 +++++++------- .../plugins/translations/translations/zh-CN.json | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx index b2ed17d1017a..c81b4e522068 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx @@ -57,10 +57,10 @@ export function SpanFlyout({ const codeLanguage = idx(parentTransaction, _ => _.service.language.name); const dbContext = idx(span, _ => _.span.db); const httpContext = idx(span, _ => _.span.http); - const labels = span.labels; - const tags = keys(labels).map(key => ({ + const spanLabels = span.labels; + const labels = keys(spanLabels).map(key => ({ key, - value: get(labels, key) + value: get(spanLabels, key) })); return ( @@ -123,11 +123,11 @@ export function SpanFlyout({ ) }, { - id: 'tags', + id: 'labels', name: i18n.translate( - 'xpack.apm.transactionDetails.spanFlyout.tagsTabLabel', + 'xpack.apm.propertiesTable.tabs.labelsLabel', { - defaultMessage: 'Tags' + defaultMessage: 'Labels' } ), content: ( @@ -144,7 +144,7 @@ export function SpanFlyout({ field: 'value' } ]} - items={tags} + items={labels} /> ) diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index a6866aa2dab6..fc13958a3891 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -3435,7 +3435,6 @@ "xpack.apm.transactionDetails.spanFlyout.spanDetailsTitle": "跨度详情", "xpack.apm.transactionDetails.spanFlyout.spanType.navigationTimingLabel": "导航定时", "xpack.apm.transactionDetails.spanFlyout.stackTraceTabLabel": "堆栈追溯", - "xpack.apm.transactionDetails.spanFlyout.tagsTabLabel": "标记", "xpack.apm.transactionDetails.spanFlyout.typeLabel": "类型", "xpack.apm.transactionDetails.spanFlyout.viewSpanInDiscoverButtonLabel": "在 Discover 中查看跨度", "xpack.apm.transactionDetails.timestampLabel": "时间戳", From 2e232c2e31cdc9ebcf1c75201571f82be003ea2d Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 25 Mar 2019 09:56:48 -0700 Subject: [PATCH 03/25] [@kbn/expect] "fork" expect.js into repo (#33761) * [@kbn/expect] "fork" expect.js into repo * [eslint] autofix references to expect.js * [tslint] autofix all expect.js imports * now that expect.js is in strict mode, avoid reassigning fn.length --- .eslintrc.js | 9 + TYPESCRIPT.md | 2 +- .../development-functional-tests.asciidoc | 6 +- package.json | 2 +- packages/elastic-datemath/test/index.js | 2 +- packages/kbn-dev-utils/package.json | 4 +- packages/kbn-es-query/package.json | 2 +- .../src/es_query/__tests__/_migrate_filter.js | 2 +- .../src/es_query/__tests__/build_es_query.js | 2 +- .../src/es_query/__tests__/decorate_query.js | 2 +- .../__tests__/filter_matches_index.js | 2 +- .../src/es_query/__tests__/from_filters.js | 2 +- .../src/es_query/__tests__/from_kuery.js | 2 +- .../src/es_query/__tests__/from_lucene.js | 2 +- .../__tests__/lucene_string_to_dsl.js | 2 +- .../src/filters/__tests__/phrase.js | 2 +- .../src/filters/__tests__/query.js | 2 +- .../src/filters/__tests__/range.js | 2 +- .../src/kuery/ast/__tests__/ast.js | 2 +- .../filter_migration/__tests__/exists.js | 2 +- .../__tests__/filter_to_kuery.js | 2 +- .../__tests__/geo_bounding_box.js | 2 +- .../filter_migration/__tests__/geo_polygon.js | 2 +- .../filter_migration/__tests__/phrase.js | 2 +- .../kuery/filter_migration/__tests__/range.js | 2 +- .../src/kuery/functions/__tests__/and.js | 2 +- .../src/kuery/functions/__tests__/exists.js | 2 +- .../functions/__tests__/geo_bounding_box.js | 2 +- .../kuery/functions/__tests__/geo_polygon.js | 2 +- .../src/kuery/functions/__tests__/is.js | 2 +- .../src/kuery/functions/__tests__/not.js | 2 +- .../src/kuery/functions/__tests__/or.js | 2 +- .../src/kuery/functions/__tests__/range.js | 2 +- .../functions/__tests__/utils/get_fields.js | 2 +- .../kuery/node_types/__tests__/function.js | 2 +- .../src/kuery/node_types/__tests__/literal.js | 2 +- .../kuery/node_types/__tests__/named_arg.js | 2 +- .../kuery/node_types/__tests__/wildcard.js | 2 +- packages/kbn-eslint-plugin-eslint/index.js | 1 + .../rules/module_migration.js | 82 ++ packages/kbn-expect/LICENSE.txt | 22 + packages/kbn-expect/README.md | 191 ++++ packages/kbn-expect/expect.js | 971 ++++++++++++++++++ packages/kbn-expect/expect.js.d.ts | 221 ++++ packages/kbn-expect/package.json | 7 + packages/kbn-expect/tsconfig.json | 6 + .../template/package_template.json | 4 +- .../template/public/__tests__/index.js | 2 +- .../template/server/__tests__/index.js | 2 +- packages/kbn-test-subj-selector/package.json | 2 +- packages/kbn-test-subj-selector/test/index.js | 2 +- packages/kbn-test/types/README.md | 1 - packages/kbn-test/types/expect.js.d.ts | 225 ---- src/dev/__tests__/file.js | 2 +- src/dev/__tests__/node_versions_must_match.js | 2 +- src/dev/build/lib/__tests__/build.js | 2 +- src/dev/build/lib/__tests__/config.js | 2 +- src/dev/build/lib/__tests__/errors.js | 2 +- src/dev/build/lib/__tests__/fs.js | 2 +- src/dev/build/lib/__tests__/platform.js | 2 +- src/dev/build/lib/__tests__/runner.js | 2 +- src/dev/build/lib/__tests__/version_info.js | 2 +- .../build/tasks/nodejs/__tests__/download.js | 2 +- .../__tests__/download_node_builds_task.js | 2 +- .../tasks/nodejs/__tests__/node_shasums.js | 2 +- .../verify_existing_node_builds_task.js | 2 +- src/dev/license_checker/__tests__/valid.js | 2 +- .../__tests__/junit_report_generation.js | 2 +- src/dev/npm/__tests__/installed_packages.js | 2 +- src/dev/tslint/rules/moduleMigrationRule.js | 59 ++ src/es_archiver/lib/__tests__/stats.js | 2 +- .../lib/archives/__tests__/format.js | 2 +- .../lib/archives/__tests__/parse.js | 2 +- .../__tests__/generate_doc_records_stream.js | 2 +- .../__tests__/index_doc_records_stream.js | 2 +- .../indices/__tests__/create_index_stream.js | 2 +- .../generate_index_records_stream.js | 2 +- .../__tests__/filter_records_stream.js | 2 +- .../fixtures/simple_project/tests.js | 2 +- .../__tests__/integration/basic.js | 2 +- .../__tests__/integration/failure_hooks.js | 2 +- .../lib/config/__tests__/read_config_file.js | 2 +- .../core_plugins/console/__tests__/index.js | 2 +- .../console/public/src/__tests__/utils.js | 2 +- .../__tests__/elasticsearch_proxy_config.js | 2 +- .../console/server/__tests__/proxy_config.js | 2 +- .../__tests__/proxy_config_collection.js | 2 +- .../server/__tests__/proxy_route/body.js | 2 +- .../server/__tests__/proxy_route/headers.js | 2 +- .../server/__tests__/proxy_route/params.js | 2 +- .../__tests__/proxy_route/query_string.js | 2 +- .../console/server/__tests__/set_headers.js | 2 +- .../lib/__tests__/ensure_es_version.js | 2 +- .../lib/__tests__/health_check.js | 2 +- .../__tests__/is_es_compatible_with_kibana.js | 2 +- .../public/control/control.test.js | 2 +- .../filter_manager/filter_manager.test.js | 2 +- .../phrase_filter_manager.test.js | 2 +- .../range_filter_manager.test.js | 2 +- .../public/lineage/lineage_map.test.js | 2 +- .../public/lineage/parent_candidates.test.js | 2 +- .../server/lib/__tests__/create_handlers.js | 2 +- .../public/__tests__/doc_views.js | 2 +- .../public/editors/__tests__/point_series.js | 2 +- .../field_formats/types/__tests__/boolean.js | 2 +- .../field_formats/types/__tests__/bytes.js | 2 +- .../field_formats/types/__tests__/color.js | 2 +- .../field_formats/types/__tests__/date.js | 2 +- .../field_formats/types/__tests__/duration.js | 2 +- .../field_formats/types/__tests__/ip.js | 2 +- .../field_formats/types/__tests__/number.js | 2 +- .../field_formats/types/__tests__/percent.js | 2 +- .../types/__tests__/relative_date.js | 2 +- .../field_formats/types/__tests__/string.js | 2 +- .../field_formats/types/__tests__/truncate.js | 2 +- .../field_formats/types/__tests__/url.js | 2 +- .../highlight/__tests__/highlight_html.js | 2 +- .../highlight/__tests__/highlight_request.js | 2 +- .../convert_pattern_and_ingest_name.js | 2 +- .../utils/__tests__/as_pretty_string.js | 2 +- .../utils/__tests__/shorten_dotted_string.js | 2 +- .../public/context/api/__tests__/anchor.js | 2 +- .../context/api/__tests__/predecessors.js | 2 +- .../context/api/__tests__/successors.js | 2 +- .../context/api/utils/__tests__/sorting.js | 2 +- .../__tests__/action_add_filter.js | 2 +- .../action_increase_predecessor_count.js | 2 +- .../action_increase_successor_count.js | 2 +- .../__tests__/action_set_predecessor_count.js | 2 +- .../__tests__/action_set_query_parameters.js | 2 +- .../__tests__/action_set_successor_count.js | 2 +- .../dashboard/__tests__/saved_dashboards.js | 2 +- .../dashboard/panel/__tests__/panel_state.ts | 2 +- .../hacks/__tests__/hide_empty_tools.js | 2 +- .../__tests__/directives/discover_field.js | 2 +- .../__tests__/directives/field_calculator.js | 2 +- .../__tests__/directives/field_chooser.js | 2 +- .../public/discover/__tests__/hit_sort_fn.js | 2 +- .../kibana/public/doc/__tests__/doc.js | 2 +- .../field_formats/__tests__/_boolean.js | 2 +- .../public/field_formats/__tests__/_color.js | 2 +- .../field_formats/__tests__/_conformance.js | 2 +- .../public/field_formats/__tests__/_date.js | 2 +- .../field_formats/__tests__/_duration.js | 2 +- .../public/field_formats/__tests__/_ip.js | 2 +- .../public/field_formats/__tests__/_source.js | 2 +- .../public/field_formats/__tests__/_string.js | 2 +- .../field_formats/__tests__/_truncate.js | 2 +- .../public/field_formats/__tests__/_url.js | 2 +- .../lib/__tests__/default_category.test.js | 2 +- .../lib/__tests__/get_aria_name.test.js | 2 +- .../lib/__tests__/get_category_name.test.js | 2 +- .../lib/__tests__/get_val_type.test.js | 2 +- .../lib/__tests__/is_default_value.test.js | 2 +- .../lib/__tests__/to_editable_config.test.js | 2 +- .../server/lib/__tests__/handle_es_error.js | 2 +- .../server/lib/__tests__/manage_uuid.js | 2 +- .../server/lib/__tests__/relationships.js | 2 +- .../kibana/server/lib/__tests__/system_api.js | 2 +- .../saved_objects/get_saved_objects.test.js | 2 +- .../metric_vis/public/__tests__/metric_vis.js | 2 +- .../public/__tests__/metric_vis_controller.js | 2 +- .../__tests__/region_map_visualization.js | 2 +- .../public/__tests__/_table_vis_controller.js | 2 +- .../tagcloud/public/__tests__/tag_cloud.js | 2 +- .../__tests__/tag_cloud_visualization.js | 2 +- .../coordinate_maps_visualization.js | 2 +- .../public/__tests__/geohash_layer.js | 2 +- .../public/__tests__/_tick_generator.js | 2 +- .../__tests__/services/tick_formatters.js | 2 +- .../timelion_expression_input_helpers.js | 2 +- .../timelion_expression_suggestions.js | 2 +- .../timelion/server/lib/offset_time.test.js | 2 +- .../public/__tests__/vega_visualization.js | 2 +- .../data_model/__tests__/es_query_parser.js | 2 +- .../data_model/__tests__/search_cache.js | 2 +- .../public/data_model/__tests__/time_cache.js | 2 +- .../data_model/__tests__/vega_parser.js | 2 +- .../deprecation/__tests__/create_transform.js | 2 +- .../deprecations/__tests__/rename.js | 2 +- .../deprecations/__tests__/unused.js | 2 +- .../__tests__/find_plugin_specs.js | 2 +- .../__tests__/extend_config_service.js | 2 +- .../plugin_config/__tests__/schema.js | 2 +- .../plugin_config/__tests__/settings.js | 2 +- .../__tests__/reduce_export_specs.js | 2 +- .../plugin_pack/__tests__/create_pack.js | 2 +- .../__tests__/package_json_at_path.js | 2 +- .../__tests__/package_jsons_in_directory.js | 2 +- .../plugin_pack/__tests__/plugin_pack.js | 2 +- .../__tests__/is_version_compatible.js | 2 +- .../plugin_spec/__tests__/plugin_spec.js | 2 +- .../config/__tests__/deprecation_warnings.js | 2 +- .../usage/classes/__tests__/collector_set.js | 2 +- .../ui_exports_replace_injected_vars.js | 2 +- .../field_formats/__tests__/field_format.js | 2 +- .../__tests__/field_formats_mixin.js | 2 +- .../__tests__/field_formats_service.js | 2 +- src/legacy/ui/public/__tests__/errors.js | 2 +- src/legacy/ui/public/__tests__/metadata.js | 2 +- .../__tests__/kbn_accessible_click.js | 2 +- .../__tests__/kbn_ui_ace_keyboard_mode.js | 2 +- .../__tests__/scrollto_activedescendant.js | 2 +- .../hierarchical/__tests__/collect_branch.js | 2 +- .../point_series/__tests__/_add_to_siri.js | 2 +- .../point_series/__tests__/_fake_x_aspect.js | 2 +- .../point_series/__tests__/_get_aspects.js | 2 +- .../point_series/__tests__/_get_point.js | 2 +- .../point_series/__tests__/_get_series.js | 2 +- .../point_series/__tests__/_init_x_axis.js | 2 +- .../point_series/__tests__/_init_y_axis.js | 2 +- .../point_series/__tests__/_main.js | 2 +- .../__tests__/_ordered_date_axis.js | 2 +- .../__tests__/_tooltip_formatter.js | 2 +- .../agg_response/tabify/__tests__/_buckets.js | 2 +- .../tabify/__tests__/_get_columns.js | 2 +- .../tabify/__tests__/_integration.js | 2 +- .../tabify/__tests__/_response_writer.js | 2 +- .../ui/public/agg_table/__tests__/_group.js | 2 +- .../ui/public/agg_table/__tests__/_table.js | 2 +- .../public/agg_types/__tests__/agg_params.js | 2 +- .../ui/public/agg_types/__tests__/agg_type.js | 2 +- .../agg_types/__tests__/buckets/_geo_hash.js | 2 +- .../agg_types/__tests__/buckets/_histogram.js | 2 +- .../agg_types/__tests__/buckets/_range.js | 2 +- .../buckets/_terms_other_bucket_helper.js | 2 +- .../buckets/create_filter/date_histogram.js | 2 +- .../buckets/create_filter/date_range.js | 2 +- .../buckets/create_filter/filters.js | 2 +- .../buckets/create_filter/histogram.js | 2 +- .../buckets/create_filter/ip_range.js | 2 +- .../__tests__/buckets/create_filter/range.js | 2 +- .../__tests__/buckets/create_filter/terms.js | 2 +- .../buckets/date_histogram/_editor.js | 2 +- .../buckets/date_histogram/_params.js | 2 +- .../agg_types/__tests__/buckets/terms.js | 2 +- .../__tests__/controls/number_list.js | 2 +- .../directives/auto_select_if_only_one.js | 2 +- .../__tests__/directives/input_number.js | 2 +- .../directives/validate_cidr_mask.js | 2 +- .../directives/validate_date_math.js | 2 +- .../__tests__/directives/validate_ip.js | 2 +- .../ui/public/agg_types/__tests__/index.js | 2 +- .../metrics/lib/make_nested_label.js | 2 +- .../agg_types/__tests__/metrics/median.js | 2 +- .../__tests__/metrics/parent_pipeline.js | 2 +- .../__tests__/metrics/percentile_ranks.js | 2 +- .../__tests__/metrics/percentiles.js | 2 +- .../__tests__/metrics/sibling_pipeline.js | 2 +- .../__tests__/metrics/std_deviation.js | 2 +- .../agg_types/__tests__/metrics/top_hit.js | 2 +- .../agg_types/__tests__/param_types/_field.js | 2 +- .../agg_types/__tests__/param_types/_json.js | 2 +- .../__tests__/param_types/_optioned.js | 2 +- .../agg_types/__tests__/param_types/_regex.js | 2 +- .../__tests__/param_types/_string.js | 2 +- src/legacy/ui/public/bind/__tests__/bind.js | 2 +- .../ui/public/binder/__tests__/binder.js | 2 +- .../public/chrome/__tests__/nav_controls.js | 2 +- .../ui/public/chrome/api/__tests__/apps.js | 2 +- .../ui/public/chrome/api/__tests__/nav.js | 2 +- .../ui/public/chrome/api/__tests__/xsrf.js | 2 +- .../__tests__/sub_url_route_filter.js | 2 +- .../ui/public/config/__tests__/config.js | 2 +- .../courier/fetch/__tests__/call_client.js | 2 +- .../courier/fetch/__tests__/fetch_now.js | 2 +- .../__tests__/search_request.js | 2 +- .../segmented_search_request.create_queue.js | 2 +- ...egmented_search_request.index_selection.js | 2 +- .../__tests__/segmented_search_request.js | 2 +- .../segmented_search_request.size_picking.js | 2 +- .../__tests__/serialize_fetch_params.js | 2 +- .../__tests__/search_request_queue.js | 2 +- .../__tests__/normalize_sort_request.js | 2 +- .../search_source/__tests__/search_source.js | 2 +- .../ui/public/debounce/__tests__/debounce.js | 2 +- .../directives/__tests__/css_truncate.js | 2 +- .../directives/__tests__/fixed_scroll.js | 2 +- .../public/directives/__tests__/inequality.js | 2 +- .../directives/__tests__/input_focus.js | 2 +- .../public/directives/__tests__/json_input.js | 2 +- .../__tests__/paginated_selectable_list.js | 2 +- .../directives/__tests__/parse_query.js | 2 +- .../public/directives/__tests__/truncate.js | 2 +- .../directives/__tests__/validate_json.js | 2 +- .../doc_table/__tests__/actions/filter.js | 2 +- .../public/doc_table/__tests__/doc_table.js | 2 +- .../doc_table/__tests__/lib/get_sort.js | 2 +- .../doc_table/__tests__/lib/rows_headers.js | 2 +- .../public/doc_title/__tests__/doc_title.js | 2 +- .../public/doc_viewer/__tests__/doc_viewer.js | 2 +- .../__tests__/documentation_links.js | 2 +- .../public/draggable/__tests__/draggable.js | 2 +- .../error_url_overflow/__tests__/ie_regex.js | 2 +- .../public/factories/__tests__/base_object.js | 2 +- .../ui/public/factories/__tests__/events.js | 2 +- .../fancy_forms/__tests__/fancy_forms.js | 2 +- .../__tests__/nested_fancy_forms.js | 2 +- .../__tests__/field_wildcard.js | 2 +- .../filter_bar/__tests__/_add_filters.js | 2 +- .../filter_bar/__tests__/_get_filters.js | 2 +- .../filter_bar/__tests__/_invert_filters.js | 2 +- .../filter_bar/__tests__/_pin_filters.js | 2 +- .../filter_bar/__tests__/_remove_filters.js | 2 +- .../filter_bar/__tests__/_toggle_filters.js | 2 +- .../filter_bar/__tests__/push_filter.js | 2 +- .../filter_bar/__tests__/query_filter.js | 2 +- .../lib/__tests__/change_time_filter.test.js | 2 +- .../filter_bar/lib/__tests__/dedup_filters.js | 2 +- .../lib/__tests__/extract_time_filter.js | 2 +- .../lib/__tests__/generate_mapping_chain.js | 2 +- .../lib/__tests__/map_and_flatten_filters.js | 2 +- .../filter_bar/lib/__tests__/map_default.js | 2 +- .../filter_bar/lib/__tests__/map_exists.js | 2 +- .../filter_bar/lib/__tests__/map_filter.js | 2 +- .../__tests__/map_flatten_and_wrap_filters.js | 2 +- .../lib/__tests__/map_geo_bounding_box.js | 2 +- .../lib/__tests__/map_geo_polygon.js | 2 +- .../filter_bar/lib/__tests__/map_match_all.js | 2 +- .../filter_bar/lib/__tests__/map_missing.js | 2 +- .../filter_bar/lib/__tests__/map_phrase.js | 2 +- .../lib/__tests__/map_query_string.js | 2 +- .../filter_bar/lib/__tests__/map_range.js | 2 +- .../filter_bar/lib/__tests__/only_disabled.js | 2 +- .../filter_bar/lib/__tests__/uniq_filters.js | 2 +- .../__tests__/filter_manager.js | 2 +- .../ui/public/filters/__tests__/comma_list.js | 2 +- .../ui/public/filters/__tests__/field_type.js | 2 +- .../ui/public/filters/__tests__/label.js | 2 +- .../ui/public/filters/__tests__/moment.js | 2 +- .../public/filters/__tests__/prop_filter.js | 2 +- .../ui/public/filters/__tests__/rison.js | 2 +- .../ui/public/filters/__tests__/short_dots.js | 2 +- .../ui/public/filters/__tests__/start_from.js | 2 +- .../ui/public/filters/__tests__/uriescape.js | 2 +- .../__tests__/_get_computed_fields.js | 2 +- .../__tests__/_index_pattern.js | 2 +- .../index_patterns/__tests__/flatten_hit.js | 2 +- .../__tests__/index_patterns.js | 2 +- .../index_patterns/__tests__/intervals.js | 2 +- .../__tests__/unsupported_time_patterns.js | 2 +- .../static_utils/__tests__/index.js | 2 +- .../indexed_array/__tests__/indexed_array.js | 2 +- .../indexed_array/__tests__/inflector.js | 2 +- .../jquery/__tests__/find_test_subject.js | 2 +- .../kbn_top_nav/__tests__/kbn_top_nav.js | 2 +- .../__tests__/kbn_top_nav_controller.js | 2 +- .../ui/public/listen/__tests__/listen.js | 2 +- .../ui/public/management/__tests__/index.js | 2 +- .../ui/public/management/__tests__/section.js | 2 +- .../public/modals/__tests__/confirm_modal.js | 2 +- .../modals/__tests__/confirm_modal_promise.js | 2 +- .../ui/public/notify/__tests__/notifier.js | 2 +- .../public/notify/lib/format_es_msg.test.js | 2 +- .../ui/public/notify/lib/format_msg.test.js | 2 +- .../public/paginated_table/__tests__/index.js | 2 +- .../__tests__/persisted_state_provider.js | 2 +- .../ui/public/private/__tests__/private.js | 2 +- .../ui/public/promises/__tests__/promises.js | 2 +- .../ui/public/registry/__tests__/registry.js | 2 +- .../__tests__/render_directive.js | 2 +- .../__tests__/resize_checker.js | 2 +- .../public/routes/__tests__/_route_manager.js | 2 +- .../ui/public/routes/__tests__/_work_queue.js | 2 +- .../routes/__tests__/_wrap_route_with_prep.js | 2 +- .../__tests__/find_object_by_title.js | 2 +- .../saved_objects/__tests__/saved_object.js | 2 +- .../__tests__/simple_saved_object.js | 2 +- .../ui/public/share/lib/url_shortener.test.js | 2 +- .../state_management/__tests__/app_state.js | 2 +- .../__tests__/config_provider.js | 2 +- .../__tests__/global_state.js | 2 +- .../state_management/__tests__/state.js | 2 +- .../__tests__/state_monitor_factory.js | 2 +- .../state_hashing/__tests__/hash_url.js | 2 +- .../state_hashing/__tests__/unhash_url.js | 2 +- .../__tests__/hashed_item_store.js | 2 +- .../state_storage/__tests__/state_hash.js | 2 +- .../ui/public/storage/__tests__/storage.js | 2 +- .../style_compile/__tests__/style_compile.js | 2 +- .../public/system_api/__tests__/system_api.js | 2 +- .../ui/public/timefilter/get_time.test.ts | 2 +- .../lib/diff_time_picker_vals.test.js | 2 +- .../ui/public/timefilter/timefilter.test.js | 2 +- .../url/__tests__/extract_app_path_and_id.js | 2 +- .../public/url/__tests__/kibana_parsed_url.js | 2 +- .../ui/public/url/__tests__/prepend_path.js | 2 +- src/legacy/ui/public/url/__tests__/url.js | 2 +- .../utils/__tests__/brush_event.test.js | 2 +- .../ui/public/utils/__tests__/cidr_mask.ts | 2 +- .../ui/public/utils/__tests__/collection.js | 2 +- .../public/utils/__tests__/decode_geo_hash.js | 2 +- .../ui/public/utils/__tests__/diff_object.js | 2 +- .../ui/public/utils/__tests__/ipv4_address.ts | 2 +- .../public/utils/__tests__/mapping_setup.js | 2 +- .../ui/public/utils/__tests__/obj_define.js | 2 +- .../public/utils/__tests__/ordinal_suffix.js | 2 +- .../public/utils/__tests__/parse_interval.js | 2 +- src/legacy/ui/public/utils/__tests__/range.js | 2 +- .../public/utils/__tests__/simple_emitter.js | 2 +- .../utils/__tests__/sort_prefix_first.js | 2 +- .../ui/public/vis/__tests__/_agg_config.js | 2 +- .../vis/__tests__/_agg_config_result.js | 2 +- .../ui/public/vis/__tests__/_agg_configs.js | 2 +- src/legacy/ui/public/vis/__tests__/_vis.js | 2 +- .../public/vis/__tests__/components/color.js | 2 +- .../ui/public/vis/__tests__/map/ems_client.js | 2 +- .../ui/public/vis/__tests__/map/kibana_map.js | 2 +- .../vis/__tests__/map/service_settings.js | 2 +- .../response_handlers/_build_chart_data.js | 2 +- .../vis/__tests__/response_handlers/basic.js | 2 +- .../vis/__tests__/vis_types/base_vis_type.js | 2 +- .../vis/__tests__/vis_types/react_vis_type.js | 2 +- .../__tests__/vis_types/vislib_vis_type.js | 2 +- .../tooltip/__tests__/positioning.js | 2 +- .../vis/editors/default/__tests__/agg.js | 2 +- .../editors/default/__tests__/agg_params.js | 2 +- .../default/__tests__/keyboard_move.js | 2 +- .../vis_types/__tests__/vislib_vis_legend.js | 2 +- .../__tests__/components/heatmap_color.js | 2 +- .../vislib/__tests__/components/labels.js | 2 +- .../__tests__/components/zero_injection.js | 2 +- .../ui/public/vislib/__tests__/index.js | 2 +- .../public/vislib/__tests__/lib/axis/axis.js | 2 +- .../public/vislib/__tests__/lib/axis_title.js | 2 +- .../vislib/__tests__/lib/chart_title.js | 2 +- .../ui/public/vislib/__tests__/lib/data.js | 2 +- .../public/vislib/__tests__/lib/dispatch.js | 2 +- .../vislib/__tests__/lib/error_handler.js | 2 +- .../vislib/__tests__/lib/handler/handler.js | 2 +- .../vislib/__tests__/lib/layout/layout.js | 2 +- .../__tests__/lib/layout/layout_types.js | 2 +- .../lib/layout/splits/column_chart/splits.js | 2 +- .../lib/layout/splits/gauge_chart/splits.js | 2 +- .../lib/layout/types/column_layout.js | 2 +- .../__tests__/lib/types/point_series.js | 2 +- .../public/vislib/__tests__/lib/vis_config.js | 2 +- .../ui/public/vislib/__tests__/lib/x_axis.js | 2 +- .../ui/public/vislib/__tests__/lib/y_axis.js | 2 +- src/legacy/ui/public/vislib/__tests__/vis.js | 2 +- .../__tests__/visualizations/area_chart.js | 2 +- .../vislib/__tests__/visualizations/chart.js | 2 +- .../__tests__/visualizations/column_chart.js | 2 +- .../__tests__/visualizations/gauge_chart.js | 2 +- .../__tests__/visualizations/heatmap_chart.js | 2 +- .../__tests__/visualizations/line_chart.js | 2 +- .../__tests__/visualizations/pie_chart.js | 2 +- .../__tests__/visualizations/time_marker.js | 2 +- .../__tests__/visualizations/vis_types.js | 2 +- .../loader/__tests__/visualization_loader.js | 2 +- .../loader/__tests__/visualize_data_loader.js | 2 +- .../loader/__tests__/visualize_loader.js | 2 +- .../watch_multi/__tests__/watch_multi.js | 2 +- src/legacy/ui/ui_apps/__tests__/ui_app.js | 2 +- .../__tests__/app_entry_template.js | 2 +- .../ui/ui_bundles/__tests__/ui_bundle.js | 2 +- .../__tests__/collect_ui_exports.js | 2 +- .../ui/ui_nav_links/__tests__/ui_nav_link.js | 2 +- .../lib/create_objects_client_stub.js | 2 +- .../ui_settings_mixin_integration.js | 2 +- .../__tests__/ui_settings_service.js | 2 +- .../create_or_upgrade_integration.js | 2 +- .../create_or_upgrade_saved_config.js | 2 +- .../is_config_version_upgradeable.js | 2 +- .../routes/__tests__/doc_exists.js | 2 +- .../routes/__tests__/doc_missing.js | 2 +- .../doc_missing_and_index_read_only.js | 2 +- src/legacy/utils/__tests__/kbn_field_types.js | 2 +- src/legacy/utils/__tests__/unset.js | 2 +- .../strings/__tests__/comma_separated_list.js | 2 +- src/legacy/utils/strings/__tests__/prose.js | 2 +- .../bundles_route/__tests__/bundles_route.js | 2 +- src/test_utils/__tests__/get_url.js | 2 +- src/test_utils/expect_deep_equal.js | 2 +- test/api_integration/apis/general/cookies.js | 2 +- test/api_integration/apis/general/csp.js | 2 +- test/api_integration/apis/home/sample_data.js | 2 +- .../apis/index_patterns/es_errors/errors.js | 2 +- .../es_errors/lib/get_es_errors.js | 2 +- .../fields_for_time_pattern_route/pattern.js | 2 +- .../query_params.js | 2 +- .../fields_for_wildcard_route/conflicts.js | 2 +- .../fields_for_wildcard_route/response.js | 2 +- .../apis/kql_telemetry/kql_telemetry.js | 2 +- .../management/saved_objects/relationships.js | 2 +- .../apis/saved_objects/bulk_create.js | 2 +- .../apis/saved_objects/bulk_get.js | 2 +- .../apis/saved_objects/create.js | 2 +- .../apis/saved_objects/delete.js | 2 +- .../apis/saved_objects/export.js | 2 +- .../apis/saved_objects/find.js | 2 +- .../api_integration/apis/saved_objects/get.js | 2 +- .../apis/saved_objects/import.js | 2 +- .../saved_objects/resolve_import_errors.js | 2 +- .../apis/saved_objects/update.js | 2 +- .../api_integration/apis/scripts/languages.js | 2 +- test/api_integration/apis/search/count.js | 2 +- test/api_integration/apis/shorten/index.js | 2 +- test/api_integration/apis/stats/stats.js | 2 +- test/api_integration/apis/status/status.js | 2 +- .../apis/user_action/user_action.js | 2 +- test/functional/apps/console/_console.ts | 2 +- .../apps/context/_discover_navigation.js | 2 +- test/functional/apps/context/_filters.js | 2 +- test/functional/apps/context/_size.js | 2 +- .../apps/dashboard/bwc_shared_urls.js | 2 +- .../dashboard/create_and_add_embeddables.js | 2 +- .../apps/dashboard/dashboard_clone.js | 2 +- .../apps/dashboard/dashboard_filter_bar.js | 2 +- .../apps/dashboard/dashboard_filtering.js | 2 +- .../apps/dashboard/dashboard_grid.js | 2 +- .../apps/dashboard/dashboard_listing.js | 2 +- .../apps/dashboard/dashboard_options.js | 2 +- .../apps/dashboard/dashboard_query_bar.js | 2 +- .../apps/dashboard/dashboard_save.js | 2 +- .../apps/dashboard/dashboard_snapshots.js | 2 +- .../apps/dashboard/dashboard_state.js | 2 +- .../apps/dashboard/dashboard_time.js | 2 +- .../apps/dashboard/data_shared_attributes.js | 2 +- test/functional/apps/dashboard/embed_mode.js | 2 +- .../apps/dashboard/embeddable_rendering.js | 2 +- .../apps/dashboard/empty_dashboard.js | 2 +- .../apps/dashboard/full_screen_mode.js | 2 +- .../apps/dashboard/panel_controls.js | 2 +- .../apps/dashboard/panel_expand_toggle.js | 2 +- test/functional/apps/dashboard/time_zones.js | 2 +- test/functional/apps/dashboard/view_edit.js | 2 +- test/functional/apps/discover/_discover.js | 2 +- test/functional/apps/discover/_errors.js | 2 +- test/functional/apps/discover/_field_data.js | 2 +- test/functional/apps/discover/_inspector.js | 2 +- .../functional/apps/discover/_large_string.js | 2 +- .../functional/apps/discover/_shared_links.js | 2 +- test/functional/apps/discover/_sidebar.js | 2 +- .../apps/discover/_source_filters.js | 2 +- .../apps/getting_started/_shakespeare.js | 2 +- test/functional/apps/home/_add_data.js | 2 +- test/functional/apps/home/_home.js | 2 +- test/functional/apps/home/_navigation.js | 2 +- test/functional/apps/home/_sample_data.js | 2 +- .../_create_index_pattern_wizard.js | 2 +- .../apps/management/_handle_alias.js | 2 +- .../management/_handle_version_conflict.js | 2 +- .../apps/management/_import_objects.js | 2 +- .../_index_pattern_create_delete.js | 2 +- .../apps/management/_index_pattern_filter.js | 2 +- .../management/_index_pattern_popularity.js | 2 +- .../management/_index_pattern_results_sort.js | 2 +- .../apps/management/_kibana_settings.js | 2 +- .../management/_mgmt_import_saved_objects.js | 2 +- .../apps/management/_scripted_fields.js | 2 +- .../management/_scripted_fields_filter.js | 2 +- .../management/_scripted_fields_preview.js | 2 +- .../apps/management/_test_huge_fields.js | 2 +- test/functional/apps/status_page/index.js | 2 +- .../apps/timelion/_expression_typeahead.js | 2 +- test/functional/apps/visualize/_area_chart.js | 2 +- .../functional/apps/visualize/_chart_types.js | 2 +- test/functional/apps/visualize/_data_table.js | 2 +- .../visualize/_data_table_nontimeindex.js | 2 +- .../apps/visualize/_embedding_chart.js | 2 +- .../apps/visualize/_experimental_vis.js | 2 +- .../functional/apps/visualize/_gauge_chart.js | 2 +- .../apps/visualize/_heatmap_chart.js | 2 +- .../visualize/_histogram_request_start.js | 2 +- .../apps/visualize/_input_control_vis.js | 2 +- test/functional/apps/visualize/_lab_mode.js | 2 +- test/functional/apps/visualize/_line_chart.js | 2 +- .../apps/visualize/_linked_saved_searches.js | 2 +- .../apps/visualize/_markdown_vis.js | 2 +- .../apps/visualize/_metric_chart.js | 2 +- test/functional/apps/visualize/_pie_chart.js | 2 +- .../apps/visualize/_point_series_options.js | 2 +- test/functional/apps/visualize/_region_map.js | 2 +- .../functional/apps/visualize/_shared_item.js | 2 +- test/functional/apps/visualize/_tag_cloud.js | 2 +- test/functional/apps/visualize/_tile_map.js | 2 +- test/functional/apps/visualize/_tsvb_chart.ts | 2 +- .../apps/visualize/_tsvb_markdown.ts | 2 +- test/functional/apps/visualize/_vega_chart.js | 2 +- .../apps/visualize/_vertical_bar_chart.js | 2 +- .../_vertical_bar_chart_nontimeindex.js | 2 +- .../apps/visualize/_visualize_listing.js | 2 +- test/functional/page_objects/common_page.js | 2 +- test/functional/page_objects/discover_page.js | 2 +- test/functional/page_objects/settings_page.js | 2 +- .../functional/page_objects/visualize_page.js | 2 +- .../services/dashboard/expectations.js | 2 +- test/functional/services/inspector.js | 2 +- .../__tests__/remote_default_window_size.js | 2 +- test/functional/services/snapshots.js | 2 +- .../services/visualizations/pie_chart.js | 2 +- .../test_suites/run_pipeline/basic.js | 2 +- .../test_suites/run_pipeline/helpers.js | 2 +- .../test_suites/app_plugins/app_navigation.js | 2 +- .../self_changing_vis.js | 2 +- .../embedding_visualizations/embed_by_id.js | 2 +- .../panel_actions/panel_actions.js | 2 +- test/tsconfig.json | 3 +- tsconfig.json | 3 +- tslint.yaml | 4 + x-pack/common/__tests__/poller.js | 2 +- x-pack/package.json | 2 +- .../functions/browser/__tests__/markdown.js | 2 +- .../functions/common/__tests__/all.js | 2 +- .../functions/common/__tests__/alterColumn.js | 2 +- .../functions/common/__tests__/any.js | 2 +- .../functions/common/__tests__/as.js | 2 +- .../functions/common/__tests__/axis_config.js | 2 +- .../functions/common/__tests__/case.js | 2 +- .../functions/common/__tests__/clear.js | 2 +- .../functions/common/__tests__/columns.js | 2 +- .../functions/common/__tests__/compare.js | 2 +- .../common/__tests__/container_style.js | 2 +- .../functions/common/__tests__/context.js | 2 +- .../functions/common/__tests__/csv.js | 2 +- .../functions/common/__tests__/date.js | 2 +- .../functions/common/__tests__/do.js | 2 +- .../common/__tests__/dropdown_control.js | 2 +- .../functions/common/__tests__/eq.js | 2 +- .../functions/common/__tests__/exactly.js | 2 +- .../functions/common/__tests__/filterrows.js | 2 +- .../functions/common/__tests__/font.js | 2 +- .../functions/common/__tests__/formatdate.js | 2 +- .../common/__tests__/formatnumber.js | 2 +- .../functions/common/__tests__/getCell.js | 2 +- .../common/__tests__/get_flot_axis_config.js | 2 +- .../common/__tests__/get_font_spec.js | 2 +- .../common/__tests__/get_tick_hash.js | 2 +- .../functions/common/__tests__/gt.js | 2 +- .../functions/common/__tests__/gte.js | 2 +- .../functions/common/__tests__/head.js | 2 +- .../functions/common/__tests__/if.js | 2 +- .../functions/common/__tests__/image.js | 2 +- .../functions/common/__tests__/lt.js | 2 +- .../functions/common/__tests__/lte.js | 2 +- .../functions/common/__tests__/mapColumn.js | 2 +- .../functions/common/__tests__/math.js | 2 +- .../functions/common/__tests__/metric.js | 2 +- .../functions/common/__tests__/neq.js | 2 +- .../functions/common/__tests__/palette.js | 2 +- .../functions/common/__tests__/pie.js | 2 +- .../functions/common/__tests__/plot.js | 2 +- .../functions/common/__tests__/ply.js | 2 +- .../functions/common/__tests__/progress.js | 2 +- .../functions/common/__tests__/render.js | 2 +- .../common/__tests__/repeat_image.js | 2 +- .../functions/common/__tests__/replace.js | 2 +- .../common/__tests__/reveal_image.js | 2 +- .../functions/common/__tests__/rounddate.js | 2 +- .../functions/common/__tests__/rowCount.js | 2 +- .../common/__tests__/series_style.js | 2 +- .../common/__tests__/series_style_to_flot.js | 2 +- .../functions/common/__tests__/sort.js | 2 +- .../common/__tests__/staticColumn.js | 2 +- .../functions/common/__tests__/string.js | 2 +- .../functions/common/__tests__/switch.js | 2 +- .../functions/common/__tests__/table.js | 2 +- .../functions/common/__tests__/tail.js | 2 +- .../functions/common/__tests__/timefilter.js | 2 +- .../common/__tests__/timefilter_control.js | 2 +- .../functions/server/__tests__/demodata.js | 2 +- .../server/__tests__/get_expression_type.js | 2 +- .../server/__tests__/get_field_names.js | 2 +- .../server/__tests__/is_column_reference.js | 2 +- .../functions/server/__tests__/pointseries.js | 2 +- .../datacolumn/__tests__/get_form_object.js | 2 +- .../common/lib/__tests__/autocomplete.js | 2 +- .../common/lib/__tests__/find_in_object.js | 2 +- .../lib/__tests__/get_colors_from_palette.js | 2 +- .../common/lib/__tests__/get_field_type.js | 2 +- .../common/lib/__tests__/get_legend_config.js | 2 +- .../canvas/common/lib/__tests__/httpurl.js | 2 +- .../common/lib/__tests__/latest_change.js | 2 +- .../lib/__tests__/pivot_object_array.js | 2 +- .../common/lib/__tests__/unquote_string.js | 2 +- .../components/download/__tests__/download.js | 2 +- .../components/loading/__tests__/loading.js | 2 +- .../public/functions/__tests__/asset.js | 2 +- .../canvas/public/lib/__tests__/clipboard.js | 2 +- .../public/lib/__tests__/history_provider.js | 2 +- .../public/lib/__tests__/modify_path.js | 2 +- .../public/lib/__tests__/resolved_arg.js | 2 +- .../__tests__/elements.get_sibling_context.js | 2 +- .../state/reducers/__tests__/elements.js | 2 +- .../state/reducers/__tests__/resolved_args.js | 2 +- .../selectors/__tests__/resolved_args.js | 2 +- .../state/selectors/__tests__/workpad.js | 2 +- .../__tests__/collector.handle_response.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../__tests__/dashboard_mode_auth_scope.js | 2 +- .../dashboard_mode_request_interceptor.js | 2 +- .../graph/public/__tests__/workspace.js | 2 +- .../server/lib/__tests__/check_license.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../__tests__/grokdebugger_request.js | 2 +- .../__tests__/grokdebugger_response.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../__tests__/conjunction.js | 2 +- .../__tests__/escape_kuery.js | 2 +- .../autocomplete_providers/__tests__/field.js | 2 +- .../__tests__/operator.js | 2 +- .../autocomplete_providers/__tests__/value.js | 2 +- .../common/lib/__tests__/get_moment.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/fetch_all_from_scroll.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../models/cluster/__tests__/cluster.js | 2 +- .../models/pipeline/__tests__/pipeline.js | 2 +- .../__tests__/pipeline_list_item.js | 2 +- .../ml/common/util/__tests__/anomaly_utils.js | 2 +- .../ml/common/util/__tests__/job_utils.js | 2 +- .../common/util/__tests__/parse_interval.js | 2 +- .../ml/common/util/__tests__/string_utils.js | 2 +- .../__tests__/annotations_table_directive.js | 2 +- .../chart_tooltip/__tests__/chart_tooltip.js | 2 +- .../__tests__/confirm_modal_controller.js | 2 +- .../__tests__/select_interval_directive.js | 2 +- .../form_label/__tests__/form_label.js | 2 +- .../json_tooltip/__tests__/json_tooltip.js | 2 +- .../kql_filter_bar/__tests__/utils.js | 2 +- .../__tests__/loading_indicator_directive.js | 2 +- .../messagebar/__tests__/messagebar.js | 2 +- .../components/rule_editor/__tests__/utils.js | 2 +- .../__tests__/datavisualizer_controller.js | 2 +- .../explorer/__tests__/explorer_controller.js | 2 +- .../__tests__/abbreviate_whole_number.js | 2 +- .../formatters/__tests__/format_value.js | 2 +- .../__tests__/metric_change_description.js | 2 +- .../__tests__/round_to_decimal_place.js | 2 +- .../advanced/__tests__/new_job_controller.js | 2 +- .../detector_filter_modal_controller.js | 2 +- .../__tests__/detector_modal_controller.js | 2 +- .../__tests__/save_status_modal_controller.js | 2 +- .../__tests__/create_job_controller.js | 2 +- .../__tests__/create_job_controller.js | 2 +- .../__tests__/create_job_controller.js | 2 +- .../__tests__/create_job_controller.js | 2 +- .../__tests__/index_or_search_controller.js | 2 +- .../job_type/__tests__/job_type_controller.js | 2 +- .../public/license/__tests__/check_license.js | 2 +- .../__tests__/timeseries_chart_directive.js | 2 +- .../timeseriesexplorer_controller.js | 2 +- .../public/util/__tests__/app_state_utils.js | 2 +- .../ml/public/util/__tests__/chart_utils.js | 2 +- .../public/util/__tests__/custom_url_utils.js | 2 +- .../util/__tests__/field_types_utils.js | 2 +- .../public/util/__tests__/ml_time_buckets.js | 2 +- .../ml/public/util/__tests__/string_utils.js | 2 +- .../client/__tests__/elasticsearch_ml.js | 2 +- .../ml/server/lib/__tests__/query_utils.js | 2 +- .../ml/server/lib/__tests__/security_utils.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/bucket_span_estimator.js | 2 +- .../__tests__/job_validation.js | 2 +- .../__tests__/validate_bucket_span.js | 2 +- .../__tests__/validate_cardinality.js | 2 +- .../__tests__/validate_influencers.js | 2 +- .../__tests__/validate_model_memory_limit.js | 2 +- .../__tests__/validate_time_range.js | 2 +- .../monitoring/__tests__/deprecations.js | 2 +- .../__tests__/format_timestamp_to_duration.js | 2 +- .../alerts/__tests__/map_severity.js | 2 +- .../components/chart/__tests__/get_color.js | 2 +- .../chart/__tests__/get_last_value.js | 2 +- .../components/chart/__tests__/get_title.js | 2 +- .../chart/__tests__/get_values_for_legend.js | 2 +- .../models/__tests__/config.js | 2 +- .../models/__tests__/pipeline_state.js | 2 +- .../models/graph/__tests__/boolean_edge.js | 2 +- .../models/graph/__tests__/edge.js | 2 +- .../models/graph/__tests__/edge_factory.js | 2 +- .../models/graph/__tests__/if_vertex.js | 2 +- .../models/graph/__tests__/index.js | 2 +- .../models/graph/__tests__/plugin_vertex.js | 2 +- .../models/graph/__tests__/queue_vertex.js | 2 +- .../models/graph/__tests__/vertex.js | 2 +- .../models/graph/__tests__/vertex_factory.js | 2 +- .../models/pipeline/__tests__/if_statement.js | 2 +- .../pipeline/__tests__/make_statement.js | 2 +- .../models/pipeline/__tests__/pipeline.js | 2 +- .../pipeline/__tests__/plugin_statement.js | 2 +- .../models/pipeline/__tests__/queue.js | 2 +- .../models/pipeline/__tests__/statement.js | 2 +- .../models/pipeline/__tests__/utils.js | 2 +- .../__tests__/monitoring_main_controller.js | 2 +- .../public/lib/__tests__/format_number.js | 2 +- .../lib/logstash/__tests__/pipelines.js | 2 +- .../public/services/__tests__/breadcrumbs.js | 2 +- .../services/__tests__/executor_provider.js | 2 +- .../public/views/__tests__/base_controller.js | 2 +- .../views/__tests__/base_table_controller.js | 2 +- .../monitoring/server/cloud/__tests__/aws.js | 2 +- .../server/cloud/__tests__/azure.js | 2 +- .../server/cloud/__tests__/cloud_detector.js | 2 +- .../server/cloud/__tests__/cloud_response.js | 2 +- .../server/cloud/__tests__/cloud_service.js | 2 +- .../server/cloud/__tests__/cloud_services.js | 2 +- .../monitoring/server/cloud/__tests__/gcp.js | 2 +- .../__tests__/alerts_cluster_search.js | 2 +- .../__tests__/alerts_clusters_aggregation.js | 2 +- .../cluster_alerts/__tests__/check_license.js | 2 +- .../__tests__/verify_monitoring_license.js | 2 +- .../es_client/__tests__/instantiate_client.js | 2 +- .../__tests__/bulk_uploader.js | 2 +- .../__tests__/check_for_email_value.js | 2 +- .../__tests__/get_default_admin_email.js | 2 +- .../ops_buffer/__tests__/event_roller.js | 2 +- .../ops_buffer/__tests__/map_requests.js | 2 +- .../__tests__/map_response_times.js | 2 +- .../server/lib/__tests__/calculate_auto.js | 2 +- .../lib/__tests__/calculate_availabiilty.js | 2 +- .../lib/__tests__/calculate_overall_status.js | 2 +- .../server/lib/__tests__/calculate_rate.js | 2 +- .../calculate_timeseries_interval.js | 2 +- .../server/lib/__tests__/ccs_utils.js | 2 +- .../server/lib/__tests__/create_query.js | 2 +- .../lib/__tests__/process_version_string.js | 2 +- .../lib/beats/__tests__/create_beats_query.js | 2 +- .../lib/beats/__tests__/get_beat_summary.js | 2 +- .../server/lib/beats/__tests__/get_beats.js | 2 +- .../beats/__tests__/get_beats_for_clusters.js | 2 +- .../lib/beats/__tests__/get_latest_stats.js | 2 +- .../server/lib/beats/__tests__/get_stats.js | 2 +- .../__tests__/flag_supported_clusters.js | 2 +- .../cluster/__tests__/get_cluster_status.js | 2 +- .../cluster/__tests__/get_clusters_state.js | 2 +- .../cluster/__tests__/get_clusters_stats.js | 2 +- .../__tests__/get_last_recovery.js | 2 +- .../elasticsearch/__tests__/get_ml_jobs.js | 2 +- .../indices/__tests__/get_index_summary.js | 2 +- .../indices/__tests__/get_indices.js | 2 +- .../nodes/__tests__/calculate_node_type.js | 2 +- .../nodes/__tests__/get_node_summary.js | 2 +- .../__tests__/get_node_type_class_label.js | 2 +- .../elasticsearch/nodes/__tests__/lookups.js | 2 +- .../shards/__tests__/get_shard_stats.js | 2 +- .../__tests__/normalize_shard_objects.js | 2 +- .../__tests__/cluster.js | 2 +- .../__tests__/find_reason.js | 2 +- .../elasticsearch_settings/__tests__/nodes.js | 2 +- .../lib/errors/__tests__/auth_errors.js | 2 +- .../lib/errors/__tests__/known_errors.js | 2 +- .../lib/kibana/__tests__/get_kibana_info.js | 2 +- .../lib/logstash/__tests__/get_node_info.js | 2 +- .../lib/logstash/__tests__/get_pipeline.js | 2 +- .../lib/logstash/__tests__/get_pipelines.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../common/__tests__/export_types_registry.js | 2 +- .../csv/server/__tests__/execute_job.js | 2 +- .../csv/server/lib/__tests__/escape_value.js | 2 +- .../server/lib/__tests__/field_format_map.js | 2 +- .../csv/server/lib/__tests__/flatten_hit.js | 2 +- .../server/lib/__tests__/format_csv_values.js | 2 +- .../lib/__tests__/max_size_string_builder.js | 2 +- .../browsers/extract/__tests__/extract.js | 2 +- .../server/lib/__tests__/check_license.js | 2 +- .../__tests__/helpers/cancellation_token.js | 2 +- .../esqueue/__tests__/helpers/create_index.js | 2 +- .../lib/esqueue/__tests__/helpers/errors.js | 2 +- .../__tests__/helpers/index_timestamp.js | 2 +- .../server/lib/esqueue/__tests__/index.js | 2 +- .../server/lib/esqueue/__tests__/job.js | 2 +- .../server/lib/esqueue/__tests__/worker.js | 2 +- .../lib/validate/__tests__/validate_config.js | 2 +- .../__tests__/validate_max_content_length.js | 2 +- .../authorized_user_pre_routing.test.js | 2 +- .../lib/__tests__/jobs_compatibility.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../public/__tests__/app_util.js | 2 +- .../profile_tree/__tests__/profile_tree.js | 2 +- .../public/filters/__tests__/ns_to_pretty.js | 2 +- .../server/lib/__tests__/check_license.js | 2 +- .../public/lib/__tests__/parse_next.js | 2 +- .../security/public/lib/__tests__/util.js | 2 +- .../server/lib/__tests__/auth_redirect.js | 2 +- .../lib/__tests__/auth_scope_service.js | 2 +- .../server/lib/__tests__/check_license.js | 2 +- .../security/server/lib/__tests__/errors.js | 2 +- .../server/lib/__tests__/parse_next.js | 2 +- .../server/lib/__tests__/validate_config.js | 2 +- .../authentication/__tests__/authenticator.js | 2 +- .../lib/authentication/__tests__/session.js | 2 +- .../providers/__tests__/basic.js | 2 +- .../providers/__tests__/token.js | 2 +- .../routes/api/v1/__tests__/authenticate.js | 2 +- .../server/routes/api/v1/__tests__/users.js | 2 +- .../server/lib/__tests__/inspect_settings.js | 2 +- .../watcher/__tests__/plugin_definition.js | 2 +- .../__tests__/get_action_type.js | 2 +- .../lib/get_moment/__tests__/get_moment.js | 2 +- .../__tests__/sortable_boolean.js | 2 +- .../check_license/__tests__/check_license.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/fetch_all_from_scroll.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../action_status/__tests__/action_status.js | 2 +- .../__tests__/execute_details.js | 2 +- .../server/models/fields/__tests__/fields.js | 2 +- .../models/settings/__tests__/settings.js | 2 +- .../models/watch/__tests__/base_watch.js | 2 +- .../models/watch/__tests__/json_watch.js | 2 +- .../watch/__tests__/monitoring_watch.js | 2 +- .../models/watch/__tests__/threshold_watch.js | 2 +- .../server/models/watch/__tests__/watch.js | 2 +- .../__tests__/format_visualize_data.js | 2 +- .../__tests__/watch_history_item.js | 2 +- .../watch_status/__tests__/watch_status.js | 2 +- .../public/hacks/__tests__/fetch_telemetry.js | 2 +- .../welcome_banner/__tests__/click_banner.js | 2 +- .../__tests__/handle_old_settings.js | 2 +- .../welcome_banner/__tests__/render_banner.js | 2 +- .../__tests__/should_show_banner.js | 2 +- .../public/services/__tests__/xpack_info.js | 2 +- .../__tests__/xpack_info_signature.js | 2 +- .../lib/__tests__/call_cluster_factory.js | 2 +- .../__tests__/inject_xpack_info_signature.js | 2 +- .../lib/__tests__/replace_injected_vars.js | 2 +- .../server/lib/__tests__/xpack_info.js | 2 +- .../local/__tests__/get_cluster_info.js | 2 +- .../local/__tests__/get_cluster_stats.js | 2 +- .../local/__tests__/get_local_stats.js | 2 +- .../telemetry/local/__tests__/get_xpack.js | 2 +- .../monitoring/__tests__/create_query.js | 2 +- .../monitoring/__tests__/get_all_stats.js | 2 +- .../monitoring/__tests__/get_beats_stats.js | 2 +- .../monitoring/__tests__/get_cluster_uuids.js | 2 +- .../monitoring/__tests__/get_es_stats.js | 2 +- .../__tests__/get_high_level_stats.js | 2 +- .../monitoring/__tests__/get_kibana_stats.js | 2 +- .../routes/api/v1/__tests__/xpack_info.js | 2 +- .../api/v1/telemetry/__tests__/telemetry.js | 2 +- .../lib/__tests__/key_case_converter.js | 2 +- x-pack/server/lib/__tests__/kibana_state.js | 2 +- .../lib/__tests__/mirror_plugin_status.js | 2 +- .../__tests__/wrap_custom_error.js | 2 +- .../error_wrappers/__tests__/wrap_es_error.js | 2 +- .../__tests__/wrap_unknown_error.js | 2 +- .../__tests__/is_es_error_factory.js | 2 +- .../__tests__/license_pre_routing_factory.js | 2 +- .../apis/beats/assign_tags_to_beats.js | 2 +- .../apis/beats/create_enrollment_tokens.js | 2 +- .../api_integration/apis/beats/enroll_beat.js | 2 +- .../api_integration/apis/beats/get_beat.js | 2 +- .../api_integration/apis/beats/list_beats.js | 2 +- .../apis/beats/remove_tags_from_beats.js | 2 +- .../api_integration/apis/beats/set_config.js | 2 +- .../api_integration/apis/beats/set_tag.js | 2 +- .../api_integration/apis/beats/update_beat.js | 2 +- .../api_integration/apis/es/has_privileges.js | 2 +- .../apis/es/post_privileges.js | 2 +- .../api_integration/apis/infra/log_entries.ts | 2 +- .../api_integration/apis/infra/log_item.ts | 2 +- .../api_integration/apis/infra/log_summary.ts | 2 +- .../apis/infra/logs_without_millis.ts | 2 +- .../api_integration/apis/infra/metadata.ts | 2 +- .../api_integration/apis/infra/metrics.ts | 2 +- .../api_integration/apis/infra/sources.ts | 2 +- .../test/api_integration/apis/infra/waffle.ts | 2 +- .../kibana/kql_telemetry/kql_telemetry.js | 2 +- .../apis/kibana/stats/stats.js | 2 +- .../apis/logstash/cluster/load.js | 2 +- .../apis/logstash/pipeline/load.js | 2 +- .../apis/logstash/pipeline/save.js | 2 +- .../apis/logstash/pipelines/list.js | 2 +- .../auto_follow_pattern.js | 2 +- .../follower_indices.js | 2 +- .../remote_clusters/remote_clusters.js | 2 +- .../rollup/index_patterns_extensions.js | 2 +- .../apis/management/rollup/rollup.js | 2 +- .../apis/management/rollup/rollup_search.js | 2 +- .../api_integration/apis/maps/migrations.js | 2 +- .../apis/monitoring/apm/instance.js | 2 +- .../apis/monitoring/apm/instances.js | 2 +- .../apis/monitoring/apm/overview.js | 2 +- .../apis/monitoring/beats/detail.js | 2 +- .../apis/monitoring/beats/list.js | 2 +- .../apis/monitoring/beats/overview.js | 2 +- .../apis/monitoring/cluster/list.js | 2 +- .../apis/monitoring/cluster/overview.js | 2 +- .../apis/monitoring/common/mappings_exist.js | 2 +- .../apis/monitoring/elasticsearch/ccr.js | 2 +- .../monitoring/elasticsearch/ccr_shard.js | 2 +- .../monitoring/elasticsearch/index_detail.js | 2 +- .../apis/monitoring/elasticsearch/indices.js | 2 +- .../monitoring/elasticsearch/node_detail.js | 2 +- .../elasticsearch/node_detail_advanced.js | 2 +- .../apis/monitoring/elasticsearch/nodes.js | 2 +- .../apis/monitoring/elasticsearch/overview.js | 2 +- .../elasticsearch_settings/check_cluster.js | 2 +- .../elasticsearch_settings/check_nodes.js | 2 +- .../set_collection_enabled.js | 2 +- .../set_collection_interval.js | 2 +- .../apis/monitoring/kibana/instance.js | 2 +- .../apis/monitoring/kibana/listing.js | 2 +- .../apis/monitoring/kibana/overview.js | 2 +- .../apis/monitoring/logstash/node_detail.js | 2 +- .../apis/monitoring/logstash/nodes.js | 2 +- .../apis/monitoring/logstash/overview.js | 2 +- .../monitoring/standalone_cluster/cluster.js | 2 +- .../monitoring/standalone_cluster/clusters.js | 2 +- .../apis/security/basic_login.js | 2 +- .../api_integration/apis/security/roles.js | 2 +- .../apis/uptime/get_all_pings.js | 2 +- .../apis/uptime/graphql/doc_count.js | 2 +- .../apis/uptime/graphql/error_list.js | 2 +- .../apis/uptime/graphql/filter_bar.js | 2 +- .../apis/uptime/graphql/monitor_charts.js | 2 +- .../apis/uptime/graphql/monitor_list.js | 2 +- .../apis/uptime/graphql/monitor_status_bar.js | 2 +- .../apis/uptime/graphql/ping_list.js | 2 +- .../apis/uptime/graphql/snapshot.js | 2 +- .../apis/xpack_main/settings/settings.js | 2 +- .../apis/xpack_main/telemetry/telemetry.js | 2 +- .../xpack_main/telemetry/telemetry_local.js | 2 +- .../test/functional/apps/canvas/smoke_test.js | 2 +- .../dashboard_mode/dashboard_view_mode.js | 2 +- x-pack/test/functional/apps/graph/graph.js | 2 +- .../apps/logstash/pipeline_create.js | 2 +- .../functional/apps/logstash/pipeline_list.js | 2 +- .../functional/apps/maps/add_layer_panel.js | 2 +- .../apps/maps/embeddable/dashboard.js | 2 +- .../apps/maps/es_geo_grid_source.js | 2 +- .../functional/apps/maps/es_search_source.js | 2 +- x-pack/test/functional/apps/maps/joins.js | 2 +- .../test/functional/apps/maps/layer_errors.js | 2 +- .../test/functional/apps/maps/sample_data.js | 2 +- .../apps/maps/saved_object_management.js | 2 +- .../apps/monitoring/beats/beat_detail.js | 2 +- .../apps/monitoring/beats/cluster.js | 2 +- .../apps/monitoring/beats/listing.js | 2 +- .../apps/monitoring/beats/overview.js | 2 +- .../apps/monitoring/cluster/alerts.js | 2 +- .../apps/monitoring/cluster/list.js | 2 +- .../apps/monitoring/cluster/overview.js | 2 +- .../monitoring/elasticsearch/index_detail.js | 2 +- .../apps/monitoring/elasticsearch/indices.js | 2 +- .../monitoring/elasticsearch/node_detail.js | 2 +- .../apps/monitoring/elasticsearch/nodes.js | 2 +- .../apps/monitoring/elasticsearch/overview.js | 2 +- .../apps/monitoring/elasticsearch/shards.js | 2 +- .../monitoring/enable_monitoring/index.js | 2 +- .../apps/monitoring/kibana/instance.js | 2 +- .../apps/monitoring/kibana/instances.js | 2 +- .../apps/monitoring/kibana/overview.js | 2 +- .../apps/monitoring/logstash/pipelines.js | 2 +- .../functional/apps/rollup_job/rollup_jobs.js | 2 +- .../apps/security/doc_level_security_roles.js | 2 +- .../apps/security/field_level_security.js | 2 +- .../functional/apps/security/management.js | 2 +- .../functional/apps/security/rbac_phase1.js | 2 +- .../apps/security/secure_roles_perm.js | 2 +- .../test/functional/apps/security/security.js | 2 +- .../functional/apps/security/user_email.js | 2 +- x-pack/test/functional/apps/security/users.js | 2 +- .../functional/apps/watcher/watcher_test.js | 2 +- .../page_objects/accountsetting_page.js | 2 +- .../functional/page_objects/rollup_page.js | 2 +- .../page_objects/space_selector_page.js | 2 +- .../functional/page_objects/status_page.js | 2 +- .../page_objects/upgrade_assistant.js | 2 +- .../test/functional/services/grok_debugger.js | 2 +- .../services/monitoring/cluster_overview.js | 2 +- .../functional/services/pipeline_editor.js | 2 +- .../task_manager/task_manager_integration.js | 2 +- x-pack/test/reporting/api/usage.js | 2 +- x-pack/test/reporting/functional/reporting.js | 2 +- .../test/reporting/services/reporting_api.js | 2 +- .../apis/security/saml_login.js | 2 +- .../common/suites/bulk_create.ts | 2 +- .../common/suites/bulk_get.ts | 2 +- .../common/suites/create.ts | 2 +- .../common/suites/delete.ts | 2 +- .../common/suites/export.ts | 2 +- .../common/suites/find.ts | 2 +- .../common/suites/get.ts | 2 +- .../common/suites/import.ts | 2 +- .../common/suites/resolve_import_errors.ts | 2 +- .../common/suites/update.ts | 2 +- .../spaces_only/apis/bulk_create.ts | 2 +- .../spaces_only/apis/create.ts | 2 +- .../common/suites/create.ts | 2 +- .../common/suites/delete.ts | 2 +- .../common/suites/get.ts | 2 +- .../common/suites/get_all.ts | 2 +- .../common/suites/select.ts | 2 +- .../common/suites/update.ts | 2 +- x-pack/test/tsconfig.json | 1 - .../upgrade_assistant/reindexing.js | 2 +- x-pack/tsconfig.json | 3 +- yarn.lock | 5 - 1117 files changed, 2679 insertions(+), 1341 deletions(-) create mode 100644 packages/kbn-eslint-plugin-eslint/rules/module_migration.js create mode 100644 packages/kbn-expect/LICENSE.txt create mode 100644 packages/kbn-expect/README.md create mode 100644 packages/kbn-expect/expect.js create mode 100644 packages/kbn-expect/expect.js.d.ts create mode 100644 packages/kbn-expect/package.json create mode 100644 packages/kbn-expect/tsconfig.json delete mode 100644 packages/kbn-test/types/expect.js.d.ts create mode 100644 src/dev/tslint/rules/moduleMigrationRule.js diff --git a/.eslintrc.js b/.eslintrc.js index 8bfa6c595966..ea3ad6ec3ccd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -47,6 +47,15 @@ module.exports = { rules: { 'no-restricted-imports': [2, restrictedModules], 'no-restricted-modules': [2, restrictedModules], + '@kbn/eslint/module_migration': [ + 'error', + [ + { + from: 'expect.js', + to: '@kbn/expect', + }, + ], + ], }, overrides: [ diff --git a/TYPESCRIPT.md b/TYPESCRIPT.md index 68cb32ce36c7..66b2fd0e77c6 100644 --- a/TYPESCRIPT.md +++ b/TYPESCRIPT.md @@ -111,7 +111,7 @@ If yarn doesn't find the module it may not have types. For example, our `rison_ 1. Contribute types into the DefinitelyTyped repo itself, or 2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/plugins/infra/types/rison_node.d.ts`. Other code uses it too so we will need to pull it up. Or, -3. Add a `// @ts-ignore` line above the import. This should be used minimally, the above options are better. However, sometimes you have to resort to this method. For example, the `expect.js` module will require this line. We don't have type definitions installed for this library. Installing these types would conflict with the jest typedefs for expect, and since they aren't API compatible with each other, it's not possible to make both test frameworks happy. Since we are moving from mocha => jest, we don't see this is a big issue. +3. Add a `// @ts-ignore` line above the import. This should be used minimally, the above options are better. However, sometimes you have to resort to this method. ### TypeScripting react files diff --git a/docs/development/core/development-functional-tests.asciidoc b/docs/development/core/development-functional-tests.asciidoc index 813c4fa929aa..8d1238993b7c 100644 --- a/docs/development/core/development-functional-tests.asciidoc +++ b/docs/development/core/development-functional-tests.asciidoc @@ -82,7 +82,7 @@ Use the `--help` flag for more options. [float] ===== Environment -The tests are written in https://mochajs.org[mocha] using https://github.com/Automattic/expect.js[expect] for assertions. +The tests are written in https://mochajs.org[mocha] using https://github.com/elastic/kibana/tree/master/packages/kbn-expect[@kbn/expect] for assertions. We use https://sites.google.com/a/chromium.org/chromedriver/[chromedriver], https://theintern.github.io/leadfoot[leadfoot], and https://github.com/theintern/digdug[digdug] for automating Chrome. When the `FunctionalTestRunner` launches, digdug opens a `Tunnel` which starts chromedriver and a stripped-down instance of Chrome. It also creates an instance of https://theintern.github.io/leadfoot/module-leadfoot_Command.html[Leadfoot's `Command`] class, which is available via the `remote` service. The `remote` communicates to Chrome through the digdug `Tunnel`. See the https://theintern.github.io/leadfoot/module-leadfoot_Command.html[leadfoot/Command API] docs for all the commands you can use with `remote`. @@ -122,11 +122,11 @@ A test suite is a collection of tests defined by calling `describe()`, and then [float] ===== Anatomy of a test file -The annotated example file below shows the basic structure every test suite uses. It starts by importing https://github.com/Automattic/expect.js[`expect.js`] and defining its default export: an anonymous Test Provider. The test provider then destructures the Provider API for the `getService()` and `getPageObjects()` functions. It uses these functions to collect the dependencies of this suite. The rest of the test file will look pretty normal to mocha.js users. `describe()`, `it()`, `before()` and the lot are used to define suites that happen to automate a browser via services and objects of type `PageObject`. +The annotated example file below shows the basic structure every test suite uses. It starts by importing https://github.com/elastic/kibana/tree/master/packages/kbn-expect[`@kbn/expect`] and defining its default export: an anonymous Test Provider. The test provider then destructures the Provider API for the `getService()` and `getPageObjects()` functions. It uses these functions to collect the dependencies of this suite. The rest of the test file will look pretty normal to mocha.js users. `describe()`, `it()`, `before()` and the lot are used to define suites that happen to automate a browser via services and objects of type `PageObject`. ["source","js"] ---- -import expect from 'expect.js'; +import expect from '@kbn/expect'; // test files must `export default` a function that defines a test suite export default function ({ getService, getPageObject }) { diff --git a/package.json b/package.json index fee468ac45ac..30bd3f9d5289 100644 --- a/package.json +++ b/package.json @@ -258,6 +258,7 @@ "@kbn/es": "1.0.0", "@kbn/eslint-import-resolver-kibana": "2.0.0", "@kbn/eslint-plugin-eslint": "1.0.0", + "@kbn/expect": "1.0.0", "@kbn/plugin-generator": "1.0.0", "@kbn/test": "1.0.0", "@octokit/rest": "^15.10.0", @@ -346,7 +347,6 @@ "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^2.6.2", "eslint-plugin-react": "^7.11.1", - "expect.js": "0.3.1", "faker": "1.1.0", "fetch-mock": "7.3.0", "geckodriver": "1.12.2", diff --git a/packages/elastic-datemath/test/index.js b/packages/elastic-datemath/test/index.js index 2028c2c0cedc..582b331eac7e 100644 --- a/packages/elastic-datemath/test/index.js +++ b/packages/elastic-datemath/test/index.js @@ -20,7 +20,7 @@ import dateMath from '../src/index'; import moment from 'moment'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; /** * Require a new instance of the moment library, bypassing the require cache. diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 3775cc06d3b1..af39ffecf669 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -20,8 +20,8 @@ }, "devDependencies": { "@kbn/babel-preset": "1.0.0", + "@kbn/expect": "1.0.0", "babel-cli": "^6.26.0", - "chance": "1.0.6", - "expect.js": "0.3.1" + "chance": "1.0.6" } } diff --git a/packages/kbn-es-query/package.json b/packages/kbn-es-query/package.json index 09682ae7ede3..ff68adeac863 100644 --- a/packages/kbn-es-query/package.json +++ b/packages/kbn-es-query/package.json @@ -22,8 +22,8 @@ "@babel/preset-typescript": "^7.3.3", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", + "@kbn/expect": "1.0.0", "del": "^3.0.0", - "expect.js": "0.3.1", "getopts": "^2.2.3", "supports-color": "^6.1.0", "typescript": "^3.3.3333" diff --git a/packages/kbn-es-query/src/es_query/__tests__/_migrate_filter.js b/packages/kbn-es-query/src/es_query/__tests__/_migrate_filter.js index 0faa0d6de646..d9f559987f58 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/_migrate_filter.js +++ b/packages/kbn-es-query/src/es_query/__tests__/_migrate_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import { migrateFilter } from '../migrate_filter'; diff --git a/packages/kbn-es-query/src/es_query/__tests__/build_es_query.js b/packages/kbn-es-query/src/es_query/__tests__/build_es_query.js index 951a9e03cb9f..879fb1cd6c45 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/build_es_query.js +++ b/packages/kbn-es-query/src/es_query/__tests__/build_es_query.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { buildEsQuery } from '../build_es_query'; import indexPattern from '../../__fixtures__/index_pattern_response.json'; import { fromKueryExpression, toElasticsearchQuery } from '../../kuery'; diff --git a/packages/kbn-es-query/src/es_query/__tests__/decorate_query.js b/packages/kbn-es-query/src/es_query/__tests__/decorate_query.js index 5b3e64bb229a..447a875e9ead 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/decorate_query.js +++ b/packages/kbn-es-query/src/es_query/__tests__/decorate_query.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { decorateQuery } from '../decorate_query'; describe('Query decorator', function () { diff --git a/packages/kbn-es-query/src/es_query/__tests__/filter_matches_index.js b/packages/kbn-es-query/src/es_query/__tests__/filter_matches_index.js index fe7da0373126..1c43230aeea3 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/filter_matches_index.js +++ b/packages/kbn-es-query/src/es_query/__tests__/filter_matches_index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { filterMatchesIndex } from '../filter_matches_index'; describe('filterMatchesIndex', function () { diff --git a/packages/kbn-es-query/src/es_query/__tests__/from_filters.js b/packages/kbn-es-query/src/es_query/__tests__/from_filters.js index 8d1b103c8f66..53016f33dc6c 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/from_filters.js +++ b/packages/kbn-es-query/src/es_query/__tests__/from_filters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { buildQueryFromFilters } from '../from_filters'; describe('build query', function () { diff --git a/packages/kbn-es-query/src/es_query/__tests__/from_kuery.js b/packages/kbn-es-query/src/es_query/__tests__/from_kuery.js index 7f4952fbbfc4..7c285a4416ab 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/from_kuery.js +++ b/packages/kbn-es-query/src/es_query/__tests__/from_kuery.js @@ -19,7 +19,7 @@ import { buildQueryFromKuery } from '../from_kuery'; import indexPattern from '../../__fixtures__/index_pattern_response.json'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fromKueryExpression, toElasticsearchQuery } from '../../kuery'; describe('build query', function () { diff --git a/packages/kbn-es-query/src/es_query/__tests__/from_lucene.js b/packages/kbn-es-query/src/es_query/__tests__/from_lucene.js index 5da5075925db..7a4b6f7b359f 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/from_lucene.js +++ b/packages/kbn-es-query/src/es_query/__tests__/from_lucene.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { buildQueryFromLucene } from '../from_lucene'; import { decorateQuery } from '../decorate_query'; import { luceneStringToDsl } from '../lucene_string_to_dsl'; diff --git a/packages/kbn-es-query/src/es_query/__tests__/lucene_string_to_dsl.js b/packages/kbn-es-query/src/es_query/__tests__/lucene_string_to_dsl.js index 67908f28b733..04f6209ce666 100644 --- a/packages/kbn-es-query/src/es_query/__tests__/lucene_string_to_dsl.js +++ b/packages/kbn-es-query/src/es_query/__tests__/lucene_string_to_dsl.js @@ -18,7 +18,7 @@ */ import { luceneStringToDsl } from '../lucene_string_to_dsl'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('build query', function () { diff --git a/packages/kbn-es-query/src/filters/__tests__/phrase.js b/packages/kbn-es-query/src/filters/__tests__/phrase.js index 0fd2a5fbd076..6b611fdf074f 100644 --- a/packages/kbn-es-query/src/filters/__tests__/phrase.js +++ b/packages/kbn-es-query/src/filters/__tests__/phrase.js @@ -19,7 +19,7 @@ import { buildInlineScriptForPhraseFilter, buildPhraseFilter } from '../phrase'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import indexPattern from '../../__fixtures__/index_pattern_response.json'; import filterSkeleton from '../../__fixtures__/filter_skeleton'; diff --git a/packages/kbn-es-query/src/filters/__tests__/query.js b/packages/kbn-es-query/src/filters/__tests__/query.js index 62f7a898140c..8b774f05c29d 100644 --- a/packages/kbn-es-query/src/filters/__tests__/query.js +++ b/packages/kbn-es-query/src/filters/__tests__/query.js @@ -19,7 +19,7 @@ import { buildQueryFilter } from '../query'; import { cloneDeep } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import indexPattern from '../../__fixtures__/index_pattern_response.json'; import filterSkeleton from '../../__fixtures__/filter_skeleton'; diff --git a/packages/kbn-es-query/src/filters/__tests__/range.js b/packages/kbn-es-query/src/filters/__tests__/range.js index 6fe914475836..595b386a32ab 100644 --- a/packages/kbn-es-query/src/filters/__tests__/range.js +++ b/packages/kbn-es-query/src/filters/__tests__/range.js @@ -18,7 +18,7 @@ */ import { buildRangeFilter } from '../range'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import indexPattern from '../../__fixtures__/index_pattern_response.json'; import filterSkeleton from '../../__fixtures__/filter_skeleton'; diff --git a/packages/kbn-es-query/src/kuery/ast/__tests__/ast.js b/packages/kbn-es-query/src/kuery/ast/__tests__/ast.js index 1107d1eea04d..96039526752d 100644 --- a/packages/kbn-es-query/src/kuery/ast/__tests__/ast.js +++ b/packages/kbn-es-query/src/kuery/ast/__tests__/ast.js @@ -18,7 +18,7 @@ */ import * as ast from '../ast'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { nodeTypes } from '../../node_types/index'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/exists.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/exists.js index e4eff469933d..6c149b6b8a98 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/exists.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/exists.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertExistsFilter } from '../exists'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/filter_to_kuery.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/filter_to_kuery.js index f21675fdd7de..1e5656f85eb8 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/filter_to_kuery.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/filter_to_kuery.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { filterToKueryAST } from '../filter_to_kuery'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_bounding_box.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_bounding_box.js index 6842e2b8a3dd..e4cb6d30bbf4 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_bounding_box.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_bounding_box.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertGeoBoundingBox } from '../geo_bounding_box'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_polygon.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_polygon.js index 0228a73a9951..e1b2a09edaba 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_polygon.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/geo_polygon.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertGeoPolygon } from '../geo_polygon'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/phrase.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/phrase.js index 4e3df8d6ddec..b2a7c097a3f9 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/phrase.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/phrase.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertPhraseFilter } from '../phrase'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/range.js b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/range.js index 5583a585e35e..2cad37cc0ad3 100644 --- a/packages/kbn-es-query/src/kuery/filter_migration/__tests__/range.js +++ b/packages/kbn-es-query/src/kuery/filter_migration/__tests__/range.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertRangeFilter } from '../range'; describe('filter to kuery migration', function () { diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/and.js b/packages/kbn-es-query/src/kuery/functions/__tests__/and.js index 2a29e01d2b50..5a0d3a9cd58b 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/and.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/and.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as and from '../and'; import { nodeTypes } from '../../node_types'; import * as ast from '../../ast'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/exists.js b/packages/kbn-es-query/src/kuery/functions/__tests__/exists.js index 694c044bd49f..0eaa69a3243e 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/exists.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/exists.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as exists from '../exists'; import { nodeTypes } from '../../node_types'; import _ from 'lodash'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/geo_bounding_box.js b/packages/kbn-es-query/src/kuery/functions/__tests__/geo_bounding_box.js index 28aee22dd94d..2f8b784d6f6e 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/geo_bounding_box.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/geo_bounding_box.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as geoBoundingBox from '../geo_bounding_box'; import { nodeTypes } from '../../node_types'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/geo_polygon.js b/packages/kbn-es-query/src/kuery/functions/__tests__/geo_polygon.js index 7f01b84eef93..1c6a2e0e47fd 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/geo_polygon.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/geo_polygon.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as geoPolygon from '../geo_polygon'; import { nodeTypes } from '../../node_types'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/is.js b/packages/kbn-es-query/src/kuery/functions/__tests__/is.js index 5018b18c2e8c..7ceac9b605db 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/is.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/is.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as is from '../is'; import { nodeTypes } from '../../node_types'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/not.js b/packages/kbn-es-query/src/kuery/functions/__tests__/not.js index f397382b543e..6b5b50e15524 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/not.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/not.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as not from '../not'; import { nodeTypes } from '../../node_types'; import * as ast from '../../ast'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/or.js b/packages/kbn-es-query/src/kuery/functions/__tests__/or.js index 49a2b21446b0..3b5bf27f2d8c 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/or.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/or.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as or from '../or'; import { nodeTypes } from '../../node_types'; import * as ast from '../../ast'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/range.js b/packages/kbn-es-query/src/kuery/functions/__tests__/range.js index 92108a8fb867..a8c0b8157405 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/range.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/range.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as range from '../range'; import { nodeTypes } from '../../node_types'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/functions/__tests__/utils/get_fields.js b/packages/kbn-es-query/src/kuery/functions/__tests__/utils/get_fields.js index 501f61a92b5e..7718479130a8 100644 --- a/packages/kbn-es-query/src/kuery/functions/__tests__/utils/get_fields.js +++ b/packages/kbn-es-query/src/kuery/functions/__tests__/utils/get_fields.js @@ -18,7 +18,7 @@ */ import { getFields } from '../../utils/get_fields'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import indexPatternResponse from '../../../../__fixtures__/index_pattern_response.json'; import { nodeTypes } from '../../..'; diff --git a/packages/kbn-es-query/src/kuery/node_types/__tests__/function.js b/packages/kbn-es-query/src/kuery/node_types/__tests__/function.js index 4e7e1d925436..2ccb3bd5991d 100644 --- a/packages/kbn-es-query/src/kuery/node_types/__tests__/function.js +++ b/packages/kbn-es-query/src/kuery/node_types/__tests__/function.js @@ -19,7 +19,7 @@ import * as functionType from '../function'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as isFunction from '../../functions/is'; import indexPatternResponse from '../../../__fixtures__/index_pattern_response.json'; diff --git a/packages/kbn-es-query/src/kuery/node_types/__tests__/literal.js b/packages/kbn-es-query/src/kuery/node_types/__tests__/literal.js index 570e21dbf389..25fe2bcc45a4 100644 --- a/packages/kbn-es-query/src/kuery/node_types/__tests__/literal.js +++ b/packages/kbn-es-query/src/kuery/node_types/__tests__/literal.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as literal from '../literal'; describe('kuery node types', function () { diff --git a/packages/kbn-es-query/src/kuery/node_types/__tests__/named_arg.js b/packages/kbn-es-query/src/kuery/node_types/__tests__/named_arg.js index 6a7d8cb3abb8..cfb8f6d5274d 100644 --- a/packages/kbn-es-query/src/kuery/node_types/__tests__/named_arg.js +++ b/packages/kbn-es-query/src/kuery/node_types/__tests__/named_arg.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as namedArg from '../named_arg'; import { nodeTypes } from '../../node_types'; diff --git a/packages/kbn-es-query/src/kuery/node_types/__tests__/wildcard.js b/packages/kbn-es-query/src/kuery/node_types/__tests__/wildcard.js index f9ad1bf1dccb..0c4379378c6d 100644 --- a/packages/kbn-es-query/src/kuery/node_types/__tests__/wildcard.js +++ b/packages/kbn-es-query/src/kuery/node_types/__tests__/wildcard.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as wildcard from '../wildcard'; describe('kuery node types', function () { diff --git a/packages/kbn-eslint-plugin-eslint/index.js b/packages/kbn-eslint-plugin-eslint/index.js index 70b42d92d4b7..2840986ddf17 100644 --- a/packages/kbn-eslint-plugin-eslint/index.js +++ b/packages/kbn-eslint-plugin-eslint/index.js @@ -22,5 +22,6 @@ module.exports = { 'require-license-header': require('./rules/require_license_header'), 'disallow-license-headers': require('./rules/disallow_license_headers'), 'no-default-export': require('./rules/no_default_export'), + module_migration: require('./rules/module_migration'), }, }; diff --git a/packages/kbn-eslint-plugin-eslint/rules/module_migration.js b/packages/kbn-eslint-plugin-eslint/rules/module_migration.js new file mode 100644 index 000000000000..4f4f1b0f31c9 --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/module_migration.js @@ -0,0 +1,82 @@ +/* + * 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. + */ + +function checkModuleNameNode(context, mappings, node) { + const mapping = mappings.find( + mapping => mapping.from === node.value || mapping.from.startsWith(node.value + '/') + ); + + if (!mapping) { + return; + } + + const newSource = node.value.replace(mapping.from, mapping.to); + context.report({ + message: `Imported module "${node.value}" should be "${newSource}"`, + loc: node.loc, + fix(fixer) { + return fixer.replaceText(node, `'${newSource}'`); + }, + }); +} + +module.exports = { + meta: { + fixable: 'code', + schema: [ + { + type: 'array', + items: { + type: 'object', + properties: { + from: { + type: 'string', + }, + to: { + type: 'string', + }, + }, + required: ['from', 'to'], + additionalProperties: false, + }, + default: [], + minItems: 1, + }, + ], + }, + create: context => { + const mappings = context.options[0]; + + return { + ImportDeclaration(node) { + checkModuleNameNode(context, mappings, node.source); + }, + CallExpression(node) { + if ( + node.callee.type === 'Identifier' && + node.callee.name === 'require' && + node.arguments.length === 1 && + node.arguments[0].type === 'Literal' + ) { + checkModuleNameNode(context, mappings, node.arguments[0]); + } + }, + }; + }, +}; diff --git a/packages/kbn-expect/LICENSE.txt b/packages/kbn-expect/LICENSE.txt new file mode 100644 index 000000000000..0f4acd44d765 --- /dev/null +++ b/packages/kbn-expect/LICENSE.txt @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011 Guillermo Rauch + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/kbn-expect/README.md b/packages/kbn-expect/README.md new file mode 100644 index 000000000000..51cf5bcf2ee5 --- /dev/null +++ b/packages/kbn-expect/README.md @@ -0,0 +1,191 @@ +> NOTE: This is a local fork of https://github.com/Automattic/expect.js + +# @kbn/expect + +Minimalistic BDD assertion toolkit based on +[should.js](http://github.com/visionmedia/should.js) + +```js +expect(window.r).to.be(undefined); +expect({ a: 'b' }).to.eql({ a: 'b' }) +expect(5).to.be.a('number'); +expect([]).to.be.an('array'); +expect(window).not.to.be.an(Image); +``` + +## Features + +- Cross-browser: works on IE6+, Firefox, Safari, Chrome, Opera. +- Compatible with all test frameworks. +- Node.JS ready (`require('@kbn/expect')`). + +## API + +**ok**: asserts that the value is _truthy_ or not + +```js +expect(1).to.be.ok(); +expect(true).to.be.ok(); +expect({}).to.be.ok(); +expect(0).to.not.be.ok(); +``` + +**be** / **equal**: asserts `===` equality + +```js +expect(1).to.be(1) +expect(NaN).not.to.equal(NaN); +expect(1).not.to.be(true) +expect('1').to.not.be(1); +``` + +**eql**: asserts loose equality that works with objects + +```js +expect({ a: 'b' }).to.eql({ a: 'b' }); +expect(1).to.eql('1'); +``` + +**a**/**an**: asserts `typeof` with support for `array` type and `instanceof` + +```js +// typeof with optional `array` +expect(5).to.be.a('number'); +expect([]).to.be.an('array'); // works +expect([]).to.be.an('object'); // works too, since it uses `typeof` + +// constructors +expect([]).to.be.an(Array); +expect(tobi).to.be.a(Ferret); +expect(person).to.be.a(Mammal); +``` + +**match**: asserts `String` regular expression match + +```js +expect(program.version).to.match(/[0-9]+\.[0-9]+\.[0-9]+/); +``` + +**contain**: asserts indexOf for an array or string + +```js +expect([1, 2]).to.contain(1); +expect('hello world').to.contain('world'); +``` + +**length**: asserts array `.length` + +```js +expect([]).to.have.length(0); +expect([1,2,3]).to.have.length(3); +``` + +**empty**: asserts that an array is empty or not + +```js +expect([]).to.be.empty(); +expect({}).to.be.empty(); +expect({ length: 0, duck: 'typing' }).to.be.empty(); +expect({ my: 'object' }).to.not.be.empty(); +expect([1,2,3]).to.not.be.empty(); +``` + +**property**: asserts presence of an own property (and value optionally) + +```js +expect(window).to.have.property('expect') +expect(window).to.have.property('expect', expect) +expect({a: 'b'}).to.have.property('a'); +``` + +**key**/**keys**: asserts the presence of a key. Supports the `only` modifier + +```js +expect({ a: 'b' }).to.have.key('a'); +expect({ a: 'b', c: 'd' }).to.only.have.keys('a', 'c'); +expect({ a: 'b', c: 'd' }).to.only.have.keys(['a', 'c']); +expect({ a: 'b', c: 'd' }).to.not.only.have.key('a'); +``` + +**throw**/**throwException**/**throwError**: asserts that the `Function` throws or not when called + +```js +expect(fn).to.throw(); // synonym of throwException +expect(fn).to.throwError(); // synonym of throwException +expect(fn).to.throwException(function (e) { // get the exception object + expect(e).to.be.a(SyntaxError); +}); +expect(fn).to.throwException(/matches the exception message/); +expect(fn2).to.not.throwException(); +``` + +**withArgs**: creates anonymous function to call fn with arguments + +```js +expect(fn).withArgs(invalid, arg).to.throwException(); +expect(fn).withArgs(valid, arg).to.not.throwException(); +``` + +**within**: asserts a number within a range + +```js +expect(1).to.be.within(0, Infinity); +``` + +**greaterThan**/**above**: asserts `>` + +```js +expect(3).to.be.above(0); +expect(5).to.be.greaterThan(3); +``` + +**lessThan**/**below**: asserts `<` + +```js +expect(0).to.be.below(3); +expect(1).to.be.lessThan(3); +``` + +**fail**: explicitly forces failure. + +```js +expect().fail() +expect().fail("Custom failure message") +``` + +## Using with a test framework + +For example, if you create a test suite with +[mocha](http://github.com/visionmedia/mocha). + +Let's say we wanted to test the following program: + +**math.js** + +```js +function add (a, b) { return a + b; }; +``` + +Our test file would look like this: + +```js +describe('test suite', function () { + it('should expose a function', function () { + expect(add).to.be.a('function'); + }); + + it('should do math', function () { + expect(add(1, 3)).to.equal(4); + }); +}); +``` + +If a certain expectation fails, an exception will be raised which gets captured +and shown/processed by the test runner. + +## Differences with should.js + +- No need for static `should` methods like `should.strictEqual`. For example, + `expect(obj).to.be(undefined)` works well. +- Some API simplifications / changes. +- API changes related to browser compatibility. diff --git a/packages/kbn-expect/expect.js b/packages/kbn-expect/expect.js new file mode 100644 index 000000000000..8dc8af4cab89 --- /dev/null +++ b/packages/kbn-expect/expect.js @@ -0,0 +1,971 @@ +/* eslint-disable */ + +var exports = module.exports; + +/** + * Exports. + */ + +module.exports = expect; +expect.Assertion = Assertion; + +/** + * Exports version. + */ + +expect.version = '0.3.1'; + +/** + * Possible assertion flags. + */ + +var flags = { + not: ['to', 'be', 'have', 'include', 'only'] + , to: ['be', 'have', 'include', 'only', 'not'] + , only: ['have'] + , have: ['own'] + , be: ['an'] +}; + +function expect (obj) { + return new Assertion(obj); +} + +/** + * Constructor + * + * @api private + */ + +function Assertion (obj, flag, parent) { + this.obj = obj; + this.flags = {}; + + if (undefined != parent) { + this.flags[flag] = true; + + for (var i in parent.flags) { + if (parent.flags.hasOwnProperty(i)) { + this.flags[i] = true; + } + } + } + + var $flags = flag ? flags[flag] : keys(flags) + , self = this; + + if ($flags) { + for (var i = 0, l = $flags.length; i < l; i++) { + // avoid recursion + if (this.flags[$flags[i]]) continue; + + var name = $flags[i] + , assertion = new Assertion(this.obj, name, this) + + if ('function' == typeof Assertion.prototype[name]) { + // clone the function, make sure we dont touch the prot reference + var old = this[name]; + this[name] = function () { + return old.apply(self, arguments); + }; + + for (var fn in Assertion.prototype) { + if (Assertion.prototype.hasOwnProperty(fn) && fn != name) { + if (typeof this[name] === 'function' && fn === 'length') { + continue; + } + + this[name][fn] = bind(assertion[fn], assertion); + } + } + } else { + this[name] = assertion; + } + } + } +} + +/** + * Performs an assertion + * + * @api private + */ + +Assertion.prototype.assert = function (truth, msg, error, expected) { + var msg = this.flags.not ? error : msg + , ok = this.flags.not ? !truth : truth + , err; + + if (!ok) { + err = new Error(msg.call(this)); + if (arguments.length > 3) { + err.actual = this.obj; + err.expected = expected; + err.showDiff = true; + } + throw err; + } + + this.and = new Assertion(this.obj); +}; + +/** + * Check if the value is truthy + * + * @api public + */ + +Assertion.prototype.ok = function () { + this.assert( + !!this.obj + , function(){ return 'expected ' + i(this.obj) + ' to be truthy' } + , function(){ return 'expected ' + i(this.obj) + ' to be falsy' }); +}; + +/** + * Creates an anonymous function which calls fn with arguments. + * + * @api public + */ + +Assertion.prototype.withArgs = function() { + expect(this.obj).to.be.a('function'); + var fn = this.obj; + var args = Array.prototype.slice.call(arguments); + return expect(function() { fn.apply(null, args); }); +}; + +/** + * Assert that the function throws. + * + * @param {Function|RegExp} callback, or regexp to match error string against + * @api public + */ + +Assertion.prototype['throw'] = +Assertion.prototype.throwError = +Assertion.prototype.throwException = function (fn) { + expect(this.obj).to.be.a('function'); + + var thrown = false + , not = this.flags.not; + + try { + this.obj(); + } catch (e) { + if (isRegExp(fn)) { + var subject = 'string' == typeof e ? e : e.message; + if (not) { + expect(subject).to.not.match(fn); + } else { + expect(subject).to.match(fn); + } + } else if ('function' == typeof fn) { + fn(e); + } + thrown = true; + } + + if (isRegExp(fn) && not) { + // in the presence of a matcher, ensure the `not` only applies to + // the matching. + this.flags.not = false; + } + + var name = this.obj.name || 'fn'; + this.assert( + thrown + , function(){ return 'expected ' + name + ' to throw an exception' } + , function(){ return 'expected ' + name + ' not to throw an exception' }); +}; + +/** + * Checks if the array is empty. + * + * @api public + */ + +Assertion.prototype.empty = function () { + var expectation; + + if ('object' == typeof this.obj && null !== this.obj && !isArray(this.obj)) { + if ('number' == typeof this.obj.length) { + expectation = !this.obj.length; + } else { + expectation = !keys(this.obj).length; + } + } else { + if ('string' != typeof this.obj) { + expect(this.obj).to.be.an('object'); + } + + expect(this.obj).to.have.property('length'); + expectation = !this.obj.length; + } + + this.assert( + expectation + , function(){ return 'expected ' + i(this.obj) + ' to be empty' } + , function(){ return 'expected ' + i(this.obj) + ' to not be empty' }); + return this; +}; + +/** + * Checks if the obj exactly equals another. + * + * @api public + */ + +Assertion.prototype.be = +Assertion.prototype.equal = function (obj) { + this.assert( + obj === this.obj + , function(){ return 'expected ' + i(this.obj) + ' to equal ' + i(obj) } + , function(){ return 'expected ' + i(this.obj) + ' to not equal ' + i(obj) }); + return this; +}; + +/** + * Checks if the obj sortof equals another. + * + * @api public + */ + +Assertion.prototype.eql = function (obj) { + this.assert( + expect.eql(this.obj, obj) + , function(){ return 'expected ' + i(this.obj) + ' to sort of equal ' + i(obj) } + , function(){ return 'expected ' + i(this.obj) + ' to sort of not equal ' + i(obj) } + , obj); + return this; +}; + +/** + * Assert within start to finish (inclusive). + * + * @param {Number} start + * @param {Number} finish + * @api public + */ + +Assertion.prototype.within = function (start, finish) { + var range = start + '..' + finish; + this.assert( + this.obj >= start && this.obj <= finish + , function(){ return 'expected ' + i(this.obj) + ' to be within ' + range } + , function(){ return 'expected ' + i(this.obj) + ' to not be within ' + range }); + return this; +}; + +/** + * Assert typeof / instance of + * + * @api public + */ + +Assertion.prototype.a = +Assertion.prototype.an = function (type) { + if ('string' == typeof type) { + // proper english in error msg + var n = /^[aeiou]/.test(type) ? 'n' : ''; + + // typeof with support for 'array' + this.assert( + 'array' == type ? isArray(this.obj) : + 'regexp' == type ? isRegExp(this.obj) : + 'object' == type + ? 'object' == typeof this.obj && null !== this.obj + : type == typeof this.obj + , function(){ return 'expected ' + i(this.obj) + ' to be a' + n + ' ' + type } + , function(){ return 'expected ' + i(this.obj) + ' not to be a' + n + ' ' + type }); + } else { + // instanceof + var name = type.name || 'supplied constructor'; + this.assert( + this.obj instanceof type + , function(){ return 'expected ' + i(this.obj) + ' to be an instance of ' + name } + , function(){ return 'expected ' + i(this.obj) + ' not to be an instance of ' + name }); + } + + return this; +}; + +/** + * Assert numeric value above _n_. + * + * @param {Number} n + * @api public + */ + +Assertion.prototype.greaterThan = +Assertion.prototype.above = function (n) { + this.assert( + this.obj > n + , function(){ return 'expected ' + i(this.obj) + ' to be above ' + n } + , function(){ return 'expected ' + i(this.obj) + ' to be below ' + n }); + return this; +}; + +/** + * Assert numeric value below _n_. + * + * @param {Number} n + * @api public + */ + +Assertion.prototype.lessThan = +Assertion.prototype.below = function (n) { + this.assert( + this.obj < n + , function(){ return 'expected ' + i(this.obj) + ' to be below ' + n } + , function(){ return 'expected ' + i(this.obj) + ' to be above ' + n }); + return this; +}; + +/** + * Assert string value matches _regexp_. + * + * @param {RegExp} regexp + * @api public + */ + +Assertion.prototype.match = function (regexp) { + this.assert( + regexp.exec(this.obj) + , function(){ return 'expected ' + i(this.obj) + ' to match ' + regexp } + , function(){ return 'expected ' + i(this.obj) + ' not to match ' + regexp }); + return this; +}; + +/** + * Assert property "length" exists and has value of _n_. + * + * @param {Number} n + * @api public + */ + +Assertion.prototype.length = function (n) { + expect(this.obj).to.have.property('length'); + var len = this.obj.length; + this.assert( + n == len + , function(){ return 'expected ' + i(this.obj) + ' to have a length of ' + n + ' but got ' + len } + , function(){ return 'expected ' + i(this.obj) + ' to not have a length of ' + len }); + return this; +}; + +/** + * Assert property _name_ exists, with optional _val_. + * + * @param {String} name + * @param {Mixed} val + * @api public + */ + +Assertion.prototype.property = function (name, val) { + if (this.flags.own) { + this.assert( + Object.prototype.hasOwnProperty.call(this.obj, name) + , function(){ return 'expected ' + i(this.obj) + ' to have own property ' + i(name) } + , function(){ return 'expected ' + i(this.obj) + ' to not have own property ' + i(name) }); + return this; + } + + if (this.flags.not && undefined !== val) { + if (undefined === this.obj[name]) { + throw new Error(i(this.obj) + ' has no property ' + i(name)); + } + } else { + var hasProp; + try { + hasProp = name in this.obj + } catch (e) { + hasProp = undefined !== this.obj[name] + } + + this.assert( + hasProp + , function(){ return 'expected ' + i(this.obj) + ' to have a property ' + i(name) } + , function(){ return 'expected ' + i(this.obj) + ' to not have a property ' + i(name) }); + } + + if (undefined !== val) { + this.assert( + val === this.obj[name] + , function(){ return 'expected ' + i(this.obj) + ' to have a property ' + i(name) + + ' of ' + i(val) + ', but got ' + i(this.obj[name]) } + , function(){ return 'expected ' + i(this.obj) + ' to not have a property ' + i(name) + + ' of ' + i(val) }); + } + + this.obj = this.obj[name]; + return this; +}; + +/** + * Assert that the array contains _obj_ or string contains _obj_. + * + * @param {Mixed} obj|string + * @api public + */ + +Assertion.prototype.string = +Assertion.prototype.contain = function (obj) { + if ('string' == typeof this.obj) { + this.assert( + ~this.obj.indexOf(obj) + , function(){ return 'expected ' + i(this.obj) + ' to contain ' + i(obj) } + , function(){ return 'expected ' + i(this.obj) + ' to not contain ' + i(obj) }); + } else { + this.assert( + ~indexOf(this.obj, obj) + , function(){ return 'expected ' + i(this.obj) + ' to contain ' + i(obj) } + , function(){ return 'expected ' + i(this.obj) + ' to not contain ' + i(obj) }); + } + return this; +}; + +/** + * Assert exact keys or inclusion of keys by using + * the `.own` modifier. + * + * @param {Array|String ...} keys + * @api public + */ + +Assertion.prototype.key = +Assertion.prototype.keys = function ($keys) { + var str + , ok = true; + + $keys = isArray($keys) + ? $keys + : Array.prototype.slice.call(arguments); + + if (!$keys.length) throw new Error('keys required'); + + var actual = keys(this.obj) + , len = $keys.length; + + // Inclusion + ok = every($keys, function (key) { + return ~indexOf(actual, key); + }); + + // Strict + if (!this.flags.not && this.flags.only) { + ok = ok && $keys.length == actual.length; + } + + // Key string + if (len > 1) { + $keys = map($keys, function (key) { + return i(key); + }); + var last = $keys.pop(); + str = $keys.join(', ') + ', and ' + last; + } else { + str = i($keys[0]); + } + + // Form + str = (len > 1 ? 'keys ' : 'key ') + str; + + // Have / include + str = (!this.flags.only ? 'include ' : 'only have ') + str; + + // Assertion + this.assert( + ok + , function(){ return 'expected ' + i(this.obj) + ' to ' + str } + , function(){ return 'expected ' + i(this.obj) + ' to not ' + str }); + + return this; +}; + +/** + * Assert a failure. + * + * @param {String ...} custom message + * @api public + */ +Assertion.prototype.fail = function (msg) { + var error = function() { return msg || "explicit failure"; } + this.assert(false, error, error); + return this; +}; + +/** + * Function bind implementation. + */ + +function bind (fn, scope) { + return function () { + return fn.apply(scope, arguments); + } +} + +/** + * Array every compatibility + * + * @see bit.ly/5Fq1N2 + * @api public + */ + +function every (arr, fn, thisObj) { + var scope = thisObj || global; + for (var i = 0, j = arr.length; i < j; ++i) { + if (!fn.call(scope, arr[i], i, arr)) { + return false; + } + } + return true; +} + +/** + * Array indexOf compatibility. + * + * @see bit.ly/a5Dxa2 + * @api public + */ + +function indexOf (arr, o, i) { + if (Array.prototype.indexOf) { + return Array.prototype.indexOf.call(arr, o, i); + } + + if (arr.length === undefined) { + return -1; + } + + for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0 + ; i < j && arr[i] !== o; i++); + + return j <= i ? -1 : i; +} + +// https://gist.github.com/1044128/ +var getOuterHTML = function(element) { + if ('outerHTML' in element) return element.outerHTML; + var ns = "http://www.w3.org/1999/xhtml"; + var container = document.createElementNS(ns, '_'); + var xmlSerializer = new XMLSerializer(); + var html; + if (document.xmlVersion) { + return xmlSerializer.serializeToString(element); + } else { + container.appendChild(element.cloneNode(false)); + html = container.innerHTML.replace('><', '>' + element.innerHTML + '<'); + container.innerHTML = ''; + return html; + } +}; + +// Returns true if object is a DOM element. +var isDOMElement = function (object) { + if (typeof HTMLElement === 'object') { + return object instanceof HTMLElement; + } else { + return object && + typeof object === 'object' && + object.nodeType === 1 && + typeof object.nodeName === 'string'; + } +}; + +/** + * Inspects an object. + * + * @see taken from node.js `util` module (copyright Joyent, MIT license) + * @api private + */ + +function i (obj, showHidden, depth) { + var seen = []; + + function stylize (str) { + return str; + } + + function format (value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (value && typeof value.inspect === 'function' && + // Filter out the util module, it's inspect function is special + value !== exports && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + return value.inspect(recurseTimes); + } + + // Primitive types cannot have properties + switch (typeof value) { + case 'undefined': + return stylize('undefined', 'undefined'); + + case 'string': + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return stylize(simple, 'string'); + + case 'number': + return stylize('' + value, 'number'); + + case 'boolean': + return stylize('' + value, 'boolean'); + } + // For some reason typeof null is "object", so special case here. + if (value === null) { + return stylize('null', 'null'); + } + + if (isDOMElement(value)) { + return getOuterHTML(value); + } + + // Look up the keys of the object. + var visible_keys = keys(value); + var $keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys; + + // Functions without properties can be shortcutted. + if (typeof value === 'function' && $keys.length === 0) { + if (isRegExp(value)) { + return stylize('' + value, 'regexp'); + } else { + var name = value.name ? ': ' + value.name : ''; + return stylize('[Function' + name + ']', 'special'); + } + } + + // Dates without properties can be shortcutted + if (isDate(value) && $keys.length === 0) { + return stylize(value.toUTCString(), 'date'); + } + + // Error objects can be shortcutted + if (value instanceof Error) { + return stylize("["+value.toString()+"]", 'Error'); + } + + var base, type, braces; + // Determine the object type + if (isArray(value)) { + type = 'Array'; + braces = ['[', ']']; + } else { + type = 'Object'; + braces = ['{', '}']; + } + + // Make functions say that they are functions + if (typeof value === 'function') { + var n = value.name ? ': ' + value.name : ''; + base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; + } else { + base = ''; + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + value.toUTCString(); + } + + if ($keys.length === 0) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return stylize('' + value, 'regexp'); + } else { + return stylize('[Object]', 'special'); + } + } + + seen.push(value); + + var output = map($keys, function (key) { + var name, str; + if (value.__lookupGetter__) { + if (value.__lookupGetter__(key)) { + if (value.__lookupSetter__(key)) { + str = stylize('[Getter/Setter]', 'special'); + } else { + str = stylize('[Getter]', 'special'); + } + } else { + if (value.__lookupSetter__(key)) { + str = stylize('[Setter]', 'special'); + } + } + } + if (indexOf(visible_keys, key) < 0) { + name = '[' + key + ']'; + } + if (!str) { + if (indexOf(seen, value[key]) < 0) { + if (recurseTimes === null) { + str = format(value[key]); + } else { + str = format(value[key], recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (isArray(value)) { + str = map(str.split('\n'), function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + map(str.split('\n'), function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = stylize('[Circular]', 'special'); + } + } + if (typeof name === 'undefined') { + if (type === 'Array' && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = stylize(name, 'string'); + } + } + + return name + ': ' + str; + }); + + seen.pop(); + + var numLinesEst = 0; + var length = reduce(output, function (prev, cur) { + numLinesEst++; + if (indexOf(cur, '\n') >= 0) numLinesEst++; + return prev + cur.length + 1; + }, 0); + + if (length > 50) { + output = braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + + } else { + output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + return output; + } + return format(obj, (typeof depth === 'undefined' ? 2 : depth)); +} + +expect.stringify = i; + +function isArray (ar) { + return Object.prototype.toString.call(ar) === '[object Array]'; +} + +function isRegExp(re) { + var s; + try { + s = '' + re; + } catch (e) { + return false; + } + + return re instanceof RegExp || // easy case + // duck-type for context-switching evalcx case + typeof(re) === 'function' && + re.constructor.name === 'RegExp' && + re.compile && + re.test && + re.exec && + s.match(/^\/.*\/[gim]{0,3}$/); +} + +function isDate(d) { + return d instanceof Date; +} + +function keys (obj) { + if (Object.keys) { + return Object.keys(obj); + } + + var keys = []; + + for (var i in obj) { + if (Object.prototype.hasOwnProperty.call(obj, i)) { + keys.push(i); + } + } + + return keys; +} + +function map (arr, mapper, that) { + if (Array.prototype.map) { + return Array.prototype.map.call(arr, mapper, that); + } + + var other= new Array(arr.length); + + for (var i= 0, n = arr.length; i= 2) { + var rv = arguments[1]; + } else { + do { + if (i in this) { + rv = this[i++]; + break; + } + + // if array contains no values, no initial value to return + if (++i >= len) + throw new TypeError(); + } while (true); + } + + for (; i < len; i++) { + if (i in this) + rv = fun.call(null, rv, this[i], i, this); + } + + return rv; +} + +/** + * Asserts deep equality + * + * @see taken from node.js `assert` module (copyright Joyent, MIT license) + * @api private + */ + +expect.eql = function eql(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if ('undefined' != typeof Buffer + && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == "object", + // equivalence is determined by ==. + } else if (typeof actual != 'object' && typeof expected != 'object') { + return actual == expected; + // If both are regular expression use the special `regExpEquiv` method + // to determine equivalence. + } else if (isRegExp(actual) && isRegExp(expected)) { + return regExpEquiv(actual, expected); + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical "prototype" property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } +}; + +function isUndefinedOrNull (value) { + return value === null || value === undefined; +} + +function isArguments (object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function regExpEquiv (a, b) { + return a.source === b.source && a.global === b.global && + a.ignoreCase === b.ignoreCase && a.multiline === b.multiline; +} + +function objEquiv (a, b) { + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical "prototype" property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return expect.eql(a, b); + } + try{ + var ka = keys(a), + kb = keys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!expect.eql(a[key], b[key])) + return false; + } + return true; +} diff --git a/packages/kbn-expect/expect.js.d.ts b/packages/kbn-expect/expect.js.d.ts new file mode 100644 index 000000000000..9e0b06949903 --- /dev/null +++ b/packages/kbn-expect/expect.js.d.ts @@ -0,0 +1,221 @@ +// tslint:disable + +// Type definitions for expect.js 0.3.1 +// Project: https://github.com/Automattic/expect.js +// Definitions by: Teppei Sato +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// License: MIT + +export default function expect(target?: any): Root; + +interface Assertion { + /** + * Assert typeof / instanceof. + */ + an: An; + /** + * Check if the value is truthy + */ + ok(): void; + + /** + * Creates an anonymous function which calls fn with arguments. + */ + withArgs(...args: any[]): Root; + + /** + * Assert that the function throws. + * + * @param fn callback to match error string against + */ + throwError(fn?: (exception: any) => void): void; + + /** + * Assert that the function throws. + * + * @param fn callback to match error string against + */ + throwException(fn?: (exception: any) => void): void; + + /** + * Assert that the function throws. + * + * @param regexp regexp to match error string against + */ + throwError(regexp: RegExp): void; + + /** + * Assert that the function throws. + * + * @param fn callback to match error string against + */ + throwException(regexp: RegExp): void; + + /** + * Checks if the array is empty. + */ + empty(): Assertion; + + /** + * Checks if the obj exactly equals another. + */ + equal(obj: any): Assertion; + + /** + * Checks if the obj sortof equals another. + */ + eql(obj: any): Assertion; + + /** + * Assert within start to finish (inclusive). + * + * @param start + * @param finish + */ + within(start: number, finish: number): Assertion; + + /** + * Assert typeof. + */ + a(type: string): Assertion; + + /** + * Assert instanceof. + */ + a(type: Function): Assertion; + + /** + * Assert numeric value above n. + */ + greaterThan(n: number): Assertion; + + /** + * Assert numeric value above n. + */ + above(n: number): Assertion; + + /** + * Assert numeric value below n. + */ + lessThan(n: number): Assertion; + + /** + * Assert numeric value below n. + */ + below(n: number): Assertion; + + /** + * Assert string value matches regexp. + * + * @param regexp + */ + match(regexp: RegExp): Assertion; + + /** + * Assert property "length" exists and has value of n. + * + * @param n + */ + length(n: number): Assertion; + + /** + * Assert property name exists, with optional val. + * + * @param name + * @param val + */ + property(name: string, val?: any): Assertion; + + /** + * Assert that string contains str. + */ + contain(str: string): Assertion; + string(str: string): Assertion; + + /** + * Assert that the array contains obj. + */ + contain(obj: any): Assertion; + string(obj: any): Assertion; + + /** + * Assert exact keys or inclusion of keys by using the `.own` modifier. + */ + key(keys: string[]): Assertion; + /** + * Assert exact keys or inclusion of keys by using the `.own` modifier. + */ + key(...keys: string[]): Assertion; + /** + * Assert exact keys or inclusion of keys by using the `.own` modifier. + */ + keys(keys: string[]): Assertion; + /** + * Assert exact keys or inclusion of keys by using the `.own` modifier. + */ + keys(...keys: string[]): Assertion; + + /** + * Assert a failure. + */ + fail(message?: string): Assertion; +} + +interface Root extends Assertion { + not: Not; + to: To; + only: Only; + have: Have; + be: Be; +} + +interface Be extends Assertion { + /** + * Checks if the obj exactly equals another. + */ + (obj: any): Assertion; + + an: An; +} + +interface An extends Assertion { + /** + * Assert typeof. + */ + (type: string): Assertion; + + /** + * Assert instanceof. + */ + (type: Function): Assertion; +} + +interface Not extends NotBase { + to: ToBase; +} + +interface NotBase extends Assertion { + be: Be; + have: Have; + include: Assertion; + only: Only; +} + +interface To extends ToBase { + not: NotBase; +} + +interface ToBase extends Assertion { + be: Be; + have: Have; + include: Assertion; + only: Only; +} + +interface Only extends Assertion { + have: Have; +} + +interface Have extends Assertion { + own: Assertion; +} diff --git a/packages/kbn-expect/package.json b/packages/kbn-expect/package.json new file mode 100644 index 000000000000..0975f5762fa1 --- /dev/null +++ b/packages/kbn-expect/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/expect", + "main": "./expect.js", + "version": "1.0.0", + "license": "MIT", + "private": true +} diff --git a/packages/kbn-expect/tsconfig.json b/packages/kbn-expect/tsconfig.json new file mode 100644 index 000000000000..a09ae2d7ae64 --- /dev/null +++ b/packages/kbn-expect/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + "expect.js.d.ts" + ] +} diff --git a/packages/kbn-plugin-generator/sao_template/template/package_template.json b/packages/kbn-plugin-generator/sao_template/template/package_template.json index a3641c9c1a94..80e6ae8642e1 100644 --- a/packages/kbn-plugin-generator/sao_template/template/package_template.json +++ b/packages/kbn-plugin-generator/sao_template/template/package_template.json @@ -25,6 +25,7 @@ "devDependencies": { "@elastic/eslint-config-kibana": "link:../../kibana/packages/eslint-config-kibana", "@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana", + "@kbn/expect": "1.0.0", "@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers", "babel-eslint": "^9.0.0", "eslint": "^5.6.0", @@ -35,7 +36,6 @@ "eslint-plugin-mocha": "^5.2.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1", - "expect.js": "^0.3.1" + "eslint-plugin-react": "^7.11.1" } } diff --git a/packages/kbn-plugin-generator/sao_template/template/public/__tests__/index.js b/packages/kbn-plugin-generator/sao_template/template/public/__tests__/index.js index f1e0ae8fb6f3..9320bd7b028a 100755 --- a/packages/kbn-plugin-generator/sao_template/template/public/__tests__/index.js +++ b/packages/kbn-plugin-generator/sao_template/template/public/__tests__/index.js @@ -1,4 +1,4 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('suite', () => { it('is a test', () => { diff --git a/packages/kbn-plugin-generator/sao_template/template/server/__tests__/index.js b/packages/kbn-plugin-generator/sao_template/template/server/__tests__/index.js index f1e0ae8fb6f3..9320bd7b028a 100755 --- a/packages/kbn-plugin-generator/sao_template/template/server/__tests__/index.js +++ b/packages/kbn-plugin-generator/sao_template/template/server/__tests__/index.js @@ -1,4 +1,4 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('suite', () => { it('is a test', () => { diff --git a/packages/kbn-test-subj-selector/package.json b/packages/kbn-test-subj-selector/package.json index 83291dc059b9..f93245fd0884 100755 --- a/packages/kbn-test-subj-selector/package.json +++ b/packages/kbn-test-subj-selector/package.json @@ -10,7 +10,7 @@ "author": "Spencer Alger ", "license": "Apache-2.0", "devDependencies": { - "expect.js": "^0.3.1", + "@kbn/expect": "1.0.0", "mocha": "^2.3.4" } } diff --git a/packages/kbn-test-subj-selector/test/index.js b/packages/kbn-test-subj-selector/test/index.js index 1c0df4d3149f..c5a3826d1947 100755 --- a/packages/kbn-test-subj-selector/test/index.js +++ b/packages/kbn-test-subj-selector/test/index.js @@ -18,7 +18,7 @@ */ const testSubjSelector = require('../'); -const expect = require('expect.js'); +const expect = require('@kbn/expect'); describe('testSubjSelector()', function() { it('converts subjectSelectors to cssSelectors', function() { diff --git a/packages/kbn-test/types/README.md b/packages/kbn-test/types/README.md index 5e4b2c6da614..1298d2a4afc0 100644 --- a/packages/kbn-test/types/README.md +++ b/packages/kbn-test/types/README.md @@ -2,5 +2,4 @@ Shared types used by different parts of the tests - - **`expect.js.d.ts`**: This is a fork of the expect.js types that have been slightly modified to only expose a module type for `import expect from 'expect.js'` statements. The `@types/expect.js` includes types for the `expect` global, which is useful for some uses of the library but conflicts with the jest types we use. Making the type "module only" prevents them from conflicting. - **`ftr.d.ts`**: These types are generic types for using the functional test runner. They are here because we plan to move the functional test runner into the `@kbn/test` package at some point and having them here makes them a lot easier to import from all over the place like we do. \ No newline at end of file diff --git a/packages/kbn-test/types/expect.js.d.ts b/packages/kbn-test/types/expect.js.d.ts deleted file mode 100644 index fd3cbd852f96..000000000000 --- a/packages/kbn-test/types/expect.js.d.ts +++ /dev/null @@ -1,225 +0,0 @@ -// tslint:disable - -// Type definitions for expect.js 0.3.1 -// Project: https://github.com/Automattic/expect.js -// Definitions by: Teppei Sato -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// License: MIT - -declare module 'expect.js' { - function expect(target?: any): Root; - - interface Assertion { - /** - * Assert typeof / instanceof. - */ - an: An; - /** - * Check if the value is truthy - */ - ok(): void; - - /** - * Creates an anonymous function which calls fn with arguments. - */ - withArgs(...args: any[]): Root; - - /** - * Assert that the function throws. - * - * @param fn callback to match error string against - */ - throwError(fn?: (exception: any) => void): void; - - /** - * Assert that the function throws. - * - * @param fn callback to match error string against - */ - throwException(fn?: (exception: any) => void): void; - - /** - * Assert that the function throws. - * - * @param regexp regexp to match error string against - */ - throwError(regexp: RegExp): void; - - /** - * Assert that the function throws. - * - * @param fn callback to match error string against - */ - throwException(regexp: RegExp): void; - - /** - * Checks if the array is empty. - */ - empty(): Assertion; - - /** - * Checks if the obj exactly equals another. - */ - equal(obj: any): Assertion; - - /** - * Checks if the obj sortof equals another. - */ - eql(obj: any): Assertion; - - /** - * Assert within start to finish (inclusive). - * - * @param start - * @param finish - */ - within(start: number, finish: number): Assertion; - - /** - * Assert typeof. - */ - a(type: string): Assertion; - - /** - * Assert instanceof. - */ - a(type: Function): Assertion; - - /** - * Assert numeric value above n. - */ - greaterThan(n: number): Assertion; - - /** - * Assert numeric value above n. - */ - above(n: number): Assertion; - - /** - * Assert numeric value below n. - */ - lessThan(n: number): Assertion; - - /** - * Assert numeric value below n. - */ - below(n: number): Assertion; - - /** - * Assert string value matches regexp. - * - * @param regexp - */ - match(regexp: RegExp): Assertion; - - /** - * Assert property "length" exists and has value of n. - * - * @param n - */ - length(n: number): Assertion; - - /** - * Assert property name exists, with optional val. - * - * @param name - * @param val - */ - property(name: string, val?: any): Assertion; - - /** - * Assert that string contains str. - */ - contain(str: string): Assertion; - string(str: string): Assertion; - - /** - * Assert that the array contains obj. - */ - contain(obj: any): Assertion; - string(obj: any): Assertion; - - /** - * Assert exact keys or inclusion of keys by using the `.own` modifier. - */ - key(keys: string[]): Assertion; - /** - * Assert exact keys or inclusion of keys by using the `.own` modifier. - */ - key(...keys: string[]): Assertion; - /** - * Assert exact keys or inclusion of keys by using the `.own` modifier. - */ - keys(keys: string[]): Assertion; - /** - * Assert exact keys or inclusion of keys by using the `.own` modifier. - */ - keys(...keys: string[]): Assertion; - - /** - * Assert a failure. - */ - fail(message?: string): Assertion; - } - - interface Root extends Assertion { - not: Not; - to: To; - only: Only; - have: Have; - be: Be; - } - - interface Be extends Assertion { - /** - * Checks if the obj exactly equals another. - */ - (obj: any): Assertion; - - an: An; - } - - interface An extends Assertion { - /** - * Assert typeof. - */ - (type: string): Assertion; - - /** - * Assert instanceof. - */ - (type: Function): Assertion; - } - - interface Not extends NotBase { - to: ToBase; - } - - interface NotBase extends Assertion { - be: Be; - have: Have; - include: Assertion; - only: Only; - } - - interface To extends ToBase { - not: NotBase; - } - - interface ToBase extends Assertion { - be: Be; - have: Have; - include: Assertion; - only: Only; - } - - interface Only extends Assertion { - have: Have; - } - - interface Have extends Assertion { - own: Assertion; - } - - export default expect; -} diff --git a/src/dev/__tests__/file.js b/src/dev/__tests__/file.js index 36fe23a81bab..0e8790f32c7c 100644 --- a/src/dev/__tests__/file.js +++ b/src/dev/__tests__/file.js @@ -19,7 +19,7 @@ import { resolve, sep } from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { File } from '../file'; diff --git a/src/dev/__tests__/node_versions_must_match.js b/src/dev/__tests__/node_versions_must_match.js index e01d93f51284..99f2e255f47e 100644 --- a/src/dev/__tests__/node_versions_must_match.js +++ b/src/dev/__tests__/node_versions_must_match.js @@ -21,7 +21,7 @@ import fs from 'fs'; import { engines } from '../../../package.json'; import { promisify } from 'util'; const readFile = promisify(fs.readFile); -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('All configs should use a single version of Node', () => { it('should compare .node-version and .nvmrc', async () => { diff --git a/src/dev/build/lib/__tests__/build.js b/src/dev/build/lib/__tests__/build.js index 466abd67f0cd..28a96c210843 100644 --- a/src/dev/build/lib/__tests__/build.js +++ b/src/dev/build/lib/__tests__/build.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { createBuild } from '../build'; diff --git a/src/dev/build/lib/__tests__/config.js b/src/dev/build/lib/__tests__/config.js index 6b395ce137e6..2bb0f349715a 100644 --- a/src/dev/build/lib/__tests__/config.js +++ b/src/dev/build/lib/__tests__/config.js @@ -19,7 +19,7 @@ import { resolve } from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import pkg from '../../../../../package.json'; import { getConfig } from '../config'; diff --git a/src/dev/build/lib/__tests__/errors.js b/src/dev/build/lib/__tests__/errors.js index 7edc6244f8fe..dc23b3e372bc 100644 --- a/src/dev/build/lib/__tests__/errors.js +++ b/src/dev/build/lib/__tests__/errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isErrorLogged, markErrorLogged } from '../errors'; diff --git a/src/dev/build/lib/__tests__/fs.js b/src/dev/build/lib/__tests__/fs.js index 3c0c51534203..a4e2a5f44475 100644 --- a/src/dev/build/lib/__tests__/fs.js +++ b/src/dev/build/lib/__tests__/fs.js @@ -21,7 +21,7 @@ import { resolve } from 'path'; import { chmodSync, statSync } from 'fs'; import del from 'del'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { mkdirp, write, read, getChildPaths, copy, copyAll, getFileHash, untar } from '../fs'; diff --git a/src/dev/build/lib/__tests__/platform.js b/src/dev/build/lib/__tests__/platform.js index 91aef80d0e83..86ef1749feca 100644 --- a/src/dev/build/lib/__tests__/platform.js +++ b/src/dev/build/lib/__tests__/platform.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createPlatform } from '../platform'; diff --git a/src/dev/build/lib/__tests__/runner.js b/src/dev/build/lib/__tests__/runner.js index c41d1fb6a8d2..07d484f72f18 100644 --- a/src/dev/build/lib/__tests__/runner.js +++ b/src/dev/build/lib/__tests__/runner.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ToolingLog } from '@kbn/dev-utils'; import { createRunner } from '../runner'; diff --git a/src/dev/build/lib/__tests__/version_info.js b/src/dev/build/lib/__tests__/version_info.js index 1ec4eb5c5174..517a6cc494cf 100644 --- a/src/dev/build/lib/__tests__/version_info.js +++ b/src/dev/build/lib/__tests__/version_info.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import pkg from '../../../../../package.json'; import { getVersionInfo } from '../version_info'; diff --git a/src/dev/build/tasks/nodejs/__tests__/download.js b/src/dev/build/tasks/nodejs/__tests__/download.js index a3514d3254cc..0007e9ae9df5 100644 --- a/src/dev/build/tasks/nodejs/__tests__/download.js +++ b/src/dev/build/tasks/nodejs/__tests__/download.js @@ -23,7 +23,7 @@ import { readFileSync } from 'fs'; import del from 'del'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Wreck from 'wreck'; import { ToolingLog } from '@kbn/dev-utils'; diff --git a/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js b/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js index 191ca47e1256..0206680b4d9f 100644 --- a/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js +++ b/src/dev/build/tasks/nodejs/__tests__/download_node_builds_task.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as NodeShasumsNS from '../node_shasums'; import * as NodeDownloadInfoNS from '../node_download_info'; diff --git a/src/dev/build/tasks/nodejs/__tests__/node_shasums.js b/src/dev/build/tasks/nodejs/__tests__/node_shasums.js index 61fd8f640056..3e400283dbd8 100644 --- a/src/dev/build/tasks/nodejs/__tests__/node_shasums.js +++ b/src/dev/build/tasks/nodejs/__tests__/node_shasums.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getNodeShasums } from '../node_shasums'; diff --git a/src/dev/build/tasks/nodejs/__tests__/verify_existing_node_builds_task.js b/src/dev/build/tasks/nodejs/__tests__/verify_existing_node_builds_task.js index 3cf75216d286..fa6ae4675229 100644 --- a/src/dev/build/tasks/nodejs/__tests__/verify_existing_node_builds_task.js +++ b/src/dev/build/tasks/nodejs/__tests__/verify_existing_node_builds_task.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as NodeShasumsNS from '../node_shasums'; import * as NodeDownloadInfoNS from '../node_download_info'; diff --git a/src/dev/license_checker/__tests__/valid.js b/src/dev/license_checker/__tests__/valid.js index bb608e33d52a..04c9347bc74e 100644 --- a/src/dev/license_checker/__tests__/valid.js +++ b/src/dev/license_checker/__tests__/valid.js @@ -19,7 +19,7 @@ import { resolve } from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { assertLicensesValid } from '../valid'; diff --git a/src/dev/mocha/__tests__/junit_report_generation.js b/src/dev/mocha/__tests__/junit_report_generation.js index 7142a14b662e..f7631e972ad1 100644 --- a/src/dev/mocha/__tests__/junit_report_generation.js +++ b/src/dev/mocha/__tests__/junit_report_generation.js @@ -24,7 +24,7 @@ import { fromNode as fcb } from 'bluebird'; import { parseString } from 'xml2js'; import del from 'del'; import Mocha from 'mocha'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { setupJUnitReportGeneration } from '../junit_report_generation'; diff --git a/src/dev/npm/__tests__/installed_packages.js b/src/dev/npm/__tests__/installed_packages.js index 70ccf1916c75..24bad227cbbd 100644 --- a/src/dev/npm/__tests__/installed_packages.js +++ b/src/dev/npm/__tests__/installed_packages.js @@ -20,7 +20,7 @@ import { resolve, sep } from 'path'; import { uniq } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getInstalledPackages } from '../installed_packages'; diff --git a/src/dev/tslint/rules/moduleMigrationRule.js b/src/dev/tslint/rules/moduleMigrationRule.js new file mode 100644 index 000000000000..be79664e889c --- /dev/null +++ b/src/dev/tslint/rules/moduleMigrationRule.js @@ -0,0 +1,59 @@ +/* + * 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. + */ + +const Lint = require('tslint'); + +class ModuleMigrationWalker extends Lint.RuleWalker { + visitImportDeclaration(node) { + + const moduleId = node.moduleSpecifier.text; + const mapping = this.options.find( + mapping => mapping.from === moduleId || mapping.from.startsWith(moduleId + '/') + ); + + if (!mapping) { + return; + } + + const newSource = moduleId.replace(mapping.from, mapping.to); + const start = node.moduleSpecifier.getStart(); + const width = node.moduleSpecifier.getWidth(); + + this.addFailure( + this.createFailure( + start, + width, + `Imported module "${moduleId}" should be "${newSource}"`, + this.createReplacement( + start, + width, + `'${newSource}'` + ) + ) + ); + + super.visitImportDeclaration(node); + } +} + +exports.Rule = class extends Lint.Rules.AbstractRule { + apply(sourceFile) { + return this.applyWithWalker(new ModuleMigrationWalker(sourceFile, this.getOptions())); + } +}; diff --git a/src/es_archiver/lib/__tests__/stats.js b/src/es_archiver/lib/__tests__/stats.js index eb7d9f09f858..38febda53dbe 100644 --- a/src/es_archiver/lib/__tests__/stats.js +++ b/src/es_archiver/lib/__tests__/stats.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { uniq } from 'lodash'; import sinon from 'sinon'; diff --git a/src/es_archiver/lib/archives/__tests__/format.js b/src/es_archiver/lib/archives/__tests__/format.js index 53da1718c892..d537245c44fc 100644 --- a/src/es_archiver/lib/archives/__tests__/format.js +++ b/src/es_archiver/lib/archives/__tests__/format.js @@ -20,7 +20,7 @@ import Stream from 'stream'; import { createGunzip } from 'zlib'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createListStream, diff --git a/src/es_archiver/lib/archives/__tests__/parse.js b/src/es_archiver/lib/archives/__tests__/parse.js index 6645df47fc60..2a525e76d98e 100644 --- a/src/es_archiver/lib/archives/__tests__/parse.js +++ b/src/es_archiver/lib/archives/__tests__/parse.js @@ -20,7 +20,7 @@ import Stream, { PassThrough, Transform } from 'stream'; import { createGzip } from 'zlib'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createConcatStream, diff --git a/src/es_archiver/lib/docs/__tests__/generate_doc_records_stream.js b/src/es_archiver/lib/docs/__tests__/generate_doc_records_stream.js index d9eb99d39f87..b4f221ea0432 100644 --- a/src/es_archiver/lib/docs/__tests__/generate_doc_records_stream.js +++ b/src/es_archiver/lib/docs/__tests__/generate_doc_records_stream.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { delay } from 'bluebird'; import { diff --git a/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js b/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js index cdb2925e0eea..a0ab1430417f 100644 --- a/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js +++ b/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { delay } from 'bluebird'; import { diff --git a/src/es_archiver/lib/indices/__tests__/create_index_stream.js b/src/es_archiver/lib/indices/__tests__/create_index_stream.js index e705b0065427..830512f3476e 100644 --- a/src/es_archiver/lib/indices/__tests__/create_index_stream.js +++ b/src/es_archiver/lib/indices/__tests__/create_index_stream.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import Chance from 'chance'; diff --git a/src/es_archiver/lib/indices/__tests__/generate_index_records_stream.js b/src/es_archiver/lib/indices/__tests__/generate_index_records_stream.js index 115e7a97f064..3ff30c0267da 100644 --- a/src/es_archiver/lib/indices/__tests__/generate_index_records_stream.js +++ b/src/es_archiver/lib/indices/__tests__/generate_index_records_stream.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createListStream, diff --git a/src/es_archiver/lib/records/__tests__/filter_records_stream.js b/src/es_archiver/lib/records/__tests__/filter_records_stream.js index 90a89424cfa7..48a8aaf7de72 100644 --- a/src/es_archiver/lib/records/__tests__/filter_records_stream.js +++ b/src/es_archiver/lib/records/__tests__/filter_records_stream.js @@ -18,7 +18,7 @@ */ import Chance from 'chance'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createListStream, diff --git a/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js b/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js index 6ea7c8416722..02e49fefc587 100644 --- a/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js +++ b/src/functional_test_runner/__tests__/fixtures/simple_project/tests.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default () => { describe('app one', () => { diff --git a/src/functional_test_runner/__tests__/integration/basic.js b/src/functional_test_runner/__tests__/integration/basic.js index b5e4f5f24fd4..1c3858a8cfd6 100644 --- a/src/functional_test_runner/__tests__/integration/basic.js +++ b/src/functional_test_runner/__tests__/integration/basic.js @@ -20,7 +20,7 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const SCRIPT = resolve(__dirname, '../../../../scripts/functional_test_runner.js'); const BASIC_CONFIG = resolve(__dirname, '../fixtures/simple_project/config.js'); diff --git a/src/functional_test_runner/__tests__/integration/failure_hooks.js b/src/functional_test_runner/__tests__/integration/failure_hooks.js index 1e2c2035df88..0c00e2771bb1 100644 --- a/src/functional_test_runner/__tests__/integration/failure_hooks.js +++ b/src/functional_test_runner/__tests__/integration/failure_hooks.js @@ -21,7 +21,7 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; import stripAnsi from 'strip-ansi'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const SCRIPT = resolve(__dirname, '../../../../scripts/functional_test_runner.js'); const FAILURE_HOOKS_CONFIG = resolve(__dirname, '../fixtures/failure_hooks/config.js'); diff --git a/src/functional_test_runner/lib/config/__tests__/read_config_file.js b/src/functional_test_runner/lib/config/__tests__/read_config_file.js index d9da00d9b3c8..d4a08333e814 100644 --- a/src/functional_test_runner/lib/config/__tests__/read_config_file.js +++ b/src/functional_test_runner/lib/config/__tests__/read_config_file.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ToolingLog } from '@kbn/dev-utils'; import { readConfigFile } from '../read_config_file'; diff --git a/src/legacy/core_plugins/console/__tests__/index.js b/src/legacy/core_plugins/console/__tests__/index.js index aebb5e16bc6d..e516898ef2fd 100644 --- a/src/legacy/core_plugins/console/__tests__/index.js +++ b/src/legacy/core_plugins/console/__tests__/index.js @@ -18,7 +18,7 @@ */ import { Deprecations } from '../../../deprecation'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import index from '../index'; import { noop } from 'lodash'; import sinon from 'sinon'; diff --git a/src/legacy/core_plugins/console/public/src/__tests__/utils.js b/src/legacy/core_plugins/console/public/src/__tests__/utils.js index 5863923c8271..fa88e42fa557 100644 --- a/src/legacy/core_plugins/console/public/src/__tests__/utils.js +++ b/src/legacy/core_plugins/console/public/src/__tests__/utils.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import utils from '../utils'; diff --git a/src/legacy/core_plugins/console/server/__tests__/elasticsearch_proxy_config.js b/src/legacy/core_plugins/console/server/__tests__/elasticsearch_proxy_config.js index 5d00e497ec2e..45d834693663 100644 --- a/src/legacy/core_plugins/console/server/__tests__/elasticsearch_proxy_config.js +++ b/src/legacy/core_plugins/console/server/__tests__/elasticsearch_proxy_config.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import fs from 'fs'; import { promisify } from 'bluebird'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_config.js b/src/legacy/core_plugins/console/server/__tests__/proxy_config.js index 79fbf444d07f..dd6d9c4de760 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_config.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_config.js @@ -19,7 +19,7 @@ /* eslint-env mocha */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import fs from 'fs'; import https, { Agent as HttpsAgent } from 'https'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_config_collection.js b/src/legacy/core_plugins/console/server/__tests__/proxy_config_collection.js index 6b9878f06952..91797f897d8b 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_config_collection.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_config_collection.js @@ -19,7 +19,7 @@ /* eslint-env mocha */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import fs from 'fs'; import { Agent as HttpsAgent } from 'https'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/body.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/body.js index 9dae2ec8047f..5a8bcd9ef414 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/body.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/body.js @@ -19,7 +19,7 @@ import sinon from 'sinon'; import Wreck from 'wreck'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Server } from 'hapi'; import { createProxyRoute } from '../../'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/headers.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/headers.js index 2d3ddf11e020..a7fbd57c16d6 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/headers.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/headers.js @@ -21,7 +21,7 @@ import { request } from 'http'; import sinon from 'sinon'; import Wreck from 'wreck'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Server } from 'hapi'; import { createProxyRoute } from '../../'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js index 4ceccc8855d6..c85b30ed7f6f 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js @@ -21,7 +21,7 @@ import { Agent } from 'http'; import sinon from 'sinon'; import Wreck from 'wreck'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Server } from 'hapi'; import { createProxyRoute } from '../../'; diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js index c5b44cf39713..8c3fc145181e 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js @@ -19,7 +19,7 @@ import sinon from 'sinon'; import Wreck from 'wreck'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Server } from 'hapi'; import { createProxyRoute } from '../../'; diff --git a/src/legacy/core_plugins/console/server/__tests__/set_headers.js b/src/legacy/core_plugins/console/server/__tests__/set_headers.js index 0bbfe8d443cf..a270cca1e586 100644 --- a/src/legacy/core_plugins/console/server/__tests__/set_headers.js +++ b/src/legacy/core_plugins/console/server/__tests__/set_headers.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { setHeaders } from '../set_headers'; describe('#set_headers', function () { diff --git a/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js b/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js index 24df2f9c5f89..c82e4418f4d8 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js +++ b/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import Promise from 'bluebird'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { esTestConfig } from '@kbn/test'; import { ensureEsVersion } from '../ensure_es_version'; diff --git a/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js b/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js index 0c588b98e9a7..cae3734eca0d 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js +++ b/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js @@ -19,7 +19,7 @@ import Promise from 'bluebird'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const NoConnections = require('elasticsearch').errors.NoConnections; diff --git a/src/legacy/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js b/src/legacy/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js index 5b7cfd372b19..092c0ecf1071 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js +++ b/src/legacy/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import isEsCompatibleWithKibana from '../is_es_compatible_with_kibana'; diff --git a/src/legacy/core_plugins/input_control_vis/public/control/control.test.js b/src/legacy/core_plugins/input_control_vis/public/control/control.test.js index 366a662e989e..9fdd79df507a 100644 --- a/src/legacy/core_plugins/input_control_vis/public/control/control.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/control/control.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Control } from './control'; function createControlParams(id, label) { diff --git a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/filter_manager.test.js b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/filter_manager.test.js index 49ac5d670033..61d07e8fd179 100644 --- a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/filter_manager.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/filter_manager.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FilterManager } from './filter_manager'; describe('FilterManager', function () { diff --git a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.js b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.js index 76519e0f58ed..28bebb59c4fe 100644 --- a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PhraseFilterManager } from './phrase_filter_manager'; describe('PhraseFilterManager', function () { diff --git a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.js b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.js index be700ad72ab4..b7f88f495d57 100644 --- a/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { RangeFilterManager } from './range_filter_manager'; describe('RangeFilterManager', function () { diff --git a/src/legacy/core_plugins/input_control_vis/public/lineage/lineage_map.test.js b/src/legacy/core_plugins/input_control_vis/public/lineage/lineage_map.test.js index b001899144b5..0031503fc025 100644 --- a/src/legacy/core_plugins/input_control_vis/public/lineage/lineage_map.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/lineage/lineage_map.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLineageMap } from './lineage_map'; import { CONTROL_TYPES, diff --git a/src/legacy/core_plugins/input_control_vis/public/lineage/parent_candidates.test.js b/src/legacy/core_plugins/input_control_vis/public/lineage/parent_candidates.test.js index 8ffe819ca594..50dea30541a9 100644 --- a/src/legacy/core_plugins/input_control_vis/public/lineage/parent_candidates.test.js +++ b/src/legacy/core_plugins/input_control_vis/public/lineage/parent_candidates.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLineageMap } from './lineage_map'; import { getParentCandidates } from './parent_candidates'; import { diff --git a/src/legacy/core_plugins/interpreter/server/lib/__tests__/create_handlers.js b/src/legacy/core_plugins/interpreter/server/lib/__tests__/create_handlers.js index 948ec7369d63..a6e0e13049e1 100644 --- a/src/legacy/core_plugins/interpreter/server/lib/__tests__/create_handlers.js +++ b/src/legacy/core_plugins/interpreter/server/lib/__tests__/create_handlers.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createHandlers } from '../create_handlers'; const mockRequest = { diff --git a/src/legacy/core_plugins/kbn_doc_views/public/__tests__/doc_views.js b/src/legacy/core_plugins/kbn_doc_views/public/__tests__/doc_views.js index e14974c09838..4bd41bfa3968 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/__tests__/doc_views.js +++ b/src/legacy/core_plugins/kbn_doc_views/public/__tests__/doc_views.js @@ -20,7 +20,7 @@ import angular from 'angular'; import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'ui/render_directive'; import '../views/table'; diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/editors/__tests__/point_series.js b/src/legacy/core_plugins/kbn_vislib_vis_types/public/editors/__tests__/point_series.js index be20e8952492..0a9c304777d2 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/editors/__tests__/point_series.js +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/editors/__tests__/point_series.js @@ -19,7 +19,7 @@ import angular from 'angular'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import $ from 'jquery'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js index a96409bbce44..e81381462386 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createBoolFormat } from '../boolean'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/bytes.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/bytes.js index f0ece59128e0..58e69c468d50 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/bytes.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/bytes.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createBytesFormat } from '../bytes'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/color.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/color.js index e00c4c9cb455..52b00c303445 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/color.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/color.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createColorFormat } from '../color'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/date.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/date.js index 45748d086045..bab2358d3c18 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/date.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/date.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment-timezone'; import { createDateFormat } from '../date'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/duration.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/duration.js index 620668fa9416..1c2fcae2e9de 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/duration.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/duration.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createDurationFormat } from '../duration'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/ip.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/ip.js index ff3af3b2e301..3223c45411c3 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/ip.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/ip.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createIpFormat } from '../ip'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/number.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/number.js index 100f035ac7d4..e6f72946e426 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/number.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/number.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createNumberFormat } from '../number'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/percent.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/percent.js index ad2ba502d605..0b0aecc8f87a 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/percent.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/percent.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createPercentFormat } from '../percent'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/relative_date.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/relative_date.js index 551da872c77f..7cde85654248 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/relative_date.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/relative_date.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment-timezone'; import { createRelativeDateFormat } from '../relative_date'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/string.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/string.js index 74fb0e1f886b..04c0b9a045d3 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/string.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createStringFormat } from '../string'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/truncate.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/truncate.js index ca52dfd01000..ed0f1bb5fdb0 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/truncate.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/truncate.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createTruncateFormat } from '../truncate'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/url.js b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/url.js index 45fc4ed3dae1..16895d9e25a8 100644 --- a/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/url.js +++ b/src/legacy/core_plugins/kibana/common/field_formats/types/__tests__/url.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createUrlFormat } from '../url'; import { FieldFormat } from '../../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_html.js b/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_html.js index 58daae53cf78..0fdec31ec0d0 100644 --- a/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_html.js +++ b/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_html.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { highlightTags } from '../highlight_tags'; import { htmlTags } from '../html_tags'; import { getHighlightHtml } from '../highlight_html'; diff --git a/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_request.js b/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_request.js index af81979a5477..f7015ee333f6 100644 --- a/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_request.js +++ b/src/legacy/core_plugins/kibana/common/highlight/__tests__/highlight_request.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getHighlightRequest } from '../highlight_request'; describe('getHighlightRequest', () => { diff --git a/src/legacy/core_plugins/kibana/common/lib/__tests__/convert_pattern_and_ingest_name.js b/src/legacy/core_plugins/kibana/common/lib/__tests__/convert_pattern_and_ingest_name.js index 65a3a9493533..d130aa180950 100644 --- a/src/legacy/core_plugins/kibana/common/lib/__tests__/convert_pattern_and_ingest_name.js +++ b/src/legacy/core_plugins/kibana/common/lib/__tests__/convert_pattern_and_ingest_name.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { patternToIngest, ingestToPattern } from '../convert_pattern_and_ingest_name'; describe('convertPatternAndTemplateName', function () { diff --git a/src/legacy/core_plugins/kibana/common/utils/__tests__/as_pretty_string.js b/src/legacy/core_plugins/kibana/common/utils/__tests__/as_pretty_string.js index 72a41b3a3f85..723b3ccf0c59 100644 --- a/src/legacy/core_plugins/kibana/common/utils/__tests__/as_pretty_string.js +++ b/src/legacy/core_plugins/kibana/common/utils/__tests__/as_pretty_string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { asPrettyString } from '../as_pretty_string'; describe('asPrettyString', () => { diff --git a/src/legacy/core_plugins/kibana/common/utils/__tests__/shorten_dotted_string.js b/src/legacy/core_plugins/kibana/common/utils/__tests__/shorten_dotted_string.js index e2915fcc1249..e47c08800d8e 100644 --- a/src/legacy/core_plugins/kibana/common/utils/__tests__/shorten_dotted_string.js +++ b/src/legacy/core_plugins/kibana/common/utils/__tests__/shorten_dotted_string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { shortenDottedString } from '../shorten_dotted_string'; describe('shortenDottedString', () => { diff --git a/src/legacy/core_plugins/kibana/public/context/api/__tests__/anchor.js b/src/legacy/core_plugins/kibana/public/context/api/__tests__/anchor.js index 598cebf4c546..9af9d8032fb2 100644 --- a/src/legacy/core_plugins/kibana/public/context/api/__tests__/anchor.js +++ b/src/legacy/core_plugins/kibana/public/context/api/__tests__/anchor.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; diff --git a/src/legacy/core_plugins/kibana/public/context/api/__tests__/predecessors.js b/src/legacy/core_plugins/kibana/public/context/api/__tests__/predecessors.js index 698053eb93b6..63bd9987bc7e 100644 --- a/src/legacy/core_plugins/kibana/public/context/api/__tests__/predecessors.js +++ b/src/legacy/core_plugins/kibana/public/context/api/__tests__/predecessors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import moment from 'moment'; import * as _ from 'lodash'; diff --git a/src/legacy/core_plugins/kibana/public/context/api/__tests__/successors.js b/src/legacy/core_plugins/kibana/public/context/api/__tests__/successors.js index 14330a4d3877..ba6b0071865b 100644 --- a/src/legacy/core_plugins/kibana/public/context/api/__tests__/successors.js +++ b/src/legacy/core_plugins/kibana/public/context/api/__tests__/successors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import moment from 'moment'; import * as _ from 'lodash'; diff --git a/src/legacy/core_plugins/kibana/public/context/api/utils/__tests__/sorting.js b/src/legacy/core_plugins/kibana/public/context/api/utils/__tests__/sorting.js index bf221c6711d1..bfea37088c87 100644 --- a/src/legacy/core_plugins/kibana/public/context/api/utils/__tests__/sorting.js +++ b/src/legacy/core_plugins/kibana/public/context/api/utils/__tests__/sorting.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { reverseSortDirection, diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_add_filter.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_add_filter.js index bfa0206fa764..e616fab9c0c2 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_add_filter.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_add_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js index a89279e4d2ce..156264cd9856 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from 'ui/filter_manager'; diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js index ec8799473f59..f4eb82d217c9 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from 'ui/filter_manager'; diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_predecessor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_predecessor_count.js index d542adedcc4c..0aa1f640f266 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_predecessor_count.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_predecessor_count.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from 'ui/filter_manager'; diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_query_parameters.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_query_parameters.js index fb04b5414c7b..6a3638bc9f55 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_query_parameters.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_query_parameters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from 'ui/filter_manager'; diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_successor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_successor_count.js index 93a388a6d663..f4e85eefe1e6 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_successor_count.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_set_successor_count.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from 'ui/filter_manager'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js index 9656232031ea..d5732a5a6cc4 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('SavedDashboards Service', function () { let savedDashboardLoader; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/panel/__tests__/panel_state.ts b/src/legacy/core_plugins/kibana/public/dashboard/panel/__tests__/panel_state.ts index e6162184145e..4d910feaa411 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/panel/__tests__/panel_state.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/panel/__tests__/panel_state.ts @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PanelState } from '../../selectors'; import { createPanelState } from '../panel_state'; diff --git a/src/legacy/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js b/src/legacy/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js index 6e0e07104fa8..bf69fa09823f 100644 --- a/src/legacy/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js +++ b/src/legacy/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import chrome from 'ui/chrome'; diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/discover_field.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/discover_field.js index 211773a5ae86..50e9067b4836 100644 --- a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/discover_field.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/discover_field.js @@ -22,7 +22,7 @@ import angular from 'angular'; import _ from 'lodash'; import sinon from 'sinon'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import 'ui/private'; import '../../components/field_chooser/discover_field'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js index 46c77e26c0ac..cce6127ed9c4 100644 --- a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js @@ -21,7 +21,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; import { fieldCalculator } from '../../components/field_chooser/lib/field_calculator'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import 'ui/private'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js index 6920c058e1ea..f76a0ab72b21 100644 --- a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_chooser.js @@ -21,7 +21,7 @@ import angular from 'angular'; import ngMock from 'ng_mock'; import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import 'ui/private'; import '../../components/field_chooser/field_chooser'; diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/hit_sort_fn.js b/src/legacy/core_plugins/kibana/public/discover/__tests__/hit_sort_fn.js index c73cd2b56f75..3c7e1e83688d 100644 --- a/src/legacy/core_plugins/kibana/public/discover/__tests__/hit_sort_fn.js +++ b/src/legacy/core_plugins/kibana/public/discover/__tests__/hit_sort_fn.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import PluginsKibanaDiscoverHitSortFnProvider from '../_hit_sort_fn'; describe('hit sort function', function () { diff --git a/src/legacy/core_plugins/kibana/public/doc/__tests__/doc.js b/src/legacy/core_plugins/kibana/public/doc/__tests__/doc.js index a529650ae96a..69ca21b2cf86 100644 --- a/src/legacy/core_plugins/kibana/public/doc/__tests__/doc.js +++ b/src/legacy/core_plugins/kibana/public/doc/__tests__/doc.js @@ -19,7 +19,7 @@ // Load the kibana app dependencies. import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import '..'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import { timefilter } from 'ui/timefilter'; diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_boolean.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_boolean.js index b02c87b1c111..24c67c0dccbf 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_boolean.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_boolean.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('Boolean Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_color.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_color.js index bebe202bf82d..329624269ae1 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_color.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_color.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('Color Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_conformance.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_conformance.js index d23b60cad87c..e84d5e217cf7 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_conformance.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_conformance.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import chrome from 'ui/chrome'; import { fieldFormats } from 'ui/registry/field_formats'; import { FieldFormat } from '../../../../../ui/field_formats/field_format'; diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_date.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_date.js index ac49c93f63cb..33b3a4d4c73c 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_date.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_date.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import moment from 'moment-timezone'; import { fieldFormats } from 'ui/registry/field_formats'; diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_duration.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_duration.js index d12c616bec6e..baa45caa4bcc 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_duration.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_duration.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('Duration Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_ip.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_ip.js index a7b920f9eda1..529bcf772a48 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_ip.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_ip.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('IP Address Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_source.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_source.js index 4726c3993771..e25448767957 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_source.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_source.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { fieldFormats } from 'ui/registry/field_formats'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_string.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_string.js index c779c164b7d1..e4e11e288d1f 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_string.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('String Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_truncate.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_truncate.js index d5c89f98182b..0db4c844e291 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_truncate.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_truncate.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('String Truncate Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_url.js b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_url.js index e00131caa84d..b62ba4b147cf 100644 --- a/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_url.js +++ b/src/legacy/core_plugins/kibana/public/field_formats/__tests__/_url.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { fieldFormats } from 'ui/registry/field_formats'; describe('Url Format', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/default_category.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/default_category.test.js index f3b15caa9263..d12e0649ec8c 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/default_category.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/default_category.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { DEFAULT_CATEGORY } from '../default_category'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_aria_name.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_aria_name.test.js index 59606b6677b4..e71cf3459a8d 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_aria_name.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_aria_name.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getAriaName } from '../get_aria_name'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_category_name.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_category_name.test.js index 939eca86afed..d517e8239537 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_category_name.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_category_name.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getCategoryName } from '../get_category_name'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_val_type.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_val_type.test.js index 212e9c94f37e..ac6436590fd9 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_val_type.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/get_val_type.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getValType } from '../get_val_type'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/is_default_value.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/is_default_value.test.js index d668c6ff1dbc..043230d5f9ea 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/is_default_value.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/is_default_value.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isDefaultValue } from '../is_default_value'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/to_editable_config.test.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/to_editable_config.test.js index 428b9852ff84..ad1ba30ece4b 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/to_editable_config.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/lib/__tests__/to_editable_config.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { toEditableConfig } from '../to_editable_config'; describe('Settings', function () { diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/handle_es_error.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/handle_es_error.js index a3cd66068789..c8ce291af0ca 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/handle_es_error.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/handle_es_error.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import handleESError from '../handle_es_error'; import { errors as esErrors } from 'elasticsearch'; diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/manage_uuid.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/manage_uuid.js index 80fa79ab64f5..907b2c8e95f8 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/manage_uuid.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/manage_uuid.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { startTestServers } from '../../../../../../test_utils/kbn_server'; import manageUuid from '../manage_uuid'; diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js index 42845b4cf0eb..1ef1a1f19218 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/relationships.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { findRelationships } from '../management/saved_objects/relationships'; describe('findRelationships', () => { diff --git a/src/legacy/core_plugins/kibana/server/lib/__tests__/system_api.js b/src/legacy/core_plugins/kibana/server/lib/__tests__/system_api.js index c8b9cefc5aa1..f57591877756 100644 --- a/src/legacy/core_plugins/kibana/server/lib/__tests__/system_api.js +++ b/src/legacy/core_plugins/kibana/server/lib/__tests__/system_api.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isSystemApiRequest } from '../system_api'; describe('system_api', () => { diff --git a/src/legacy/core_plugins/kibana/server/tutorials/apm/saved_objects/get_saved_objects.test.js b/src/legacy/core_plugins/kibana/server/tutorials/apm/saved_objects/get_saved_objects.test.js index 108ed4c71330..13e5b4711f48 100644 --- a/src/legacy/core_plugins/kibana/server/tutorials/apm/saved_objects/get_saved_objects.test.js +++ b/src/legacy/core_plugins/kibana/server/tutorials/apm/saved_objects/get_saved_objects.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSavedObjects } from './get_saved_objects'; const indexPatternTitle = 'dynamic index pattern title'; diff --git a/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis.js b/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis.js index 43def2fe543a..a8bfec6c8620 100644 --- a/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis.js +++ b/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VisProvider } from 'ui/vis'; import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis_controller.js b/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis_controller.js index 470669f3f568..82ef6f2de50b 100644 --- a/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis_controller.js +++ b/src/legacy/core_plugins/metric_vis/public/__tests__/metric_vis_controller.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { MetricVisComponent } from '../metric_vis_controller'; describe('metric vis controller', function () { diff --git a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js index 54a2e018983a..c223660f869b 100644 --- a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js +++ b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import { RegionMapsVisualizationProvider } from '../region_map_visualization'; diff --git a/src/legacy/core_plugins/table_vis/public/__tests__/_table_vis_controller.js b/src/legacy/core_plugins/table_vis/public/__tests__/_table_vis_controller.js index 41028de00783..ac46ec373f9f 100644 --- a/src/legacy/core_plugins/table_vis/public/__tests__/_table_vis_controller.js +++ b/src/legacy/core_plugins/table_vis/public/__tests__/_table_vis_controller.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { LegacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy'; import { VisProvider } from 'ui/vis'; diff --git a/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud.js b/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud.js index 441d2bb002cb..f6736b5d3d11 100644 --- a/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud.js +++ b/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import TagCloud from '../tag_cloud'; import d3 from 'd3'; diff --git a/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud_visualization.js b/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud_visualization.js index 9a0e904ccc71..69d08d8cb3f7 100644 --- a/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud_visualization.js +++ b/src/legacy/core_plugins/tagcloud/public/__tests__/tag_cloud_visualization.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern'; import * as visModule from 'ui/vis'; diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js b/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js index 3d83fdfe12aa..608ded804e5a 100644 --- a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js +++ b/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { CoordinateMapsVisualizationProvider } from '../coordinate_maps_visualization'; import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js b/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js index e5a73e734ddd..628175e4fd2b 100644 --- a/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js +++ b/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { KibanaMap } from 'ui/vis/map/kibana_map'; import { GeohashLayer } from '../geohash_layer'; // import heatmapPng from './heatmap.png'; diff --git a/src/legacy/core_plugins/timelion/public/__tests__/_tick_generator.js b/src/legacy/core_plugins/timelion/public/__tests__/_tick_generator.js index 3d7a62ea1b2f..508cc5cd856d 100644 --- a/src/legacy/core_plugins/timelion/public/__tests__/_tick_generator.js +++ b/src/legacy/core_plugins/timelion/public/__tests__/_tick_generator.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('Tick Generator', function () { diff --git a/src/legacy/core_plugins/timelion/public/__tests__/services/tick_formatters.js b/src/legacy/core_plugins/timelion/public/__tests__/services/tick_formatters.js index f447ad0adf1a..8e140b9bf992 100644 --- a/src/legacy/core_plugins/timelion/public/__tests__/services/tick_formatters.js +++ b/src/legacy/core_plugins/timelion/public/__tests__/services/tick_formatters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('Tick Formatters', function () { diff --git a/src/legacy/core_plugins/timelion/public/directives/__tests__/timelion_expression_input_helpers.js b/src/legacy/core_plugins/timelion/public/directives/__tests__/timelion_expression_input_helpers.js index 7f8ca9a136f5..16f44e2835b2 100644 --- a/src/legacy/core_plugins/timelion/public/directives/__tests__/timelion_expression_input_helpers.js +++ b/src/legacy/core_plugins/timelion/public/directives/__tests__/timelion_expression_input_helpers.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import PEG from 'pegjs'; import grammar from 'raw-loader!../../chain.peg'; import { diff --git a/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/__tests__/timelion_expression_suggestions.js b/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/__tests__/timelion_expression_suggestions.js index 1a1ecceabef1..59d77a9ec0f1 100644 --- a/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/__tests__/timelion_expression_suggestions.js +++ b/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/__tests__/timelion_expression_suggestions.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../timelion_expression_suggestions'; diff --git a/src/legacy/core_plugins/timelion/server/lib/offset_time.test.js b/src/legacy/core_plugins/timelion/server/lib/offset_time.test.js index 4a4d524f7773..9250d3898638 100644 --- a/src/legacy/core_plugins/timelion/server/lib/offset_time.test.js +++ b/src/legacy/core_plugins/timelion/server/lib/offset_time.test.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { preprocessOffset } from './offset_time'; diff --git a/src/legacy/core_plugins/vega/public/__tests__/vega_visualization.js b/src/legacy/core_plugins/vega/public/__tests__/vega_visualization.js index 141bf4d061fd..d40ba8c34568 100644 --- a/src/legacy/core_plugins/vega/public/__tests__/vega_visualization.js +++ b/src/legacy/core_plugins/vega/public/__tests__/vega_visualization.js @@ -18,7 +18,7 @@ */ import Promise from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import $ from 'jquery'; import { VegaVisualizationProvider } from '../vega_visualization'; diff --git a/src/legacy/core_plugins/vega/public/data_model/__tests__/es_query_parser.js b/src/legacy/core_plugins/vega/public/data_model/__tests__/es_query_parser.js index af83c75a0fec..40cbbb203deb 100644 --- a/src/legacy/core_plugins/vega/public/data_model/__tests__/es_query_parser.js +++ b/src/legacy/core_plugins/vega/public/data_model/__tests__/es_query_parser.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import moment from 'moment'; import { EsQueryParser } from '../es_query_parser'; diff --git a/src/legacy/core_plugins/vega/public/data_model/__tests__/search_cache.js b/src/legacy/core_plugins/vega/public/data_model/__tests__/search_cache.js index 4d712a39af77..57057a74e997 100644 --- a/src/legacy/core_plugins/vega/public/data_model/__tests__/search_cache.js +++ b/src/legacy/core_plugins/vega/public/data_model/__tests__/search_cache.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SearchCache } from '../search_cache'; describe(`SearchCache`, () => { diff --git a/src/legacy/core_plugins/vega/public/data_model/__tests__/time_cache.js b/src/legacy/core_plugins/vega/public/data_model/__tests__/time_cache.js index 8a7f263970bf..0ab31fb8c5da 100644 --- a/src/legacy/core_plugins/vega/public/data_model/__tests__/time_cache.js +++ b/src/legacy/core_plugins/vega/public/data_model/__tests__/time_cache.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { TimeCache } from '../time_cache'; describe(`TimeCache`, () => { diff --git a/src/legacy/core_plugins/vega/public/data_model/__tests__/vega_parser.js b/src/legacy/core_plugins/vega/public/data_model/__tests__/vega_parser.js index de8bb8a5006f..3fa8af0e04c7 100644 --- a/src/legacy/core_plugins/vega/public/data_model/__tests__/vega_parser.js +++ b/src/legacy/core_plugins/vega/public/data_model/__tests__/vega_parser.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VegaParser } from '../vega_parser'; import { bypassExternalUrlCheck } from '../../vega_view/vega_base_view'; diff --git a/src/legacy/deprecation/__tests__/create_transform.js b/src/legacy/deprecation/__tests__/create_transform.js index 5e8292761c78..0a02a081e41e 100644 --- a/src/legacy/deprecation/__tests__/create_transform.js +++ b/src/legacy/deprecation/__tests__/create_transform.js @@ -18,7 +18,7 @@ */ import { createTransform } from '../create_transform'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; describe('deprecation', function () { diff --git a/src/legacy/deprecation/deprecations/__tests__/rename.js b/src/legacy/deprecation/deprecations/__tests__/rename.js index 5a1d60a65bf9..eb7b0f644932 100644 --- a/src/legacy/deprecation/deprecations/__tests__/rename.js +++ b/src/legacy/deprecation/deprecations/__tests__/rename.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { rename } from '../rename'; import sinon from 'sinon'; diff --git a/src/legacy/deprecation/deprecations/__tests__/unused.js b/src/legacy/deprecation/deprecations/__tests__/unused.js index cda113442ca7..41e4e9192f83 100644 --- a/src/legacy/deprecation/deprecations/__tests__/unused.js +++ b/src/legacy/deprecation/deprecations/__tests__/unused.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { unused } from '../unused'; diff --git a/src/legacy/plugin_discovery/__tests__/find_plugin_specs.js b/src/legacy/plugin_discovery/__tests__/find_plugin_specs.js index 563ea9043fce..f8d1cfc865a1 100644 --- a/src/legacy/plugin_discovery/__tests__/find_plugin_specs.js +++ b/src/legacy/plugin_discovery/__tests__/find_plugin_specs.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import { toArray } from 'rxjs/operators'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEqual } from 'lodash'; import { findPluginSpecs } from '../find_plugin_specs'; import { PluginSpec } from '../plugin_spec'; diff --git a/src/legacy/plugin_discovery/plugin_config/__tests__/extend_config_service.js b/src/legacy/plugin_discovery/plugin_config/__tests__/extend_config_service.js index a7028b73d704..e0c965ee6c4b 100644 --- a/src/legacy/plugin_discovery/plugin_config/__tests__/extend_config_service.js +++ b/src/legacy/plugin_discovery/plugin_config/__tests__/extend_config_service.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Config } from '../../../server/config'; import { PluginPack } from '../../plugin_pack'; diff --git a/src/legacy/plugin_discovery/plugin_config/__tests__/schema.js b/src/legacy/plugin_discovery/plugin_config/__tests__/schema.js index 2e00936653d0..fb768a033553 100644 --- a/src/legacy/plugin_discovery/plugin_config/__tests__/schema.js +++ b/src/legacy/plugin_discovery/plugin_config/__tests__/schema.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PluginPack } from '../../plugin_pack'; import { getSchema, getStubSchema } from '../schema'; diff --git a/src/legacy/plugin_discovery/plugin_config/__tests__/settings.js b/src/legacy/plugin_discovery/plugin_config/__tests__/settings.js index 780f48165f1b..a53ada44fad4 100644 --- a/src/legacy/plugin_discovery/plugin_config/__tests__/settings.js +++ b/src/legacy/plugin_discovery/plugin_config/__tests__/settings.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { PluginPack } from '../../plugin_pack'; diff --git a/src/legacy/plugin_discovery/plugin_exports/__tests__/reduce_export_specs.js b/src/legacy/plugin_discovery/plugin_exports/__tests__/reduce_export_specs.js index 6635cfcbc43e..7df87ca5cc5d 100644 --- a/src/legacy/plugin_discovery/plugin_exports/__tests__/reduce_export_specs.js +++ b/src/legacy/plugin_discovery/plugin_exports/__tests__/reduce_export_specs.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PluginPack } from '../../plugin_pack'; import { reduceExportSpecs } from '../reduce_export_specs'; diff --git a/src/legacy/plugin_discovery/plugin_pack/__tests__/create_pack.js b/src/legacy/plugin_discovery/plugin_pack/__tests__/create_pack.js index 740b4ebed63a..3a39b5d0182c 100644 --- a/src/legacy/plugin_discovery/plugin_pack/__tests__/create_pack.js +++ b/src/legacy/plugin_discovery/plugin_pack/__tests__/create_pack.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import * as Rx from 'rxjs'; import { toArray } from 'rxjs/operators'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createPack$ } from '../create_pack'; import { PluginPack } from '../plugin_pack'; diff --git a/src/legacy/plugin_discovery/plugin_pack/__tests__/package_json_at_path.js b/src/legacy/plugin_discovery/plugin_pack/__tests__/package_json_at_path.js index 59ac6050f803..008a5d3299cc 100644 --- a/src/legacy/plugin_discovery/plugin_pack/__tests__/package_json_at_path.js +++ b/src/legacy/plugin_discovery/plugin_pack/__tests__/package_json_at_path.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import { toArray } from 'rxjs/operators'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createPackageJsonAtPath$ } from '../package_json_at_path'; import { diff --git a/src/legacy/plugin_discovery/plugin_pack/__tests__/package_jsons_in_directory.js b/src/legacy/plugin_discovery/plugin_pack/__tests__/package_jsons_in_directory.js index f86cbd3bb6c1..93bc69e2d3bd 100644 --- a/src/legacy/plugin_discovery/plugin_pack/__tests__/package_jsons_in_directory.js +++ b/src/legacy/plugin_discovery/plugin_pack/__tests__/package_jsons_in_directory.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import { toArray } from 'rxjs/operators'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createPackageJsonsInDirectory$ } from '../package_jsons_in_directory'; diff --git a/src/legacy/plugin_discovery/plugin_pack/__tests__/plugin_pack.js b/src/legacy/plugin_discovery/plugin_pack/__tests__/plugin_pack.js index d4ced575a6ea..425f026ef3b9 100644 --- a/src/legacy/plugin_discovery/plugin_pack/__tests__/plugin_pack.js +++ b/src/legacy/plugin_discovery/plugin_pack/__tests__/plugin_pack.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { PluginPack } from '../plugin_pack'; diff --git a/src/legacy/plugin_discovery/plugin_spec/__tests__/is_version_compatible.js b/src/legacy/plugin_discovery/plugin_spec/__tests__/is_version_compatible.js index 637fc0422cdf..897184496af3 100644 --- a/src/legacy/plugin_discovery/plugin_spec/__tests__/is_version_compatible.js +++ b/src/legacy/plugin_discovery/plugin_spec/__tests__/is_version_compatible.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isVersionCompatible } from '../is_version_compatible'; diff --git a/src/legacy/plugin_discovery/plugin_spec/__tests__/plugin_spec.js b/src/legacy/plugin_discovery/plugin_spec/__tests__/plugin_spec.js index 6709e4996f6f..dc57e0a099d0 100644 --- a/src/legacy/plugin_discovery/plugin_spec/__tests__/plugin_spec.js +++ b/src/legacy/plugin_discovery/plugin_spec/__tests__/plugin_spec.js @@ -19,7 +19,7 @@ import { resolve } from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { PluginPack } from '../../plugin_pack'; diff --git a/src/legacy/server/config/__tests__/deprecation_warnings.js b/src/legacy/server/config/__tests__/deprecation_warnings.js index 6e4d5e2fd57d..ecaa6fa22f54 100644 --- a/src/legacy/server/config/__tests__/deprecation_warnings.js +++ b/src/legacy/server/config/__tests__/deprecation_warnings.js @@ -19,7 +19,7 @@ import { spawn } from 'child_process'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const RUN_KBN_SERVER_STARTUP = require.resolve('./fixtures/run_kbn_server_startup'); const SETUP_NODE_ENV = require.resolve('../../../../setup_node_env'); diff --git a/src/legacy/server/usage/classes/__tests__/collector_set.js b/src/legacy/server/usage/classes/__tests__/collector_set.js index 3d1a23b8dc5d..bdd490ab6f22 100644 --- a/src/legacy/server/usage/classes/__tests__/collector_set.js +++ b/src/legacy/server/usage/classes/__tests__/collector_set.js @@ -19,7 +19,7 @@ import { noop } from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Collector } from '../collector'; import { CollectorSet } from '../collector_set'; diff --git a/src/legacy/ui/__tests__/ui_exports_replace_injected_vars.js b/src/legacy/ui/__tests__/ui_exports_replace_injected_vars.js index f75ac5d09f16..9243a715625d 100644 --- a/src/legacy/ui/__tests__/ui_exports_replace_injected_vars.js +++ b/src/legacy/ui/__tests__/ui_exports_replace_injected_vars.js @@ -20,7 +20,7 @@ import { resolve } from 'path'; import { delay } from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import cheerio from 'cheerio'; import { noop } from 'lodash'; diff --git a/src/legacy/ui/field_formats/__tests__/field_format.js b/src/legacy/ui/field_formats/__tests__/field_format.js index 7bd7e7e225db..bf8ff9f33b18 100644 --- a/src/legacy/ui/field_formats/__tests__/field_format.js +++ b/src/legacy/ui/field_formats/__tests__/field_format.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { asPrettyString } from '../../../core_plugins/kibana/common/utils/as_pretty_string'; import { FieldFormat } from '../field_format'; diff --git a/src/legacy/ui/field_formats/__tests__/field_formats_mixin.js b/src/legacy/ui/field_formats/__tests__/field_formats_mixin.js index 3159705f3d8e..8f513fe28c98 100644 --- a/src/legacy/ui/field_formats/__tests__/field_formats_mixin.js +++ b/src/legacy/ui/field_formats/__tests__/field_formats_mixin.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { FieldFormat } from '../field_format'; diff --git a/src/legacy/ui/field_formats/__tests__/field_formats_service.js b/src/legacy/ui/field_formats/__tests__/field_formats_service.js index 2110859f5355..9ae80462c2a0 100644 --- a/src/legacy/ui/field_formats/__tests__/field_formats_service.js +++ b/src/legacy/ui/field_formats/__tests__/field_formats_service.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FieldFormat } from '../field_format'; import { FieldFormatsService } from '../field_formats_service'; import { createNumberFormat } from '../../../core_plugins/kibana/common/field_formats/types/number'; diff --git a/src/legacy/ui/public/__tests__/errors.js b/src/legacy/ui/public/__tests__/errors.js index d328a6dc4e0c..cc861ffd8e96 100644 --- a/src/legacy/ui/public/__tests__/errors.js +++ b/src/legacy/ui/public/__tests__/errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { RequestFailure, FetchFailure, diff --git a/src/legacy/ui/public/__tests__/metadata.js b/src/legacy/ui/public/__tests__/metadata.js index 9cb5841f0d40..56866efcbc27 100644 --- a/src/legacy/ui/public/__tests__/metadata.js +++ b/src/legacy/ui/public/__tests__/metadata.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { metadata } from '../metadata'; describe('ui/metadata', () => { it('is immutable', () => { diff --git a/src/legacy/ui/public/accessibility/__tests__/kbn_accessible_click.js b/src/legacy/ui/public/accessibility/__tests__/kbn_accessible_click.js index 93b3f5b094e6..b120a1c6fff3 100644 --- a/src/legacy/ui/public/accessibility/__tests__/kbn_accessible_click.js +++ b/src/legacy/ui/public/accessibility/__tests__/kbn_accessible_click.js @@ -19,7 +19,7 @@ import angular from 'angular'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../kbn_accessible_click'; import { keyCodes } from '@elastic/eui'; diff --git a/src/legacy/ui/public/accessibility/__tests__/kbn_ui_ace_keyboard_mode.js b/src/legacy/ui/public/accessibility/__tests__/kbn_ui_ace_keyboard_mode.js index 784528447995..a8a6f0cd0db2 100644 --- a/src/legacy/ui/public/accessibility/__tests__/kbn_ui_ace_keyboard_mode.js +++ b/src/legacy/ui/public/accessibility/__tests__/kbn_ui_ace_keyboard_mode.js @@ -19,7 +19,7 @@ import angular from 'angular'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../kbn_ui_ace_keyboard_mode'; import { keyCodes } from '@elastic/eui'; diff --git a/src/legacy/ui/public/accessibility/__tests__/scrollto_activedescendant.js b/src/legacy/ui/public/accessibility/__tests__/scrollto_activedescendant.js index f843c7f86579..38091d45ff9a 100644 --- a/src/legacy/ui/public/accessibility/__tests__/scrollto_activedescendant.js +++ b/src/legacy/ui/public/accessibility/__tests__/scrollto_activedescendant.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../scrollto_activedescendant'; diff --git a/src/legacy/ui/public/agg_response/hierarchical/__tests__/collect_branch.js b/src/legacy/ui/public/agg_response/hierarchical/__tests__/collect_branch.js index 02417e35cae4..310247657f0c 100644 --- a/src/legacy/ui/public/agg_response/hierarchical/__tests__/collect_branch.js +++ b/src/legacy/ui/public/agg_response/hierarchical/__tests__/collect_branch.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import collectBranch from '../_collect_branch'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('collectBranch()', function () { let results; const convert = function (name) { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_add_to_siri.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_add_to_siri.js index 7365f30511b3..8c2efbd608ed 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_add_to_siri.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_add_to_siri.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { addToSiri } from '../_add_to_siri'; describe('addToSiri', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js index 7aa75105704c..3ae59d1639b0 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { makeFakeXAspect } from '../_fake_x_aspect'; describe('makeFakeXAspect', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_aspects.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_aspects.js index ad4e04fa2aae..45b32084a4d2 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_aspects.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_aspects.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getAspects } from '../_get_aspects'; describe('getAspects', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_point.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_point.js index 98d5c7c31761..bde46b3b4be1 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_point.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_point.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getPoint } from '../_get_point'; describe('getPoint', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_series.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_series.js index 68e212bd8c15..6eee6e21a984 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_get_series.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_get_series.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSeries } from '../_get_series'; diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_init_x_axis.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_init_x_axis.js index 83314d2ca1cf..93ed9c2cc18d 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_init_x_axis.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_init_x_axis.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { initXAxis } from '../_init_x_axis'; import { makeFakeXAspect } from '../_fake_x_aspect'; diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_init_y_axis.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_init_y_axis.js index 5a730a78cfdd..a05c019b7e4b 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_init_y_axis.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_init_y_axis.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { initYAxis } from '../_init_y_axis'; describe('initYAxis', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_main.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_main.js index ba6f82c9bc70..470a03ef0ffd 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_main.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_main.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { buildPointSeriesData } from '../point_series'; describe('pointSeriesChartDataFromTable', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js index ea08ca56d28b..f689c0b8d8aa 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js @@ -19,7 +19,7 @@ import moment from 'moment'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { orderedDateAxis } from '../_ordered_date_axis'; describe('orderedDateAxis', function () { diff --git a/src/legacy/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js b/src/legacy/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js index c431e0ed9ee0..472836af52b9 100644 --- a/src/legacy/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js +++ b/src/legacy/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { PointSeriesTooltipFormatter } from '../_tooltip_formatter'; diff --git a/src/legacy/ui/public/agg_response/tabify/__tests__/_buckets.js b/src/legacy/ui/public/agg_response/tabify/__tests__/_buckets.js index dfc475a949b4..9d17a508223a 100644 --- a/src/legacy/ui/public/agg_response/tabify/__tests__/_buckets.js +++ b/src/legacy/ui/public/agg_response/tabify/__tests__/_buckets.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { TabifyBuckets } from '../_buckets'; describe('Buckets wrapper', function () { diff --git a/src/legacy/ui/public/agg_response/tabify/__tests__/_get_columns.js b/src/legacy/ui/public/agg_response/tabify/__tests__/_get_columns.js index fbc42aaa04c3..4e15f8cc4e61 100644 --- a/src/legacy/ui/public/agg_response/tabify/__tests__/_get_columns.js +++ b/src/legacy/ui/public/agg_response/tabify/__tests__/_get_columns.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { tabifyGetColumns } from '../_get_columns'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_response/tabify/__tests__/_integration.js b/src/legacy/ui/public/agg_response/tabify/__tests__/_integration.js index ad6732add354..c11f38f38298 100644 --- a/src/legacy/ui/public/agg_response/tabify/__tests__/_integration.js +++ b/src/legacy/ui/public/agg_response/tabify/__tests__/_integration.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import fixtures from 'fixtures/fake_hierarchical_data'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { tabifyAggResponse } from '../tabify'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_response/tabify/__tests__/_response_writer.js b/src/legacy/ui/public/agg_response/tabify/__tests__/_response_writer.js index b39546714676..09668c638d69 100644 --- a/src/legacy/ui/public/agg_response/tabify/__tests__/_response_writer.js +++ b/src/legacy/ui/public/agg_response/tabify/__tests__/_response_writer.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { TabbedAggResponseWriter } from '../_response_writer'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_table/__tests__/_group.js b/src/legacy/ui/public/agg_table/__tests__/_group.js index cd0a432006fc..89c21f9169be 100644 --- a/src/legacy/ui/public/agg_table/__tests__/_group.js +++ b/src/legacy/ui/public/agg_table/__tests__/_group.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import fixtures from 'fixtures/fake_hierarchical_data'; import { LegacyResponseHandlerProvider } from '../../vis/response_handlers/legacy'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_table/__tests__/_table.js b/src/legacy/ui/public/agg_table/__tests__/_table.js index 299da9490214..357d473de47c 100644 --- a/src/legacy/ui/public/agg_table/__tests__/_table.js +++ b/src/legacy/ui/public/agg_table/__tests__/_table.js @@ -20,7 +20,7 @@ import $ from 'jquery'; import moment from 'moment'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import fixtures from 'fixtures/fake_hierarchical_data'; import sinon from 'sinon'; import { LegacyResponseHandlerProvider } from '../../vis/response_handlers/legacy'; diff --git a/src/legacy/ui/public/agg_types/__tests__/agg_params.js b/src/legacy/ui/public/agg_types/__tests__/agg_params.js index bddfa725165a..99a9347c934a 100644 --- a/src/legacy/ui/public/agg_types/__tests__/agg_params.js +++ b/src/legacy/ui/public/agg_types/__tests__/agg_params.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { AggParams } from '../agg_params'; import { BaseParamType } from '../param_types/base'; import { FieldParamType } from '../param_types/field'; diff --git a/src/legacy/ui/public/agg_types/__tests__/agg_type.js b/src/legacy/ui/public/agg_types/__tests__/agg_type.js index 659809175db8..496e5515c75e 100644 --- a/src/legacy/ui/public/agg_types/__tests__/agg_type.js +++ b/src/legacy/ui/public/agg_types/__tests__/agg_type.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../private'; import { AggParams } from '../agg_params'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/_geo_hash.js b/src/legacy/ui/public/agg_types/__tests__/buckets/_geo_hash.js index 041030a9afb2..39c27f0b8db2 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/_geo_hash.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/_geo_hash.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { geoHashBucketAgg } from '../../buckets/geo_hash'; import * as AggConfigModule from '../../../vis/agg_config'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/_histogram.js b/src/legacy/ui/public/agg_types/__tests__/buckets/_histogram.js index 02b33cf7059e..9de472e91fc8 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/_histogram.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/_histogram.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; import { aggTypes } from '../..'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/_range.js b/src/legacy/ui/public/agg_types/__tests__/buckets/_range.js index bbfc46eee181..8aabf464e7b1 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/_range.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/_range.js @@ -19,7 +19,7 @@ import { values } from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import resp from 'fixtures/agg_resp/range'; import { VisProvider } from '../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/_terms_other_bucket_helper.js b/src/legacy/ui/public/agg_types/__tests__/buckets/_terms_other_bucket_helper.js index 3ea1c45d4289..d6840699074b 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/_terms_other_bucket_helper.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/_terms_other_bucket_helper.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { buildOtherBucketAgg, mergeOtherBucketAggResponse, updateMissingBucket } from '../../buckets/_terms_other_bucket_helper'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js index df6b9ed9ec80..a02da38511df 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js @@ -21,7 +21,7 @@ import _ from 'lodash'; import moment from 'moment'; import aggResp from 'fixtures/agg_resp/date_histogram'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import { createFilterDateHistogram } from '../../../buckets/create_filter/date_histogram'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js index f2344bb38c17..b6557ed6d762 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import moment from 'moment'; import { VisProvider } from '../../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/filters.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/filters.js index abe6be806c68..01337f272504 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/filters.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/filters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js index df729aa371b1..23e66cf5f1ae 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js index fb08d5ca6e36..cbab24745acd 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/range.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/range.js index bc7bd22ee828..58e7e0203c59 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/range.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/range.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/terms.js b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/terms.js index 9195df7b1b66..8753806babfa 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/terms.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/create_filter/terms.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js b/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js index afacdc522562..69d898be5c43 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import $ from 'jquery'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import { VisProvider } from '../../../../vis'; import { intervalOptions } from '../../../buckets/_interval_options'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js b/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js index 394ff6e52690..856da584cb68 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; import AggParamWriterProvider from '../../agg_param_writer'; diff --git a/src/legacy/ui/public/agg_types/__tests__/buckets/terms.js b/src/legacy/ui/public/agg_types/__tests__/buckets/terms.js index 923f66245124..a5ddb1849bdb 100644 --- a/src/legacy/ui/public/agg_types/__tests__/buckets/terms.js +++ b/src/legacy/ui/public/agg_types/__tests__/buckets/terms.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { aggTypes } from '../..'; diff --git a/src/legacy/ui/public/agg_types/__tests__/controls/number_list.js b/src/legacy/ui/public/agg_types/__tests__/controls/number_list.js index bbbdb822e0be..12856b3363bf 100644 --- a/src/legacy/ui/public/agg_types/__tests__/controls/number_list.js +++ b/src/legacy/ui/public/agg_types/__tests__/controls/number_list.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import simulateKeys from 'test_utils/simulate_keys'; import ngMock from 'ng_mock'; import '../../../number_list'; diff --git a/src/legacy/ui/public/agg_types/__tests__/directives/auto_select_if_only_one.js b/src/legacy/ui/public/agg_types/__tests__/directives/auto_select_if_only_one.js index 94bbb2addebe..9e83243811d9 100644 --- a/src/legacy/ui/public/agg_types/__tests__/directives/auto_select_if_only_one.js +++ b/src/legacy/ui/public/agg_types/__tests__/directives/auto_select_if_only_one.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../directives/auto_select_if_only_one'; diff --git a/src/legacy/ui/public/agg_types/__tests__/directives/input_number.js b/src/legacy/ui/public/agg_types/__tests__/directives/input_number.js index 6d3a3bf19fb3..5d7937f5275a 100644 --- a/src/legacy/ui/public/agg_types/__tests__/directives/input_number.js +++ b/src/legacy/ui/public/agg_types/__tests__/directives/input_number.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../directives/input_number'; diff --git a/src/legacy/ui/public/agg_types/__tests__/directives/validate_cidr_mask.js b/src/legacy/ui/public/agg_types/__tests__/directives/validate_cidr_mask.js index 05dffe754a99..3d5d2531ee85 100644 --- a/src/legacy/ui/public/agg_types/__tests__/directives/validate_cidr_mask.js +++ b/src/legacy/ui/public/agg_types/__tests__/directives/validate_cidr_mask.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../directives/validate_cidr_mask'; diff --git a/src/legacy/ui/public/agg_types/__tests__/directives/validate_date_math.js b/src/legacy/ui/public/agg_types/__tests__/directives/validate_date_math.js index 39bab01c96f9..5f264386a1fb 100644 --- a/src/legacy/ui/public/agg_types/__tests__/directives/validate_date_math.js +++ b/src/legacy/ui/public/agg_types/__tests__/directives/validate_date_math.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../directives/validate_date_math'; diff --git a/src/legacy/ui/public/agg_types/__tests__/directives/validate_ip.js b/src/legacy/ui/public/agg_types/__tests__/directives/validate_ip.js index 625ff4183519..ad4c91e9081b 100644 --- a/src/legacy/ui/public/agg_types/__tests__/directives/validate_ip.js +++ b/src/legacy/ui/public/agg_types/__tests__/directives/validate_ip.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../directives/validate_ip'; diff --git a/src/legacy/ui/public/agg_types/__tests__/index.js b/src/legacy/ui/public/agg_types/__tests__/index.js index 0af05397cdc0..321fe0fa27f4 100644 --- a/src/legacy/ui/public/agg_types/__tests__/index.js +++ b/src/legacy/ui/public/agg_types/__tests__/index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import './agg_type'; import './agg_params'; import './buckets/_histogram'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/lib/make_nested_label.js b/src/legacy/ui/public/agg_types/__tests__/metrics/lib/make_nested_label.js index d5bff445dc13..f122a48c2931 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/lib/make_nested_label.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/lib/make_nested_label.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { makeNestedLabel } from '../../../metrics/lib/make_nested_label'; describe('metric agg make_nested_label', function () { diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/median.js b/src/legacy/ui/public/agg_types/__tests__/metrics/median.js index de81913494ba..eb1abd745011 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/median.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/median.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/parent_pipeline.js b/src/legacy/ui/public/agg_types/__tests__/metrics/parent_pipeline.js index 78a9ad4d1079..606080627d86 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/parent_pipeline.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/parent_pipeline.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; import { derivativeMetricAgg } from '../../metrics/derivative'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/percentile_ranks.js b/src/legacy/ui/public/agg_types/__tests__/metrics/percentile_ranks.js index ba0f8eef5ffb..3e3ee89b14d1 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/percentile_ranks.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/percentile_ranks.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { percentileRanksMetricAgg } from '../../metrics/percentile_ranks'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/percentiles.js b/src/legacy/ui/public/agg_types/__tests__/metrics/percentiles.js index b26ffe2168e6..cd790729783d 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/percentiles.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/percentiles.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { percentilesMetricAgg } from '../../metrics/percentiles'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/sibling_pipeline.js b/src/legacy/ui/public/agg_types/__tests__/metrics/sibling_pipeline.js index 43ae223eaf17..c80f7f6a9ad2 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/sibling_pipeline.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/sibling_pipeline.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; import { bucketSumMetricAgg } from '../../metrics/bucket_sum'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/std_deviation.js b/src/legacy/ui/public/agg_types/__tests__/metrics/std_deviation.js index c012d9c1f29d..181fc9e9b37c 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/std_deviation.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/std_deviation.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { stdDeviationMetricAgg } from '../../metrics/std_deviation'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/metrics/top_hit.js b/src/legacy/ui/public/agg_types/__tests__/metrics/top_hit.js index 01fc774b2d49..d206b8f47df9 100644 --- a/src/legacy/ui/public/agg_types/__tests__/metrics/top_hit.js +++ b/src/legacy/ui/public/agg_types/__tests__/metrics/top_hit.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { topHitMetricAgg } from '../../metrics/top_hit'; import { VisProvider } from '../../../vis'; diff --git a/src/legacy/ui/public/agg_types/__tests__/param_types/_field.js b/src/legacy/ui/public/agg_types/__tests__/param_types/_field.js index 01eab6866718..94a976f98e98 100644 --- a/src/legacy/ui/public/agg_types/__tests__/param_types/_field.js +++ b/src/legacy/ui/public/agg_types/__tests__/param_types/_field.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { reject } from 'lodash'; import ngMock from 'ng_mock'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/agg_types/__tests__/param_types/_json.js b/src/legacy/ui/public/agg_types/__tests__/param_types/_json.js index 516f1c95d71f..efac833cb061 100644 --- a/src/legacy/ui/public/agg_types/__tests__/param_types/_json.js +++ b/src/legacy/ui/public/agg_types/__tests__/param_types/_json.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { BaseParamType } from '../../param_types/base'; import { JsonParamType } from '../../param_types/json'; diff --git a/src/legacy/ui/public/agg_types/__tests__/param_types/_optioned.js b/src/legacy/ui/public/agg_types/__tests__/param_types/_optioned.js index 0491976665c7..4e66f6cfbd41 100644 --- a/src/legacy/ui/public/agg_types/__tests__/param_types/_optioned.js +++ b/src/legacy/ui/public/agg_types/__tests__/param_types/_optioned.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { BaseParamType } from '../../param_types/base'; import { OptionedParamType } from '../../param_types/optioned'; diff --git a/src/legacy/ui/public/agg_types/__tests__/param_types/_regex.js b/src/legacy/ui/public/agg_types/__tests__/param_types/_regex.js index acfb7d248f11..896a9241dbfc 100644 --- a/src/legacy/ui/public/agg_types/__tests__/param_types/_regex.js +++ b/src/legacy/ui/public/agg_types/__tests__/param_types/_regex.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { BaseParamType } from '../../param_types/base'; import { RegexParamType } from '../../param_types/regex'; diff --git a/src/legacy/ui/public/agg_types/__tests__/param_types/_string.js b/src/legacy/ui/public/agg_types/__tests__/param_types/_string.js index e11c50077a9c..261b97427980 100644 --- a/src/legacy/ui/public/agg_types/__tests__/param_types/_string.js +++ b/src/legacy/ui/public/agg_types/__tests__/param_types/_string.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { BaseParamType } from '../../param_types/base'; import { StringParamType } from '../../param_types/string'; diff --git a/src/legacy/ui/public/bind/__tests__/bind.js b/src/legacy/ui/public/bind/__tests__/bind.js index ce59076df923..e439ea7dbcdd 100644 --- a/src/legacy/ui/public/bind/__tests__/bind.js +++ b/src/legacy/ui/public/bind/__tests__/bind.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('$scope.$bind', function () { diff --git a/src/legacy/ui/public/binder/__tests__/binder.js b/src/legacy/ui/public/binder/__tests__/binder.js index 3a0ddff2137a..703b9ec41331 100644 --- a/src/legacy/ui/public/binder/__tests__/binder.js +++ b/src/legacy/ui/public/binder/__tests__/binder.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { Binder } from '..'; diff --git a/src/legacy/ui/public/chrome/__tests__/nav_controls.js b/src/legacy/ui/public/chrome/__tests__/nav_controls.js index cf664b943190..9d43d8324870 100644 --- a/src/legacy/ui/public/chrome/__tests__/nav_controls.js +++ b/src/legacy/ui/public/chrome/__tests__/nav_controls.js @@ -19,7 +19,7 @@ import ngMock from 'ng_mock'; import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { chromeNavControlsRegistry } from '../../registry/chrome_nav_controls'; import { uiRegistry } from '../../registry/_registry'; diff --git a/src/legacy/ui/public/chrome/api/__tests__/apps.js b/src/legacy/ui/public/chrome/api/__tests__/apps.js index e640d1717c2c..8515332efa36 100644 --- a/src/legacy/ui/public/chrome/api/__tests__/apps.js +++ b/src/legacy/ui/public/chrome/api/__tests__/apps.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import setup from '../apps'; diff --git a/src/legacy/ui/public/chrome/api/__tests__/nav.js b/src/legacy/ui/public/chrome/api/__tests__/nav.js index 4b42c33ec822..faf43058259e 100644 --- a/src/legacy/ui/public/chrome/api/__tests__/nav.js +++ b/src/legacy/ui/public/chrome/api/__tests__/nav.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { initChromeNavApi } from '../nav'; import { StubBrowserStorage } from 'test_utils/stub_browser_storage'; diff --git a/src/legacy/ui/public/chrome/api/__tests__/xsrf.js b/src/legacy/ui/public/chrome/api/__tests__/xsrf.js index 27b8a400adf4..52da8fb545c7 100644 --- a/src/legacy/ui/public/chrome/api/__tests__/xsrf.js +++ b/src/legacy/ui/public/chrome/api/__tests__/xsrf.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; diff --git a/src/legacy/ui/public/chrome/directives/__tests__/sub_url_route_filter.js b/src/legacy/ui/public/chrome/directives/__tests__/sub_url_route_filter.js index fc411b5638b3..5ce42b9c7291 100644 --- a/src/legacy/ui/public/chrome/directives/__tests__/sub_url_route_filter.js +++ b/src/legacy/ui/public/chrome/directives/__tests__/sub_url_route_filter.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SubUrlRouteFilterProvider } from '../sub_url_route_filter'; diff --git a/src/legacy/ui/public/config/__tests__/config.js b/src/legacy/ui/public/config/__tests__/config.js index 55dcbd65880f..52a573417f3c 100644 --- a/src/legacy/ui/public/config/__tests__/config.js +++ b/src/legacy/ui/public/config/__tests__/config.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; diff --git a/src/legacy/ui/public/courier/fetch/__tests__/call_client.js b/src/legacy/ui/public/courier/fetch/__tests__/call_client.js index ec261d65dd6f..bdaef283f2d3 100644 --- a/src/legacy/ui/public/courier/fetch/__tests__/call_client.js +++ b/src/legacy/ui/public/courier/fetch/__tests__/call_client.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import NoDigestPromises from 'test_utils/no_digest_promises'; import { delay } from 'bluebird'; diff --git a/src/legacy/ui/public/courier/fetch/__tests__/fetch_now.js b/src/legacy/ui/public/courier/fetch/__tests__/fetch_now.js index 079a7893785f..19032ce1f4ca 100644 --- a/src/legacy/ui/public/courier/fetch/__tests__/fetch_now.js +++ b/src/legacy/ui/public/courier/fetch/__tests__/fetch_now.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { CallClientProvider } from '../call_client'; diff --git a/src/legacy/ui/public/courier/fetch/request/search_request/__tests__/search_request.js b/src/legacy/ui/public/courier/fetch/request/search_request/__tests__/search_request.js index aeddc6e06545..ecac8cd47409 100644 --- a/src/legacy/ui/public/courier/fetch/request/search_request/__tests__/search_request.js +++ b/src/legacy/ui/public/courier/fetch/request/search_request/__tests__/search_request.js @@ -19,7 +19,7 @@ import ngMock from 'ng_mock'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SearchRequestProvider } from '../search_request'; import { searchRequestQueue } from '../../../../search_request_queue'; diff --git a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.create_queue.js b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.create_queue.js index 714bbb340969..80f0ce3309a4 100644 --- a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.create_queue.js +++ b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.create_queue.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import StubbedSearchSourceProvider from 'fixtures/stubbed_search_source'; diff --git a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.index_selection.js b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.index_selection.js index b1cc13d057f9..6914e9338028 100644 --- a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.index_selection.js +++ b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.index_selection.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { times } from 'lodash'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.js b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.js index b875e57e5d3c..33b8140b746f 100644 --- a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.js +++ b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { SegmentedSearchRequestProvider } from '../segmented_search_request'; diff --git a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.size_picking.js b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.size_picking.js index b882b3ae5fed..7b499fbd87e0 100644 --- a/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.size_picking.js +++ b/src/legacy/ui/public/courier/fetch/request/segmented_search_request/__tests__/segmented_search_request.size_picking.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import HitSortFnProv from 'plugins/kibana/discover/_hit_sort_fn'; import NoDigestPromises from 'test_utils/no_digest_promises'; diff --git a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js b/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js index 84548e662675..47c50d726c9f 100644 --- a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js +++ b/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import StubIndexPatternProvider from 'test_utils/stub_index_pattern'; diff --git a/src/legacy/ui/public/courier/search_request_queue/__tests__/search_request_queue.js b/src/legacy/ui/public/courier/search_request_queue/__tests__/search_request_queue.js index 434894e07c21..f6b4e4bef20c 100644 --- a/src/legacy/ui/public/courier/search_request_queue/__tests__/search_request_queue.js +++ b/src/legacy/ui/public/courier/search_request_queue/__tests__/search_request_queue.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { searchRequestQueue } from '../search_request_queue'; diff --git a/src/legacy/ui/public/courier/search_source/__tests__/normalize_sort_request.js b/src/legacy/ui/public/courier/search_source/__tests__/normalize_sort_request.js index 810f9cf04549..2358fdb52071 100644 --- a/src/legacy/ui/public/courier/search_source/__tests__/normalize_sort_request.js +++ b/src/legacy/ui/public/courier/search_source/__tests__/normalize_sort_request.js @@ -19,7 +19,7 @@ import '../../../private'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { NormalizeSortRequestProvider } from '../_normalize_sort_request'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/courier/search_source/__tests__/search_source.js b/src/legacy/ui/public/courier/search_source/__tests__/search_source.js index 2034c63e0605..8297c751da5f 100644 --- a/src/legacy/ui/public/courier/search_source/__tests__/search_source.js +++ b/src/legacy/ui/public/courier/search_source/__tests__/search_source.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { searchRequestQueue } from '../../search_request_queue'; diff --git a/src/legacy/ui/public/debounce/__tests__/debounce.js b/src/legacy/ui/public/debounce/__tests__/debounce.js index 5aa4233613ce..e5138643101f 100644 --- a/src/legacy/ui/public/debounce/__tests__/debounce.js +++ b/src/legacy/ui/public/debounce/__tests__/debounce.js @@ -19,7 +19,7 @@ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { DebounceProvider } from '..'; diff --git a/src/legacy/ui/public/directives/__tests__/css_truncate.js b/src/legacy/ui/public/directives/__tests__/css_truncate.js index 3c851a7df684..ec46448962dc 100644 --- a/src/legacy/ui/public/directives/__tests__/css_truncate.js +++ b/src/legacy/ui/public/directives/__tests__/css_truncate.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/directives/__tests__/fixed_scroll.js b/src/legacy/ui/public/directives/__tests__/fixed_scroll.js index cec917cf4d1f..651e3af550e4 100644 --- a/src/legacy/ui/public/directives/__tests__/fixed_scroll.js +++ b/src/legacy/ui/public/directives/__tests__/fixed_scroll.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../fixed_scroll'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/directives/__tests__/inequality.js b/src/legacy/ui/public/directives/__tests__/inequality.js index a513520e4979..d503d406fdbf 100644 --- a/src/legacy/ui/public/directives/__tests__/inequality.js +++ b/src/legacy/ui/public/directives/__tests__/inequality.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../inequality'; diff --git a/src/legacy/ui/public/directives/__tests__/input_focus.js b/src/legacy/ui/public/directives/__tests__/input_focus.js index 9b1bbe25c844..5336c01d74d8 100644 --- a/src/legacy/ui/public/directives/__tests__/input_focus.js +++ b/src/legacy/ui/public/directives/__tests__/input_focus.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import $ from 'jquery'; import '../input_focus'; diff --git a/src/legacy/ui/public/directives/__tests__/json_input.js b/src/legacy/ui/public/directives/__tests__/json_input.js index 43ecea162f16..b2ad6c8c4732 100644 --- a/src/legacy/ui/public/directives/__tests__/json_input.js +++ b/src/legacy/ui/public/directives/__tests__/json_input.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../json_input'; diff --git a/src/legacy/ui/public/directives/__tests__/paginated_selectable_list.js b/src/legacy/ui/public/directives/__tests__/paginated_selectable_list.js index 5246cc3568fd..319b16c6a323 100644 --- a/src/legacy/ui/public/directives/__tests__/paginated_selectable_list.js +++ b/src/legacy/ui/public/directives/__tests__/paginated_selectable_list.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/directives/__tests__/parse_query.js b/src/legacy/ui/public/directives/__tests__/parse_query.js index 3239bbceae24..12d9d1205328 100644 --- a/src/legacy/ui/public/directives/__tests__/parse_query.js +++ b/src/legacy/ui/public/directives/__tests__/parse_query.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; // Load the kibana app dependencies. diff --git a/src/legacy/ui/public/directives/__tests__/truncate.js b/src/legacy/ui/public/directives/__tests__/truncate.js index 864db6380569..7cf0d2e3799b 100644 --- a/src/legacy/ui/public/directives/__tests__/truncate.js +++ b/src/legacy/ui/public/directives/__tests__/truncate.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/directives/__tests__/validate_json.js b/src/legacy/ui/public/directives/__tests__/validate_json.js index b59ee7bccf7e..dd533851ac4d 100644 --- a/src/legacy/ui/public/directives/__tests__/validate_json.js +++ b/src/legacy/ui/public/directives/__tests__/validate_json.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../validate_json'; diff --git a/src/legacy/ui/public/doc_table/__tests__/actions/filter.js b/src/legacy/ui/public/doc_table/__tests__/actions/filter.js index 4a050797f94f..496ec7dc8739 100644 --- a/src/legacy/ui/public/doc_table/__tests__/actions/filter.js +++ b/src/legacy/ui/public/doc_table/__tests__/actions/filter.js @@ -21,7 +21,7 @@ import { addFilter } from '../../actions/filter'; import { FilterManagerProvider } from '../../../filter_manager'; import StubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import NoDigestPromises from 'test_utils/no_digest_promises'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/doc_table/__tests__/doc_table.js b/src/legacy/ui/public/doc_table/__tests__/doc_table.js index 5395ddb4f216..56cd15b66b37 100644 --- a/src/legacy/ui/public/doc_table/__tests__/doc_table.js +++ b/src/legacy/ui/public/doc_table/__tests__/doc_table.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import ngMock from 'ng_mock'; import '../../private'; diff --git a/src/legacy/ui/public/doc_table/__tests__/lib/get_sort.js b/src/legacy/ui/public/doc_table/__tests__/lib/get_sort.js index 3ea586f45799..bec26d38d0fa 100644 --- a/src/legacy/ui/public/doc_table/__tests__/lib/get_sort.js +++ b/src/legacy/ui/public/doc_table/__tests__/lib/get_sort.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { getSort } from '../../lib/get_sort'; diff --git a/src/legacy/ui/public/doc_table/__tests__/lib/rows_headers.js b/src/legacy/ui/public/doc_table/__tests__/lib/rows_headers.js index 1cbe730aace3..b2660facf7a5 100644 --- a/src/legacy/ui/public/doc_table/__tests__/lib/rows_headers.js +++ b/src/legacy/ui/public/doc_table/__tests__/lib/rows_headers.js @@ -20,7 +20,7 @@ import angular from 'angular'; import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { getFakeRow, getFakeRowVals } from 'fixtures/fake_row'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/doc_title/__tests__/doc_title.js b/src/legacy/ui/public/doc_title/__tests__/doc_title.js index 4c459a17a6c6..2c0ec6766cb1 100644 --- a/src/legacy/ui/public/doc_title/__tests__/doc_title.js +++ b/src/legacy/ui/public/doc_title/__tests__/doc_title.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { DocTitleProvider } from '..'; diff --git a/src/legacy/ui/public/doc_viewer/__tests__/doc_viewer.js b/src/legacy/ui/public/doc_viewer/__tests__/doc_viewer.js index e55718374be1..b6ba1f7206a1 100644 --- a/src/legacy/ui/public/doc_viewer/__tests__/doc_viewer.js +++ b/src/legacy/ui/public/doc_viewer/__tests__/doc_viewer.js @@ -19,7 +19,7 @@ import angular from 'angular'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../private'; diff --git a/src/legacy/ui/public/documentation_links/__tests__/documentation_links.js b/src/legacy/ui/public/documentation_links/__tests__/documentation_links.js index 22e6d8ecfbff..60ab7a03576c 100644 --- a/src/legacy/ui/public/documentation_links/__tests__/documentation_links.js +++ b/src/legacy/ui/public/documentation_links/__tests__/documentation_links.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { documentationLinks } from '../documentation_links'; import { metadata } from '../../metadata'; diff --git a/src/legacy/ui/public/draggable/__tests__/draggable.js b/src/legacy/ui/public/draggable/__tests__/draggable.js index 8cba8a8ebb11..fc0601a9b67e 100644 --- a/src/legacy/ui/public/draggable/__tests__/draggable.js +++ b/src/legacy/ui/public/draggable/__tests__/draggable.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; let init; diff --git a/src/legacy/ui/public/error_url_overflow/__tests__/ie_regex.js b/src/legacy/ui/public/error_url_overflow/__tests__/ie_regex.js index 75d114e397fb..48b92b79c0b7 100644 --- a/src/legacy/ui/public/error_url_overflow/__tests__/ie_regex.js +++ b/src/legacy/ui/public/error_url_overflow/__tests__/ie_regex.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { IE_REGEX } from '../url_overflow_service.js'; describe('IE_REGEX', () => { diff --git a/src/legacy/ui/public/factories/__tests__/base_object.js b/src/legacy/ui/public/factories/__tests__/base_object.js index 913f647db336..5e94cd8fb462 100644 --- a/src/legacy/ui/public/factories/__tests__/base_object.js +++ b/src/legacy/ui/public/factories/__tests__/base_object.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../private'; diff --git a/src/legacy/ui/public/factories/__tests__/events.js b/src/legacy/ui/public/factories/__tests__/events.js index c9ba7f579854..38fcd642fcdd 100644 --- a/src/legacy/ui/public/factories/__tests__/events.js +++ b/src/legacy/ui/public/factories/__tests__/events.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../../private'; import { EventsProvider } from '../../events'; diff --git a/src/legacy/ui/public/fancy_forms/__tests__/fancy_forms.js b/src/legacy/ui/public/fancy_forms/__tests__/fancy_forms.js index 401255ba44d6..4e1cbb2595c2 100644 --- a/src/legacy/ui/public/fancy_forms/__tests__/fancy_forms.js +++ b/src/legacy/ui/public/fancy_forms/__tests__/fancy_forms.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; describe('fancy forms', function () { diff --git a/src/legacy/ui/public/fancy_forms/__tests__/nested_fancy_forms.js b/src/legacy/ui/public/fancy_forms/__tests__/nested_fancy_forms.js index 005e6441b03a..1d8cda79d10f 100644 --- a/src/legacy/ui/public/fancy_forms/__tests__/nested_fancy_forms.js +++ b/src/legacy/ui/public/fancy_forms/__tests__/nested_fancy_forms.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/field_wildcard/__tests__/field_wildcard.js b/src/legacy/ui/public/field_wildcard/__tests__/field_wildcard.js index 0bd5fe8e8ed7..aeffdbc8bfa6 100644 --- a/src/legacy/ui/public/field_wildcard/__tests__/field_wildcard.js +++ b/src/legacy/ui/public/field_wildcard/__tests__/field_wildcard.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FieldWildcardProvider } from '../../field_wildcard'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_add_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_add_filters.js index faa2378ad8bf..49fbafdf4ee9 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_add_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_add_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import MockState from 'fixtures/mock_state'; import { FilterBarQueryFilterProvider } from '../query_filter'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_get_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_get_filters.js index 5b0abd9efcdf..3805ce1ccaf1 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_get_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_get_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import MockState from 'fixtures/mock_state'; import { FilterBarQueryFilterProvider } from '../query_filter'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_invert_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_invert_filters.js index 06e6ccea2eca..e705cf22cf7f 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_invert_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_invert_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import MockState from 'fixtures/mock_state'; import { FilterBarQueryFilterProvider } from '../query_filter'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_pin_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_pin_filters.js index d200cbec52c4..2c9eb4f730ad 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_pin_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_pin_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import MockState from 'fixtures/mock_state'; import { FilterBarQueryFilterProvider } from '../query_filter'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_remove_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_remove_filters.js index 617a56da4c03..a723031f67c4 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_remove_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_remove_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import MockState from 'fixtures/mock_state'; import { FilterBarQueryFilterProvider } from '../query_filter'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/_toggle_filters.js b/src/legacy/ui/public/filter_bar/__tests__/_toggle_filters.js index 0fe5be25a12e..d1eb26641a77 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/_toggle_filters.js +++ b/src/legacy/ui/public/filter_bar/__tests__/_toggle_filters.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import MockState from 'fixtures/mock_state'; diff --git a/src/legacy/ui/public/filter_bar/__tests__/push_filter.js b/src/legacy/ui/public/filter_bar/__tests__/push_filter.js index 7d8e38b8af7f..81b418e5665c 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/push_filter.js +++ b/src/legacy/ui/public/filter_bar/__tests__/push_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarPushFilterProvider } from '../push_filter'; describe('Filter Bar pushFilter()', function () { diff --git a/src/legacy/ui/public/filter_bar/__tests__/query_filter.js b/src/legacy/ui/public/filter_bar/__tests__/query_filter.js index e3d8a0e8b61d..9e5d3b8973c0 100644 --- a/src/legacy/ui/public/filter_bar/__tests__/query_filter.js +++ b/src/legacy/ui/public/filter_bar/__tests__/query_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import './_get_filters'; import './_add_filters'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/change_time_filter.test.js b/src/legacy/ui/public/filter_bar/lib/__tests__/change_time_filter.test.js index b9916c1f08a0..52c54a4937cc 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/change_time_filter.test.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/change_time_filter.test.js @@ -36,7 +36,7 @@ jest.mock('ui/chrome', }, }), { virtual: true }); -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { changeTimeFilter } from '../change_time_filter'; import { timefilter } from 'ui/timefilter'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/dedup_filters.js b/src/legacy/ui/public/filter_bar/lib/__tests__/dedup_filters.js index 9b6b56f8f2c1..cbe511b326c0 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/dedup_filters.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/dedup_filters.js @@ -18,7 +18,7 @@ */ import { dedupFilters } from '../dedup_filters'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Filter Bar Directive', function () { describe('dedupFilters(existing, filters)', function () { diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/extract_time_filter.js b/src/legacy/ui/public/filter_bar/lib/__tests__/extract_time_filter.js index da85160ef194..970d17552684 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/extract_time_filter.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/extract_time_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibExtractTimeFilterProvider } from '../extract_time_filter'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/generate_mapping_chain.js b/src/legacy/ui/public/filter_bar/lib/__tests__/generate_mapping_chain.js index bcf682918478..49f70b457f99 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/generate_mapping_chain.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/generate_mapping_chain.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibGenerateMappingChainProvider } from '../generate_mapping_chain'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_and_flatten_filters.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_and_flatten_filters.js index e09da2a0baed..f979c4fd1450 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_and_flatten_filters.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_and_flatten_filters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapAndFlattenFiltersProvider } from '../map_and_flatten_filters'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_default.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_default.js index 52400ceeb2a2..e22f4639d97e 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_default.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_default.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapDefaultProvider } from '../map_default'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_exists.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_exists.js index 8a36d5cf82af..f0b09da6ba68 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_exists.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_exists.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapExistsProvider } from '../map_exists'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_filter.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_filter.js index e15baab9e118..0e307e2669ac 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_filter.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapFilterProvider } from '../map_filter'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_flatten_and_wrap_filters.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_flatten_and_wrap_filters.js index 7f71845deed9..8b0ca4715d28 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_flatten_and_wrap_filters.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_flatten_and_wrap_filters.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapFlattenAndWrapFiltersProvider } from '../map_flatten_and_wrap_filters'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_bounding_box.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_bounding_box.js index 0a61d20f3ba3..6f9d757f4b9b 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_bounding_box.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_bounding_box.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapGeoBoundingBoxProvider } from '../map_geo_bounding_box'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_polygon.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_polygon.js index 9f501d68c1c9..6b17ac5b6b69 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_polygon.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_geo_polygon.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapGeoPolygonProvider } from '../map_geo_polygon'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_match_all.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_match_all.js index d092e6d7979c..b12128929903 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_match_all.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_match_all.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapMatchAllProvider } from '../map_match_all'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_missing.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_missing.js index 551898c8fbdd..005b8883be51 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_missing.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_missing.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FilterBarLibMapMissingProvider } from '../map_missing'; describe('Filter Bar Directive', function () { diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_phrase.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_phrase.js index 0e646088a2df..4a0262d93a19 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_phrase.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_phrase.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapPhraseProvider } from '../map_phrase'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_query_string.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_query_string.js index a0d7a8f5b287..056ba8b8a7de 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_query_string.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_query_string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapQueryStringProvider } from '../map_query_string'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/map_range.js b/src/legacy/ui/public/filter_bar/lib/__tests__/map_range.js index 9ec5725be2b2..866a69275117 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/map_range.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/map_range.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterBarLibMapRangeProvider } from '../map_range'; diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/only_disabled.js b/src/legacy/ui/public/filter_bar/lib/__tests__/only_disabled.js index 7bc9c6c58d2e..a6f4c74a70ba 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/only_disabled.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/only_disabled.js @@ -18,7 +18,7 @@ */ import { onlyDisabled } from '../only_disabled'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Filter Bar Directive', function () { describe('onlyDisabled()', function () { diff --git a/src/legacy/ui/public/filter_bar/lib/__tests__/uniq_filters.js b/src/legacy/ui/public/filter_bar/lib/__tests__/uniq_filters.js index e42cc71485ab..569f03f28192 100644 --- a/src/legacy/ui/public/filter_bar/lib/__tests__/uniq_filters.js +++ b/src/legacy/ui/public/filter_bar/lib/__tests__/uniq_filters.js @@ -18,7 +18,7 @@ */ import { uniqFilters } from '../uniq_filters'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Filter Bar Directive', function () { describe('uniqFilter', function () { diff --git a/src/legacy/ui/public/filter_manager/__tests__/filter_manager.js b/src/legacy/ui/public/filter_manager/__tests__/filter_manager.js index 87a0ed052a1c..f1f374e0a7c3 100644 --- a/src/legacy/ui/public/filter_manager/__tests__/filter_manager.js +++ b/src/legacy/ui/public/filter_manager/__tests__/filter_manager.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import sinon from 'sinon'; import MockState from 'fixtures/mock_state'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { FilterManagerProvider } from '..'; import { FilterBarQueryFilterProvider } from '../../filter_bar/query_filter'; diff --git a/src/legacy/ui/public/filters/__tests__/comma_list.js b/src/legacy/ui/public/filters/__tests__/comma_list.js index ec1333b1c616..f5b155b989ac 100644 --- a/src/legacy/ui/public/filters/__tests__/comma_list.js +++ b/src/legacy/ui/public/filters/__tests__/comma_list.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../comma_list'; diff --git a/src/legacy/ui/public/filters/__tests__/field_type.js b/src/legacy/ui/public/filters/__tests__/field_type.js index da1b5f3537d5..0b969095eb49 100644 --- a/src/legacy/ui/public/filters/__tests__/field_type.js +++ b/src/legacy/ui/public/filters/__tests__/field_type.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/filters/__tests__/label.js b/src/legacy/ui/public/filters/__tests__/label.js index 7f702896b58c..169641522974 100644 --- a/src/legacy/ui/public/filters/__tests__/label.js +++ b/src/legacy/ui/public/filters/__tests__/label.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/filters/__tests__/moment.js b/src/legacy/ui/public/filters/__tests__/moment.js index e3550df031ee..39d7a520851d 100644 --- a/src/legacy/ui/public/filters/__tests__/moment.js +++ b/src/legacy/ui/public/filters/__tests__/moment.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import moment from 'moment'; import ngMock from 'ng_mock'; diff --git a/src/legacy/ui/public/filters/__tests__/prop_filter.js b/src/legacy/ui/public/filters/__tests__/prop_filter.js index 2b125c47c408..ec60121960ec 100644 --- a/src/legacy/ui/public/filters/__tests__/prop_filter.js +++ b/src/legacy/ui/public/filters/__tests__/prop_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { propFilter } from '../_prop_filter'; describe('prop filter', function () { diff --git a/src/legacy/ui/public/filters/__tests__/rison.js b/src/legacy/ui/public/filters/__tests__/rison.js index 671ef5debc65..62accfa8118a 100644 --- a/src/legacy/ui/public/filters/__tests__/rison.js +++ b/src/legacy/ui/public/filters/__tests__/rison.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/filters/__tests__/short_dots.js b/src/legacy/ui/public/filters/__tests__/short_dots.js index 2d23715f7a9e..747c2c280750 100644 --- a/src/legacy/ui/public/filters/__tests__/short_dots.js +++ b/src/legacy/ui/public/filters/__tests__/short_dots.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; import '../short_dots'; diff --git a/src/legacy/ui/public/filters/__tests__/start_from.js b/src/legacy/ui/public/filters/__tests__/start_from.js index 4b9304277911..389522bcbf94 100644 --- a/src/legacy/ui/public/filters/__tests__/start_from.js +++ b/src/legacy/ui/public/filters/__tests__/start_from.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../start_from'; diff --git a/src/legacy/ui/public/filters/__tests__/uriescape.js b/src/legacy/ui/public/filters/__tests__/uriescape.js index 2e9e14d3b078..49a703459382 100644 --- a/src/legacy/ui/public/filters/__tests__/uriescape.js +++ b/src/legacy/ui/public/filters/__tests__/uriescape.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import 'plugins/kibana/discover/index'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/_get_computed_fields.js b/src/legacy/ui/public/index_patterns/__tests__/_get_computed_fields.js index 101032413cc2..3d5fd961c9b5 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/_get_computed_fields.js +++ b/src/legacy/ui/public/index_patterns/__tests__/_get_computed_fields.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import { getComputedFields } from '../_get_computed_fields'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/_index_pattern.js b/src/legacy/ui/public/index_patterns/__tests__/_index_pattern.js index 023e61bdf8a0..bf1234e95f9f 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/_index_pattern.js +++ b/src/legacy/ui/public/index_patterns/__tests__/_index_pattern.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import sinon from 'sinon'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Promise from 'bluebird'; import { DuplicateField } from '../../errors'; import { IndexedArray } from '../../indexed_array'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/flatten_hit.js b/src/legacy/ui/public/index_patterns/__tests__/flatten_hit.js index 5615edad3453..6470c0ae0474 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/flatten_hit.js +++ b/src/legacy/ui/public/index_patterns/__tests__/flatten_hit.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { IndexPatternsFlattenHitProvider } from '../_flatten_hit'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/index_patterns.js b/src/legacy/ui/public/index_patterns/__tests__/index_patterns.js index 6b32674b5e3e..5a6cf3ba51c6 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/index_patterns.js +++ b/src/legacy/ui/public/index_patterns/__tests__/index_patterns.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { IndexPatternProvider } from '../_index_pattern'; import { IndexPatternsProvider } from '../index_patterns'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/intervals.js b/src/legacy/ui/public/index_patterns/__tests__/intervals.js index 07e4ec81e209..cc2ba5d5f474 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/intervals.js +++ b/src/legacy/ui/public/index_patterns/__tests__/intervals.js @@ -18,7 +18,7 @@ */ import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { IndexPatternsIntervalsProvider } from '../_intervals'; diff --git a/src/legacy/ui/public/index_patterns/__tests__/unsupported_time_patterns.js b/src/legacy/ui/public/index_patterns/__tests__/unsupported_time_patterns.js index 1a6c47259371..a3af1332136a 100644 --- a/src/legacy/ui/public/index_patterns/__tests__/unsupported_time_patterns.js +++ b/src/legacy/ui/public/index_patterns/__tests__/unsupported_time_patterns.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Chance from 'chance'; import { Storage } from '../../storage'; diff --git a/src/legacy/ui/public/index_patterns/static_utils/__tests__/index.js b/src/legacy/ui/public/index_patterns/static_utils/__tests__/index.js index e825df5d294c..04503be6f7f7 100644 --- a/src/legacy/ui/public/index_patterns/static_utils/__tests__/index.js +++ b/src/legacy/ui/public/index_patterns/static_utils/__tests__/index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isFilterable } from '../index'; const mockField = { diff --git a/src/legacy/ui/public/indexed_array/__tests__/indexed_array.js b/src/legacy/ui/public/indexed_array/__tests__/indexed_array.js index 66966fe09519..ccce39cdfa4d 100644 --- a/src/legacy/ui/public/indexed_array/__tests__/indexed_array.js +++ b/src/legacy/ui/public/indexed_array/__tests__/indexed_array.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { IndexedArray } from '..'; // this is generally a data-structure that IndexedArray is good for managing diff --git a/src/legacy/ui/public/indexed_array/__tests__/inflector.js b/src/legacy/ui/public/indexed_array/__tests__/inflector.js index ffdbbee36108..49ac79094e50 100644 --- a/src/legacy/ui/public/indexed_array/__tests__/inflector.js +++ b/src/legacy/ui/public/indexed_array/__tests__/inflector.js @@ -18,7 +18,7 @@ */ import { inflector } from '../inflector'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('IndexedArray Inflector', function () { it('returns a function', function () { diff --git a/src/legacy/ui/public/jquery/__tests__/find_test_subject.js b/src/legacy/ui/public/jquery/__tests__/find_test_subject.js index 96cda4a550ef..6fc781fcabc5 100644 --- a/src/legacy/ui/public/jquery/__tests__/find_test_subject.js +++ b/src/legacy/ui/public/jquery/__tests__/find_test_subject.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; function $make(subject) { diff --git a/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav.js b/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav.js index 953e903bb414..6aff951f581e 100644 --- a/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav.js +++ b/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { assign, pluck } from 'lodash'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js b/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js index ec1a82349eed..e0ad7ecceb9c 100644 --- a/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js +++ b/src/legacy/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { pluck } from 'lodash'; import sinon from 'sinon'; import { KbnTopNavControllerProvider } from '../kbn_top_nav_controller'; diff --git a/src/legacy/ui/public/listen/__tests__/listen.js b/src/legacy/ui/public/listen/__tests__/listen.js index a82c791016ee..84838549b2a3 100644 --- a/src/legacy/ui/public/listen/__tests__/listen.js +++ b/src/legacy/ui/public/listen/__tests__/listen.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '..'; import { EventsProvider } from '../../events'; diff --git a/src/legacy/ui/public/management/__tests__/index.js b/src/legacy/ui/public/management/__tests__/index.js index 1fbfe74bb796..6c794b3c189f 100644 --- a/src/legacy/ui/public/management/__tests__/index.js +++ b/src/legacy/ui/public/management/__tests__/index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { management } from '..'; import { ManagementSection } from '../section'; diff --git a/src/legacy/ui/public/management/__tests__/section.js b/src/legacy/ui/public/management/__tests__/section.js index 4f21b0b2caa5..cc49d346213d 100644 --- a/src/legacy/ui/public/management/__tests__/section.js +++ b/src/legacy/ui/public/management/__tests__/section.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ManagementSection } from '../section'; import { IndexedArray } from '../../indexed_array'; diff --git a/src/legacy/ui/public/modals/__tests__/confirm_modal.js b/src/legacy/ui/public/modals/__tests__/confirm_modal.js index c700e6bf2b8a..83b0155607f2 100644 --- a/src/legacy/ui/public/modals/__tests__/confirm_modal.js +++ b/src/legacy/ui/public/modals/__tests__/confirm_modal.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/modals/__tests__/confirm_modal_promise.js b/src/legacy/ui/public/modals/__tests__/confirm_modal_promise.js index 016617b80bf3..f5fabfd5e93a 100644 --- a/src/legacy/ui/public/modals/__tests__/confirm_modal_promise.js +++ b/src/legacy/ui/public/modals/__tests__/confirm_modal_promise.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/notify/__tests__/notifier.js b/src/legacy/ui/public/notify/__tests__/notifier.js index 6e4b101e59f6..f12a1e917cc0 100644 --- a/src/legacy/ui/public/notify/__tests__/notifier.js +++ b/src/legacy/ui/public/notify/__tests__/notifier.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { Notifier } from '..'; import { metadata } from 'ui/metadata'; diff --git a/src/legacy/ui/public/notify/lib/format_es_msg.test.js b/src/legacy/ui/public/notify/lib/format_es_msg.test.js index 4df4f54f1796..b6484a23f720 100644 --- a/src/legacy/ui/public/notify/lib/format_es_msg.test.js +++ b/src/legacy/ui/public/notify/lib/format_es_msg.test.js @@ -18,7 +18,7 @@ */ import { formatESMsg } from './format_es_msg'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('formatESMsg', () => { test('should return undefined if passed a basic error', () => { diff --git a/src/legacy/ui/public/notify/lib/format_msg.test.js b/src/legacy/ui/public/notify/lib/format_msg.test.js index 96e532bfa54b..d58b97455e8e 100644 --- a/src/legacy/ui/public/notify/lib/format_msg.test.js +++ b/src/legacy/ui/public/notify/lib/format_msg.test.js @@ -18,7 +18,7 @@ */ import { formatMsg } from './format_msg'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('formatMsg', () => { test('should prepend the second argument to result', () => { diff --git a/src/legacy/ui/public/paginated_table/__tests__/index.js b/src/legacy/ui/public/paginated_table/__tests__/index.js index 2a8ab16b6b0f..dcaed4246403 100644 --- a/src/legacy/ui/public/paginated_table/__tests__/index.js +++ b/src/legacy/ui/public/paginated_table/__tests__/index.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '..'; import $ from 'jquery'; diff --git a/src/legacy/ui/public/persisted_state/__tests__/persisted_state_provider.js b/src/legacy/ui/public/persisted_state/__tests__/persisted_state_provider.js index 420fc5dff4fb..7300bd159337 100644 --- a/src/legacy/ui/public/persisted_state/__tests__/persisted_state_provider.js +++ b/src/legacy/ui/public/persisted_state/__tests__/persisted_state_provider.js @@ -21,7 +21,7 @@ import _ from 'lodash'; import sinon from 'sinon'; import noDigestPromises from 'test_utils/no_digest_promises'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PersistedStateError } from '../../errors'; import '..'; diff --git a/src/legacy/ui/public/private/__tests__/private.js b/src/legacy/ui/public/private/__tests__/private.js index 297016d77ad1..d0859bb00bad 100644 --- a/src/legacy/ui/public/private/__tests__/private.js +++ b/src/legacy/ui/public/private/__tests__/private.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('Private module loader', function () { diff --git a/src/legacy/ui/public/promises/__tests__/promises.js b/src/legacy/ui/public/promises/__tests__/promises.js index b0f6971784b4..85c5835637b8 100644 --- a/src/legacy/ui/public/promises/__tests__/promises.js +++ b/src/legacy/ui/public/promises/__tests__/promises.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/registry/__tests__/registry.js b/src/legacy/ui/public/registry/__tests__/registry.js index e6bcaa3e94b0..56a19814058c 100644 --- a/src/legacy/ui/public/registry/__tests__/registry.js +++ b/src/legacy/ui/public/registry/__tests__/registry.js @@ -18,7 +18,7 @@ */ import { uiRegistry } from '../_registry'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('Registry', function () { diff --git a/src/legacy/ui/public/render_directive/__tests__/render_directive.js b/src/legacy/ui/public/render_directive/__tests__/render_directive.js index bea391e95469..ff7225271e30 100644 --- a/src/legacy/ui/public/render_directive/__tests__/render_directive.js +++ b/src/legacy/ui/public/render_directive/__tests__/render_directive.js @@ -19,7 +19,7 @@ import angular from 'angular'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '..'; diff --git a/src/legacy/ui/public/resize_checker/__tests__/resize_checker.js b/src/legacy/ui/public/resize_checker/__tests__/resize_checker.js index 50533ac3fb24..5fccf77f8f13 100644 --- a/src/legacy/ui/public/resize_checker/__tests__/resize_checker.js +++ b/src/legacy/ui/public/resize_checker/__tests__/resize_checker.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import { delay } from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import ngMock from 'ng_mock'; diff --git a/src/legacy/ui/public/routes/__tests__/_route_manager.js b/src/legacy/ui/public/routes/__tests__/_route_manager.js index 40a8a779ccb7..d6d4c869b4b7 100644 --- a/src/legacy/ui/public/routes/__tests__/_route_manager.js +++ b/src/legacy/ui/public/routes/__tests__/_route_manager.js @@ -21,7 +21,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import RouteManager from '../route_manager'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; let routes; // will contain an new instance of RouteManager for each test const chainableMethods = [ diff --git a/src/legacy/ui/public/routes/__tests__/_work_queue.js b/src/legacy/ui/public/routes/__tests__/_work_queue.js index bdbda577718b..f5ecebd8e596 100644 --- a/src/legacy/ui/public/routes/__tests__/_work_queue.js +++ b/src/legacy/ui/public/routes/__tests__/_work_queue.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { WorkQueue } from '../work_queue'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/routes/__tests__/_wrap_route_with_prep.js b/src/legacy/ui/public/routes/__tests__/_wrap_route_with_prep.js index aac016082ade..44b99a72b402 100644 --- a/src/legacy/ui/public/routes/__tests__/_wrap_route_with_prep.js +++ b/src/legacy/ui/public/routes/__tests__/_wrap_route_with_prep.js @@ -18,7 +18,7 @@ */ import RouteManager from '../route_manager'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/saved_objects/__tests__/find_object_by_title.js b/src/legacy/ui/public/saved_objects/__tests__/find_object_by_title.js index 7df77b43adde..6539f8c03413 100644 --- a/src/legacy/ui/public/saved_objects/__tests__/find_object_by_title.js +++ b/src/legacy/ui/public/saved_objects/__tests__/find_object_by_title.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { findObjectByTitle } from '../find_object_by_title'; import { SimpleSavedObject } from '../simple_saved_object'; diff --git a/src/legacy/ui/public/saved_objects/__tests__/saved_object.js b/src/legacy/ui/public/saved_objects/__tests__/saved_object.js index 7cfa41b30119..c7f3a3da6259 100644 --- a/src/legacy/ui/public/saved_objects/__tests__/saved_object.js +++ b/src/legacy/ui/public/saved_objects/__tests__/saved_object.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import BluebirdPromise from 'bluebird'; diff --git a/src/legacy/ui/public/saved_objects/__tests__/simple_saved_object.js b/src/legacy/ui/public/saved_objects/__tests__/simple_saved_object.js index 5fe05690c085..a6583b97972a 100644 --- a/src/legacy/ui/public/saved_objects/__tests__/simple_saved_object.js +++ b/src/legacy/ui/public/saved_objects/__tests__/simple_saved_object.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SimpleSavedObject } from '../simple_saved_object'; describe('SimpleSavedObject', () => { diff --git a/src/legacy/ui/public/share/lib/url_shortener.test.js b/src/legacy/ui/public/share/lib/url_shortener.test.js index 0c45220ff78d..859873bd4989 100644 --- a/src/legacy/ui/public/share/lib/url_shortener.test.js +++ b/src/legacy/ui/public/share/lib/url_shortener.test.js @@ -21,7 +21,7 @@ jest.mock('ui/kfetch', () => ({})); jest.mock('../../chrome', () => ({})); import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { shortenUrl } from './url_shortener'; describe('Url shortener', () => { diff --git a/src/legacy/ui/public/state_management/__tests__/app_state.js b/src/legacy/ui/public/state_management/__tests__/app_state.js index 9cc80b77b93a..6f59ba744a13 100644 --- a/src/legacy/ui/public/state_management/__tests__/app_state.js +++ b/src/legacy/ui/public/state_management/__tests__/app_state.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { AppStateProvider } from '../app_state'; diff --git a/src/legacy/ui/public/state_management/__tests__/config_provider.js b/src/legacy/ui/public/state_management/__tests__/config_provider.js index 13171e08909d..c16300cb7aa3 100644 --- a/src/legacy/ui/public/state_management/__tests__/config_provider.js +++ b/src/legacy/ui/public/state_management/__tests__/config_provider.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../config_provider'; diff --git a/src/legacy/ui/public/state_management/__tests__/global_state.js b/src/legacy/ui/public/state_management/__tests__/global_state.js index 76d0e0c2c282..10b127aa1b80 100644 --- a/src/legacy/ui/public/state_management/__tests__/global_state.js +++ b/src/legacy/ui/public/state_management/__tests__/global_state.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../global_state'; diff --git a/src/legacy/ui/public/state_management/__tests__/state.js b/src/legacy/ui/public/state_management/__tests__/state.js index 95e275471a1f..cbeb5e3650a1 100644 --- a/src/legacy/ui/public/state_management/__tests__/state.js +++ b/src/legacy/ui/public/state_management/__tests__/state.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { encode as encodeRison } from 'rison-node'; import '../../private'; diff --git a/src/legacy/ui/public/state_management/__tests__/state_monitor_factory.js b/src/legacy/ui/public/state_management/__tests__/state_monitor_factory.js index 581625f46305..75dd5024708a 100644 --- a/src/legacy/ui/public/state_management/__tests__/state_monitor_factory.js +++ b/src/legacy/ui/public/state_management/__tests__/state_monitor_factory.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { cloneDeep } from 'lodash'; import { stateMonitorFactory } from '../state_monitor_factory'; diff --git a/src/legacy/ui/public/state_management/state_hashing/__tests__/hash_url.js b/src/legacy/ui/public/state_management/state_hashing/__tests__/hash_url.js index 79641f3cf3c5..1d5b88a22d9c 100644 --- a/src/legacy/ui/public/state_management/state_hashing/__tests__/hash_url.js +++ b/src/legacy/ui/public/state_management/state_hashing/__tests__/hash_url.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import { parse as parseUrl } from 'url'; diff --git a/src/legacy/ui/public/state_management/state_hashing/__tests__/unhash_url.js b/src/legacy/ui/public/state_management/state_hashing/__tests__/unhash_url.js index 7a3cb67e0d73..671194ecb50f 100644 --- a/src/legacy/ui/public/state_management/state_hashing/__tests__/unhash_url.js +++ b/src/legacy/ui/public/state_management/state_hashing/__tests__/unhash_url.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/state_management/state_storage/__tests__/hashed_item_store.js b/src/legacy/ui/public/state_management/state_storage/__tests__/hashed_item_store.js index 15d6e4e5c040..dfb726ce5329 100644 --- a/src/legacy/ui/public/state_management/state_storage/__tests__/hashed_item_store.js +++ b/src/legacy/ui/public/state_management/state_storage/__tests__/hashed_item_store.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { StubBrowserStorage } from 'test_utils/stub_browser_storage'; diff --git a/src/legacy/ui/public/state_management/state_storage/__tests__/state_hash.js b/src/legacy/ui/public/state_management/state_storage/__tests__/state_hash.js index 09f875a18e69..71fcf33274fc 100644 --- a/src/legacy/ui/public/state_management/state_storage/__tests__/state_hash.js +++ b/src/legacy/ui/public/state_management/state_storage/__tests__/state_hash.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { encode as encodeRison } from 'rison-node'; import { diff --git a/src/legacy/ui/public/storage/__tests__/storage.js b/src/legacy/ui/public/storage/__tests__/storage.js index 51ef371b736d..2f72fff129ef 100644 --- a/src/legacy/ui/public/storage/__tests__/storage.js +++ b/src/legacy/ui/public/storage/__tests__/storage.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '..'; diff --git a/src/legacy/ui/public/style_compile/__tests__/style_compile.js b/src/legacy/ui/public/style_compile/__tests__/style_compile.js index e141b9fbb1a2..75700259d7bc 100644 --- a/src/legacy/ui/public/style_compile/__tests__/style_compile.js +++ b/src/legacy/ui/public/style_compile/__tests__/style_compile.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; describe('styleCompile directive', function () { diff --git a/src/legacy/ui/public/system_api/__tests__/system_api.js b/src/legacy/ui/public/system_api/__tests__/system_api.js index 45a1cd644968..2e44bac2eef5 100644 --- a/src/legacy/ui/public/system_api/__tests__/system_api.js +++ b/src/legacy/ui/public/system_api/__tests__/system_api.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { addSystemApiHeader, isSystemApiRequest } from '../system_api'; describe('system_api', () => { diff --git a/src/legacy/ui/public/timefilter/get_time.test.ts b/src/legacy/ui/public/timefilter/get_time.test.ts index 42f89335338d..582ecae82a58 100644 --- a/src/legacy/ui/public/timefilter/get_time.test.ts +++ b/src/legacy/ui/public/timefilter/get_time.test.ts @@ -18,7 +18,7 @@ */ // @ts-ignore -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import sinon from 'sinon'; import { Filter, getTime } from './get_time'; diff --git a/src/legacy/ui/public/timefilter/lib/diff_time_picker_vals.test.js b/src/legacy/ui/public/timefilter/lib/diff_time_picker_vals.test.js index e441c351d735..12d729dd0136 100644 --- a/src/legacy/ui/public/timefilter/lib/diff_time_picker_vals.test.js +++ b/src/legacy/ui/public/timefilter/lib/diff_time_picker_vals.test.js @@ -19,7 +19,7 @@ import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { areTimePickerValsDifferent } from './diff_time_picker_vals'; describe('Diff Time Picker Values', () => { diff --git a/src/legacy/ui/public/timefilter/timefilter.test.js b/src/legacy/ui/public/timefilter/timefilter.test.js index eb07711126e4..c1431782baaf 100644 --- a/src/legacy/ui/public/timefilter/timefilter.test.js +++ b/src/legacy/ui/public/timefilter/timefilter.test.js @@ -47,7 +47,7 @@ jest.mock('ui/timefilter/lib/parse_querystring', }), { virtual: true }); import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { timefilter } from './timefilter'; diff --git a/src/legacy/ui/public/url/__tests__/extract_app_path_and_id.js b/src/legacy/ui/public/url/__tests__/extract_app_path_and_id.js index 1df0b14d5d4a..9c2b79705456 100644 --- a/src/legacy/ui/public/url/__tests__/extract_app_path_and_id.js +++ b/src/legacy/ui/public/url/__tests__/extract_app_path_and_id.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { extractAppPathAndId } from '../extract_app_path_and_id'; diff --git a/src/legacy/ui/public/url/__tests__/kibana_parsed_url.js b/src/legacy/ui/public/url/__tests__/kibana_parsed_url.js index cbca2c6aff00..5dd005480e5b 100644 --- a/src/legacy/ui/public/url/__tests__/kibana_parsed_url.js +++ b/src/legacy/ui/public/url/__tests__/kibana_parsed_url.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { KibanaParsedUrl } from '../kibana_parsed_url'; diff --git a/src/legacy/ui/public/url/__tests__/prepend_path.js b/src/legacy/ui/public/url/__tests__/prepend_path.js index 1ab4698ffd5d..b31449322a02 100644 --- a/src/legacy/ui/public/url/__tests__/prepend_path.js +++ b/src/legacy/ui/public/url/__tests__/prepend_path.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { prependPath } from '../prepend_path'; diff --git a/src/legacy/ui/public/url/__tests__/url.js b/src/legacy/ui/public/url/__tests__/url.js index 7f779d594669..52af742492ae 100644 --- a/src/legacy/ui/public/url/__tests__/url.js +++ b/src/legacy/ui/public/url/__tests__/url.js @@ -19,7 +19,7 @@ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import faker from 'faker'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/utils/__tests__/brush_event.test.js b/src/legacy/ui/public/utils/__tests__/brush_event.test.js index 6b27dd79eedc..c7c1804cde78 100644 --- a/src/legacy/ui/public/utils/__tests__/brush_event.test.js +++ b/src/legacy/ui/public/utils/__tests__/brush_event.test.js @@ -38,7 +38,7 @@ jest.mock('ui/chrome', import _ from 'lodash'; import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { onBrushEvent } from '../brush_event'; import { timefilter } from 'ui/timefilter'; diff --git a/src/legacy/ui/public/utils/__tests__/cidr_mask.ts b/src/legacy/ui/public/utils/__tests__/cidr_mask.ts index 8624bb1b6e0b..5343328e5578 100644 --- a/src/legacy/ui/public/utils/__tests__/cidr_mask.ts +++ b/src/legacy/ui/public/utils/__tests__/cidr_mask.ts @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { CidrMask } from '../cidr_mask'; describe('CidrMask', () => { diff --git a/src/legacy/ui/public/utils/__tests__/collection.js b/src/legacy/ui/public/utils/__tests__/collection.js index a733b8b2433b..978c6e75cece 100644 --- a/src/legacy/ui/public/utils/__tests__/collection.js +++ b/src/legacy/ui/public/utils/__tests__/collection.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { groupBy } from 'lodash'; import { move, pushAll, organizeBy } from '../collection'; diff --git a/src/legacy/ui/public/utils/__tests__/decode_geo_hash.js b/src/legacy/ui/public/utils/__tests__/decode_geo_hash.js index 5b09a0cc8b4c..5a0a447e345c 100644 --- a/src/legacy/ui/public/utils/__tests__/decode_geo_hash.js +++ b/src/legacy/ui/public/utils/__tests__/decode_geo_hash.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { geohashColumns } from '../decode_geo_hash'; describe('decode_geo_hash', function () { diff --git a/src/legacy/ui/public/utils/__tests__/diff_object.js b/src/legacy/ui/public/utils/__tests__/diff_object.js index 919dfdfcbc9e..cc9463c163d4 100644 --- a/src/legacy/ui/public/utils/__tests__/diff_object.js +++ b/src/legacy/ui/public/utils/__tests__/diff_object.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import { applyDiff } from '../diff_object'; diff --git a/src/legacy/ui/public/utils/__tests__/ipv4_address.ts b/src/legacy/ui/public/utils/__tests__/ipv4_address.ts index 5e967da189e8..ad4efec6f1e5 100644 --- a/src/legacy/ui/public/utils/__tests__/ipv4_address.ts +++ b/src/legacy/ui/public/utils/__tests__/ipv4_address.ts @@ -17,7 +17,7 @@ * under the License. */ // @ts-ignore -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Ipv4Address from '../ipv4_address'; describe('Ipv4Address', () => { diff --git a/src/legacy/ui/public/utils/__tests__/mapping_setup.js b/src/legacy/ui/public/utils/__tests__/mapping_setup.js index 48dd210b9af4..944dfaa35ed8 100644 --- a/src/legacy/ui/public/utils/__tests__/mapping_setup.js +++ b/src/legacy/ui/public/utils/__tests__/mapping_setup.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import UtilsMappingSetupProvider from '../mapping_setup'; let mappingSetup; diff --git a/src/legacy/ui/public/utils/__tests__/obj_define.js b/src/legacy/ui/public/utils/__tests__/obj_define.js index 64a699ad3c68..5e89ba03530a 100644 --- a/src/legacy/ui/public/utils/__tests__/obj_define.js +++ b/src/legacy/ui/public/utils/__tests__/obj_define.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ObjDefine } from '../obj_define'; describe('ObjDefine Utility', function () { diff --git a/src/legacy/ui/public/utils/__tests__/ordinal_suffix.js b/src/legacy/ui/public/utils/__tests__/ordinal_suffix.js index bde297a456ff..dae12d41cfb5 100644 --- a/src/legacy/ui/public/utils/__tests__/ordinal_suffix.js +++ b/src/legacy/ui/public/utils/__tests__/ordinal_suffix.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import { ordinalSuffix } from '../ordinal_suffix'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ordinal suffix util', function () { const checks = { diff --git a/src/legacy/ui/public/utils/__tests__/parse_interval.js b/src/legacy/ui/public/utils/__tests__/parse_interval.js index b068ce170e12..bce134be4336 100644 --- a/src/legacy/ui/public/utils/__tests__/parse_interval.js +++ b/src/legacy/ui/public/utils/__tests__/parse_interval.js @@ -18,7 +18,7 @@ */ import { parseInterval } from '../parse_interval'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('parseInterval', function () { it('should correctly parse an interval containing unit and value', function () { diff --git a/src/legacy/ui/public/utils/__tests__/range.js b/src/legacy/ui/public/utils/__tests__/range.js index e6421c310175..e7947894d3e2 100644 --- a/src/legacy/ui/public/utils/__tests__/range.js +++ b/src/legacy/ui/public/utils/__tests__/range.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parseRange } from '../range'; describe('Range parsing utility', function () { diff --git a/src/legacy/ui/public/utils/__tests__/simple_emitter.js b/src/legacy/ui/public/utils/__tests__/simple_emitter.js index 6dbacbe4adfe..25224a409f8f 100644 --- a/src/legacy/ui/public/utils/__tests__/simple_emitter.js +++ b/src/legacy/ui/public/utils/__tests__/simple_emitter.js @@ -18,7 +18,7 @@ */ import { SimpleEmitter } from '../simple_emitter'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; describe('SimpleEmitter class', function () { diff --git a/src/legacy/ui/public/utils/__tests__/sort_prefix_first.js b/src/legacy/ui/public/utils/__tests__/sort_prefix_first.js index e820ffff5aa3..016e13b372c3 100644 --- a/src/legacy/ui/public/utils/__tests__/sort_prefix_first.js +++ b/src/legacy/ui/public/utils/__tests__/sort_prefix_first.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { sortPrefixFirst } from '../sort_prefix_first'; describe('sortPrefixFirst', function () { diff --git a/src/legacy/ui/public/vis/__tests__/_agg_config.js b/src/legacy/ui/public/vis/__tests__/_agg_config.js index 707ccf2d6f17..1929b4312e14 100644 --- a/src/legacy/ui/public/vis/__tests__/_agg_config.js +++ b/src/legacy/ui/public/vis/__tests__/_agg_config.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '..'; import { AggType } from '../../agg_types/agg_type'; diff --git a/src/legacy/ui/public/vis/__tests__/_agg_config_result.js b/src/legacy/ui/public/vis/__tests__/_agg_config_result.js index 22254dc36d7f..988c4dc87215 100644 --- a/src/legacy/ui/public/vis/__tests__/_agg_config_result.js +++ b/src/legacy/ui/public/vis/__tests__/_agg_config_result.js @@ -18,7 +18,7 @@ */ import AggConfigResult from '../agg_config_result'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '..'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/vis/__tests__/_agg_configs.js b/src/legacy/ui/public/vis/__tests__/_agg_configs.js index 4ae10aed6a53..2c663800a4d2 100644 --- a/src/legacy/ui/public/vis/__tests__/_agg_configs.js +++ b/src/legacy/ui/public/vis/__tests__/_agg_configs.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { AggConfig } from '../agg_config'; import { VisProvider } from '..'; diff --git a/src/legacy/ui/public/vis/__tests__/_vis.js b/src/legacy/ui/public/vis/__tests__/_vis.js index ed1c767137a8..5c162bd45ace 100644 --- a/src/legacy/ui/public/vis/__tests__/_vis.js +++ b/src/legacy/ui/public/vis/__tests__/_vis.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VisProvider } from '..'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import { VisTypesRegistryProvider } from '../../registry/vis_types'; diff --git a/src/legacy/ui/public/vis/__tests__/components/color.js b/src/legacy/ui/public/vis/__tests__/components/color.js index 5eda6b12fbb5..ba8e4479d2d6 100644 --- a/src/legacy/ui/public/vis/__tests__/components/color.js +++ b/src/legacy/ui/public/vis/__tests__/components/color.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import d3 from 'd3'; diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_client.js b/src/legacy/ui/public/vis/__tests__/map/ems_client.js index 022bb2417615..6ac25c6f53f0 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_client.js +++ b/src/legacy/ui/public/vis/__tests__/map/ems_client.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import EMS_CATALOGUE from './ems_mocks/sample_manifest.json'; import EMS_FILES from './ems_mocks/sample_files.json'; import EMS_TILES from './ems_mocks/sample_tiles.json'; diff --git a/src/legacy/ui/public/vis/__tests__/map/kibana_map.js b/src/legacy/ui/public/vis/__tests__/map/kibana_map.js index ed1c4e1e4b8f..e67d4b5f7603 100644 --- a/src/legacy/ui/public/vis/__tests__/map/kibana_map.js +++ b/src/legacy/ui/public/vis/__tests__/map/kibana_map.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { KibanaMap } from '../../map/kibana_map'; import { KibanaMapLayer } from '../../map/kibana_map_layer'; import L from 'leaflet'; diff --git a/src/legacy/ui/public/vis/__tests__/map/service_settings.js b/src/legacy/ui/public/vis/__tests__/map/service_settings.js index 51ce93a37604..20097697bd0a 100644 --- a/src/legacy/ui/public/vis/__tests__/map/service_settings.js +++ b/src/legacy/ui/public/vis/__tests__/map/service_settings.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import url from 'url'; diff --git a/src/legacy/ui/public/vis/__tests__/response_handlers/_build_chart_data.js b/src/legacy/ui/public/vis/__tests__/response_handlers/_build_chart_data.js index 51c03d5338f4..5b1f8c7c5547 100644 --- a/src/legacy/ui/public/vis/__tests__/response_handlers/_build_chart_data.js +++ b/src/legacy/ui/public/vis/__tests__/response_handlers/_build_chart_data.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { aggResponseIndex } from '../../../agg_response'; import { VislibSeriesResponseHandlerProvider as vislibReponseHandler } from '../../response_handlers/vislib'; diff --git a/src/legacy/ui/public/vis/__tests__/response_handlers/basic.js b/src/legacy/ui/public/vis/__tests__/response_handlers/basic.js index a8281b95742b..b80cf4abc02d 100644 --- a/src/legacy/ui/public/vis/__tests__/response_handlers/basic.js +++ b/src/legacy/ui/public/vis/__tests__/response_handlers/basic.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibSeriesResponseHandlerProvider } from '../../response_handlers/vislib'; describe('Basic Response Handler', function () { diff --git a/src/legacy/ui/public/vis/__tests__/vis_types/base_vis_type.js b/src/legacy/ui/public/vis/__tests__/vis_types/base_vis_type.js index 2a79b40e7496..7590ff93d2b4 100644 --- a/src/legacy/ui/public/vis/__tests__/vis_types/base_vis_type.js +++ b/src/legacy/ui/public/vis/__tests__/vis_types/base_vis_type.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { BaseVisTypeProvider } from '../../vis_types/base_vis_type'; diff --git a/src/legacy/ui/public/vis/__tests__/vis_types/react_vis_type.js b/src/legacy/ui/public/vis/__tests__/vis_types/react_vis_type.js index cf2fbab88081..99b485e8ef55 100644 --- a/src/legacy/ui/public/vis/__tests__/vis_types/react_vis_type.js +++ b/src/legacy/ui/public/vis/__tests__/vis_types/react_vis_type.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { ReactVisTypeProvider } from '../../vis_types/react_vis_type'; diff --git a/src/legacy/ui/public/vis/__tests__/vis_types/vislib_vis_type.js b/src/legacy/ui/public/vis/__tests__/vis_types/vislib_vis_type.js index aee36e7f330d..9e6c98e94a9c 100644 --- a/src/legacy/ui/public/vis/__tests__/vis_types/vislib_vis_type.js +++ b/src/legacy/ui/public/vis/__tests__/vis_types/vislib_vis_type.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibVisTypeProvider } from '../../vis_types/vislib_vis_type'; describe('Vislib Vis Type', function () { diff --git a/src/legacy/ui/public/vis/components/tooltip/__tests__/positioning.js b/src/legacy/ui/public/vis/components/tooltip/__tests__/positioning.js index c5568ec833d7..b72e947fee6c 100644 --- a/src/legacy/ui/public/vis/components/tooltip/__tests__/positioning.js +++ b/src/legacy/ui/public/vis/components/tooltip/__tests__/positioning.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import _ from 'lodash'; import sinon from 'sinon'; diff --git a/src/legacy/ui/public/vis/editors/default/__tests__/agg.js b/src/legacy/ui/public/vis/editors/default/__tests__/agg.js index 0f5c76f2f428..c38ba179f3a5 100644 --- a/src/legacy/ui/public/vis/editors/default/__tests__/agg.js +++ b/src/legacy/ui/public/vis/editors/default/__tests__/agg.js @@ -20,7 +20,7 @@ import angular from 'angular'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../agg'; diff --git a/src/legacy/ui/public/vis/editors/default/__tests__/agg_params.js b/src/legacy/ui/public/vis/editors/default/__tests__/agg_params.js index 3538b1ab5ae7..4f3c78e1469d 100644 --- a/src/legacy/ui/public/vis/editors/default/__tests__/agg_params.js +++ b/src/legacy/ui/public/vis/editors/default/__tests__/agg_params.js @@ -20,7 +20,7 @@ import angular from 'angular'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import '../agg_params'; import { VisProvider } from '../../..'; diff --git a/src/legacy/ui/public/vis/editors/default/__tests__/keyboard_move.js b/src/legacy/ui/public/vis/editors/default/__tests__/keyboard_move.js index 6daf8a8d41ec..b24e2918ac07 100644 --- a/src/legacy/ui/public/vis/editors/default/__tests__/keyboard_move.js +++ b/src/legacy/ui/public/vis/editors/default/__tests__/keyboard_move.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import { Direction } from '../keyboard_move'; diff --git a/src/legacy/ui/public/vis/vis_types/__tests__/vislib_vis_legend.js b/src/legacy/ui/public/vis/vis_types/__tests__/vislib_vis_legend.js index ab7bf8fab0ab..d539693a1209 100644 --- a/src/legacy/ui/public/vis/vis_types/__tests__/vislib_vis_legend.js +++ b/src/legacy/ui/public/vis/vis_types/__tests__/vislib_vis_legend.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VisProvider } from '../../vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; diff --git a/src/legacy/ui/public/vislib/__tests__/components/heatmap_color.js b/src/legacy/ui/public/vislib/__tests__/components/heatmap_color.js index 8260b97dcc2f..d4e2a168fdf2 100644 --- a/src/legacy/ui/public/vislib/__tests__/components/heatmap_color.js +++ b/src/legacy/ui/public/vislib/__tests__/components/heatmap_color.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { getHeatmapColors } from '../../components/color/heatmap_color'; diff --git a/src/legacy/ui/public/vislib/__tests__/components/labels.js b/src/legacy/ui/public/vislib/__tests__/components/labels.js index e454bc1cf11b..999937305d5c 100644 --- a/src/legacy/ui/public/vislib/__tests__/components/labels.js +++ b/src/legacy/ui/public/vislib/__tests__/components/labels.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VislibComponentsLabelsLabelsProvider } from '../../components/labels/labels'; import { VislibComponentsLabelsDataArrayProvider } from '../../components/labels/data_array'; diff --git a/src/legacy/ui/public/vislib/__tests__/components/zero_injection.js b/src/legacy/ui/public/vislib/__tests__/components/zero_injection.js index 8cf0a2bdfa55..fb9e775ae2fe 100644 --- a/src/legacy/ui/public/vislib/__tests__/components/zero_injection.js +++ b/src/legacy/ui/public/vislib/__tests__/components/zero_injection.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VislibComponentsZeroInjectionInjectZerosProvider } from '../../components/zero_injection/inject_zeros'; import { VislibComponentsZeroInjectionOrderedXKeysProvider } from '../../components/zero_injection/ordered_x_keys'; diff --git a/src/legacy/ui/public/vislib/__tests__/index.js b/src/legacy/ui/public/vislib/__tests__/index.js index cfed27d81706..ed58765df5a8 100644 --- a/src/legacy/ui/public/vislib/__tests__/index.js +++ b/src/legacy/ui/public/vislib/__tests__/index.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import VislibProvider from '..'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/axis/axis.js b/src/legacy/ui/public/vislib/__tests__/lib/axis/axis.js index 52add55f5043..954d7dee6c4b 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/axis/axis.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/axis/axis.js @@ -20,7 +20,7 @@ import d3 from 'd3'; import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import '../../../../persisted_state'; import { VislibLibAxisProvider } from '../../../lib/axis'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/axis_title.js b/src/legacy/ui/public/vislib/__tests__/lib/axis_title.js index 0541261c089a..9098a12d40fc 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/axis_title.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/axis_title.js @@ -21,7 +21,7 @@ import d3 from 'd3'; import _ from 'lodash'; import $ from 'jquery'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibLibAxisTitleProvider } from '../../lib/axis/axis_title'; import { VislibLibAxisConfigProvider } from '../../lib/axis/axis_config'; import { VislibVisConfigProvider } from '../../lib/vis_config'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/chart_title.js b/src/legacy/ui/public/vislib/__tests__/lib/chart_title.js index e88896d70872..15bca14400bb 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/chart_title.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/chart_title.js @@ -20,7 +20,7 @@ import d3 from 'd3'; import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibLibChartTitleProvider } from '../../lib/chart_title'; import { VislibVisConfigProvider } from '../../lib/vis_config'; import '../../../persisted_state'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/data.js b/src/legacy/ui/public/vislib/__tests__/lib/data.js index ae6e166b62ef..4cb47a4c5006 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/data.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/data.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibLibDataProvider } from '../../lib/data'; import '../../../persisted_state'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/dispatch.js b/src/legacy/ui/public/vislib/__tests__/lib/dispatch.js index fb4794f147a1..5dc6854cf5ce 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/dispatch.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/dispatch.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; // Data import data from 'fixtures/vislib/mock_data/date_histogram/_series'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/error_handler.js b/src/legacy/ui/public/vislib/__tests__/lib/error_handler.js index 804939001aa1..bb7d9eee51c2 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/error_handler.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/error_handler.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VislibLibErrorHandlerProvider } from '../../lib/_error_handler'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/handler/handler.js b/src/legacy/ui/public/vislib/__tests__/lib/handler/handler.js index 518fc9595ab8..f40df40ed998 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/handler/handler.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/handler/handler.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; // Data import series from 'fixtures/vislib/mock_data/date_histogram/_series'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/layout/layout.js b/src/legacy/ui/public/vislib/__tests__/lib/layout/layout.js index 149f2e87cc30..93a6961b99aa 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/layout/layout.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/layout/layout.js @@ -19,7 +19,7 @@ import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; // Data import series from 'fixtures/vislib/mock_data/date_histogram/_series'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/layout/layout_types.js b/src/legacy/ui/public/vislib/__tests__/lib/layout/layout_types.js index 8d4c80f72834..ec86a601d7b1 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/layout/layout_types.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/layout/layout_types.js @@ -19,7 +19,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibLibLayoutLayoutTypesProvider } from '../../../lib/layout/layout_types'; describe('Vislib Layout Types Test Suite', function () { diff --git a/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js b/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js index 185597f1ac3c..c189232800d0 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js @@ -19,7 +19,7 @@ import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import { VislibLibLayoutSplitsColumnChartChartSplitProvider } from '../../../../../lib/layout/splits/column_chart/chart_split'; import { VislibLibLayoutSplitsColumnChartChartTitleSplitProvider } from '../../../../../lib/layout/splits/column_chart/chart_title_split'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js b/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js index 2fe0cc2b7fbe..1ab8c0750ab0 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js @@ -19,7 +19,7 @@ import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import VislibLibLayoutSplitsGaugeChartChartSplitProvider from '../../../../../lib/layout/splits/gauge_chart/chart_split'; import VislibLibLayoutSplitsGaugeChartChartTitleSplitProvider from '../../../../../lib/layout/splits/gauge_chart/chart_title_split'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/layout/types/column_layout.js b/src/legacy/ui/public/vislib/__tests__/lib/layout/types/column_layout.js index 6086b7007af5..db721a754134 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/layout/types/column_layout.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/layout/types/column_layout.js @@ -20,7 +20,7 @@ import d3 from 'd3'; import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibLibLayoutLayoutTypesProvider } from '../../../../lib/layout/layout_types'; describe('Vislib Column Layout Test Suite', function () { diff --git a/src/legacy/ui/public/vislib/__tests__/lib/types/point_series.js b/src/legacy/ui/public/vislib/__tests__/lib/types/point_series.js index f5d8e16092e0..3688fb834f9b 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/types/point_series.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/types/point_series.js @@ -18,7 +18,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import stackedSeries from 'fixtures/vislib/mock_data/date_histogram/_stacked_series'; import { VislibTypesPointSeries } from '../../../lib/types/point_series'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/vis_config.js b/src/legacy/ui/public/vislib/__tests__/lib/vis_config.js index 510263b37bce..5e0f0f99c2d5 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/vis_config.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/vis_config.js @@ -19,7 +19,7 @@ import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VislibVisConfigProvider } from '../../lib/vis_config'; import '../../../persisted_state'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/x_axis.js b/src/legacy/ui/public/vislib/__tests__/lib/x_axis.js index d55259132a79..3fad87ee851a 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/x_axis.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/x_axis.js @@ -20,7 +20,7 @@ import d3 from 'd3'; import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import '../../../persisted_state'; import { VislibLibAxisProvider } from '../../lib/axis'; diff --git a/src/legacy/ui/public/vislib/__tests__/lib/y_axis.js b/src/legacy/ui/public/vislib/__tests__/lib/y_axis.js index b59ba8e6e315..965c1c49e1cc 100644 --- a/src/legacy/ui/public/vislib/__tests__/lib/y_axis.js +++ b/src/legacy/ui/public/vislib/__tests__/lib/y_axis.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import d3 from 'd3'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import $ from 'jquery'; import '../../../persisted_state'; import { VislibLibAxisProvider } from '../../lib/axis'; diff --git a/src/legacy/ui/public/vislib/__tests__/vis.js b/src/legacy/ui/public/vislib/__tests__/vis.js index acacf59fbfcd..1079bd0ad315 100644 --- a/src/legacy/ui/public/vislib/__tests__/vis.js +++ b/src/legacy/ui/public/vislib/__tests__/vis.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import series from 'fixtures/vislib/mock_data/date_histogram/_series'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/area_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/area_chart.js index ac7944ae8dea..1390eecfa28d 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/area_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/area_chart.js @@ -18,7 +18,7 @@ */ import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/chart.js index 5a9cbc049421..916337165fab 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/chart.js @@ -18,7 +18,7 @@ */ import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { VislibVisProvider } from '../../vis'; import '../../../persisted_state'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/column_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/column_chart.js index af76a960d963..18ed4b4e28f2 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/column_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/column_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import d3 from 'd3'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/gauge_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/gauge_chart.js index 09d64beb95db..04bcad253553 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/gauge_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/gauge_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import $ from 'jquery'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/heatmap_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/heatmap_chart.js index 4fbf607e334b..294ca49a64ec 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/heatmap_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/heatmap_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import d3 from 'd3'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/line_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/line_chart.js index 064b42289744..98133413c8d9 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/line_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/line_chart.js @@ -18,7 +18,7 @@ */ import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/pie_chart.js b/src/legacy/ui/public/vislib/__tests__/visualizations/pie_chart.js index be0527ba6f46..7ce81065d524 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/pie_chart.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/pie_chart.js @@ -18,7 +18,7 @@ */ import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import fixtures from 'fixtures/fake_hierarchical_data'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/time_marker.js b/src/legacy/ui/public/vislib/__tests__/visualizations/time_marker.js index c5d4cfb268ee..1c2c0d5d5c87 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/time_marker.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/time_marker.js @@ -18,7 +18,7 @@ */ import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import series from 'fixtures/vislib/mock_data/date_histogram/_series'; import terms from 'fixtures/vislib/mock_data/terms/_columns'; diff --git a/src/legacy/ui/public/vislib/__tests__/visualizations/vis_types.js b/src/legacy/ui/public/vislib/__tests__/visualizations/vis_types.js index f4621989ab7b..5729de277f56 100644 --- a/src/legacy/ui/public/vislib/__tests__/visualizations/vis_types.js +++ b/src/legacy/ui/public/vislib/__tests__/visualizations/vis_types.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import _ from 'lodash'; import { VislibVisualizationsVisTypesProvider } from '../../visualizations/vis_types'; diff --git a/src/legacy/ui/public/visualize/loader/__tests__/visualization_loader.js b/src/legacy/ui/public/visualize/loader/__tests__/visualization_loader.js index 50eb3ef3d779..ffce391fc1a0 100644 --- a/src/legacy/ui/public/visualize/loader/__tests__/visualization_loader.js +++ b/src/legacy/ui/public/visualize/loader/__tests__/visualization_loader.js @@ -18,7 +18,7 @@ */ import $ from 'jquery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { setupAndTeardownInjectorStub } from 'test_utils/stub_get_active_injector'; diff --git a/src/legacy/ui/public/visualize/loader/__tests__/visualize_data_loader.js b/src/legacy/ui/public/visualize/loader/__tests__/visualize_data_loader.js index 4c2e31a46d7c..e8586c6a94a7 100644 --- a/src/legacy/ui/public/visualize/loader/__tests__/visualize_data_loader.js +++ b/src/legacy/ui/public/visualize/loader/__tests__/visualize_data_loader.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { setupAndTeardownInjectorStub } from 'test_utils/stub_get_active_injector'; diff --git a/src/legacy/ui/public/visualize/loader/__tests__/visualize_loader.js b/src/legacy/ui/public/visualize/loader/__tests__/visualize_loader.js index 515c490eca97..67daae80ea48 100644 --- a/src/legacy/ui/public/visualize/loader/__tests__/visualize_loader.js +++ b/src/legacy/ui/public/visualize/loader/__tests__/visualize_loader.js @@ -18,7 +18,7 @@ */ import angular from 'angular'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import sinon from 'sinon'; import { cloneDeep } from 'lodash'; diff --git a/src/legacy/ui/public/watch_multi/__tests__/watch_multi.js b/src/legacy/ui/public/watch_multi/__tests__/watch_multi.js index 9ad0c7787a93..8c90b6c1dfba 100644 --- a/src/legacy/ui/public/watch_multi/__tests__/watch_multi.js +++ b/src/legacy/ui/public/watch_multi/__tests__/watch_multi.js @@ -20,7 +20,7 @@ import _ from 'lodash'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; describe('$scope.$watchMulti', function () { diff --git a/src/legacy/ui/ui_apps/__tests__/ui_app.js b/src/legacy/ui/ui_apps/__tests__/ui_app.js index 9d5a1a585d74..1e367e3d809a 100644 --- a/src/legacy/ui/ui_apps/__tests__/ui_app.js +++ b/src/legacy/ui/ui_apps/__tests__/ui_app.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { UiApp } from '../ui_app'; import { UiNavLink } from '../../ui_nav_links'; diff --git a/src/legacy/ui/ui_bundles/__tests__/app_entry_template.js b/src/legacy/ui/ui_bundles/__tests__/app_entry_template.js index 79b57955ebd6..3a0e40073ca3 100644 --- a/src/legacy/ui/ui_bundles/__tests__/app_entry_template.js +++ b/src/legacy/ui/ui_bundles/__tests__/app_entry_template.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { appEntryTemplate } from '../app_entry_template'; diff --git a/src/legacy/ui/ui_bundles/__tests__/ui_bundle.js b/src/legacy/ui/ui_bundles/__tests__/ui_bundle.js index f92cc79303ce..c323e06adb59 100644 --- a/src/legacy/ui/ui_bundles/__tests__/ui_bundle.js +++ b/src/legacy/ui/ui_bundles/__tests__/ui_bundle.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { UiBundle } from '../ui_bundle'; diff --git a/src/legacy/ui/ui_exports/__tests__/collect_ui_exports.js b/src/legacy/ui/ui_exports/__tests__/collect_ui_exports.js index 85b77c6f304d..de9a26814969 100644 --- a/src/legacy/ui/ui_exports/__tests__/collect_ui_exports.js +++ b/src/legacy/ui/ui_exports/__tests__/collect_ui_exports.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PluginPack } from '../../../plugin_discovery'; diff --git a/src/legacy/ui/ui_nav_links/__tests__/ui_nav_link.js b/src/legacy/ui/ui_nav_links/__tests__/ui_nav_link.js index be20ac0bded7..7969329256aa 100644 --- a/src/legacy/ui/ui_nav_links/__tests__/ui_nav_link.js +++ b/src/legacy/ui/ui_nav_links/__tests__/ui_nav_link.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { UiNavLink } from '../ui_nav_link'; diff --git a/src/legacy/ui/ui_settings/__tests__/lib/create_objects_client_stub.js b/src/legacy/ui/ui_settings/__tests__/lib/create_objects_client_stub.js index 6dbef853719e..457ddd866c75 100644 --- a/src/legacy/ui/ui_settings/__tests__/lib/create_objects_client_stub.js +++ b/src/legacy/ui/ui_settings/__tests__/lib/create_objects_client_stub.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SavedObjectsClient } from '../../../../server/saved_objects'; export const savedObjectsClientErrors = SavedObjectsClient.errors; diff --git a/src/legacy/ui/ui_settings/__tests__/ui_settings_mixin_integration.js b/src/legacy/ui/ui_settings/__tests__/ui_settings_mixin_integration.js index b3723f89ada3..9e8413a0f99e 100644 --- a/src/legacy/ui/ui_settings/__tests__/ui_settings_mixin_integration.js +++ b/src/legacy/ui/ui_settings/__tests__/ui_settings_mixin_integration.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Config } from '../../../server/config'; diff --git a/src/legacy/ui/ui_settings/__tests__/ui_settings_service.js b/src/legacy/ui/ui_settings/__tests__/ui_settings_service.js index 4aa7acc5bc62..3106ba429f7c 100644 --- a/src/legacy/ui/ui_settings/__tests__/ui_settings_service.js +++ b/src/legacy/ui/ui_settings/__tests__/ui_settings_service.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { errors as esErrors } from 'elasticsearch'; import Chance from 'chance'; import sinon from 'sinon'; diff --git a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_integration.js b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_integration.js index 4bbb71586282..55de8a32199c 100644 --- a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_integration.js +++ b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_integration.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { startTestServers } from '../../../../../test_utils/kbn_server'; import { createOrUpgradeSavedConfig } from '../create_or_upgrade_saved_config'; diff --git a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_saved_config.js b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_saved_config.js index 8d865f81555e..d047fd8bb257 100644 --- a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_saved_config.js +++ b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/create_or_upgrade_saved_config.js @@ -18,7 +18,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Chance from 'chance'; import * as getUpgradeableConfigNS from '../get_upgradeable_config'; diff --git a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/is_config_version_upgradeable.js b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/is_config_version_upgradeable.js index 4ee79350a5e6..734d579d2340 100644 --- a/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/is_config_version_upgradeable.js +++ b/src/legacy/ui/ui_settings/create_or_upgrade_saved_config/__tests__/is_config_version_upgradeable.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isConfigVersionUpgradeable } from '../is_config_version_upgradeable'; import { pkg } from '../../../../utils'; diff --git a/src/legacy/ui/ui_settings/routes/__tests__/doc_exists.js b/src/legacy/ui/ui_settings/routes/__tests__/doc_exists.js index 3b1af1dea88c..824194ae1788 100644 --- a/src/legacy/ui/ui_settings/routes/__tests__/doc_exists.js +++ b/src/legacy/ui/ui_settings/routes/__tests__/doc_exists.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { diff --git a/src/legacy/ui/ui_settings/routes/__tests__/doc_missing.js b/src/legacy/ui/ui_settings/routes/__tests__/doc_missing.js index ee05eb7d08c0..a1fbec8ad39d 100644 --- a/src/legacy/ui/ui_settings/routes/__tests__/doc_missing.js +++ b/src/legacy/ui/ui_settings/routes/__tests__/doc_missing.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { diff --git a/src/legacy/ui/ui_settings/routes/__tests__/doc_missing_and_index_read_only.js b/src/legacy/ui/ui_settings/routes/__tests__/doc_missing_and_index_read_only.js index fa51f61e0f97..4ef004843054 100644 --- a/src/legacy/ui/ui_settings/routes/__tests__/doc_missing_and_index_read_only.js +++ b/src/legacy/ui/ui_settings/routes/__tests__/doc_missing_and_index_read_only.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { diff --git a/src/legacy/utils/__tests__/kbn_field_types.js b/src/legacy/utils/__tests__/kbn_field_types.js index af4e633c98c1..f94438b10ca5 100644 --- a/src/legacy/utils/__tests__/kbn_field_types.js +++ b/src/legacy/utils/__tests__/kbn_field_types.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Chance from 'chance'; const chance = new Chance(); diff --git a/src/legacy/utils/__tests__/unset.js b/src/legacy/utils/__tests__/unset.js index 5540c2cc23ae..69122e06ac57 100644 --- a/src/legacy/utils/__tests__/unset.js +++ b/src/legacy/utils/__tests__/unset.js @@ -18,7 +18,7 @@ */ import { unset } from '../unset'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('unset(obj, key)', function () { describe('invalid input', function () { diff --git a/src/legacy/utils/strings/__tests__/comma_separated_list.js b/src/legacy/utils/strings/__tests__/comma_separated_list.js index a52187ef47e7..e8f16f045765 100644 --- a/src/legacy/utils/strings/__tests__/comma_separated_list.js +++ b/src/legacy/utils/strings/__tests__/comma_separated_list.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parseCommaSeparatedList } from '../comma_separated_list'; diff --git a/src/legacy/utils/strings/__tests__/prose.js b/src/legacy/utils/strings/__tests__/prose.js index 3655a828766f..d99f5f196fb6 100644 --- a/src/legacy/utils/strings/__tests__/prose.js +++ b/src/legacy/utils/strings/__tests__/prose.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { formatListAsProse } from '../prose'; diff --git a/src/optimize/bundles_route/__tests__/bundles_route.js b/src/optimize/bundles_route/__tests__/bundles_route.js index 87638c311bca..480e7e2a0fb8 100644 --- a/src/optimize/bundles_route/__tests__/bundles_route.js +++ b/src/optimize/bundles_route/__tests__/bundles_route.js @@ -22,7 +22,7 @@ import { readFileSync } from 'fs'; import crypto from 'crypto'; import Chance from 'chance'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Hapi from 'hapi'; import Inert from 'inert'; import sinon from 'sinon'; diff --git a/src/test_utils/__tests__/get_url.js b/src/test_utils/__tests__/get_url.js index b4fad9d0fa88..d071e34ee116 100644 --- a/src/test_utils/__tests__/get_url.js +++ b/src/test_utils/__tests__/get_url.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import getUrl from '../get_url'; describe('getUrl', function () { diff --git a/src/test_utils/expect_deep_equal.js b/src/test_utils/expect_deep_equal.js index 0d4207c233b9..e3e24cbdf5dc 100644 --- a/src/test_utils/expect_deep_equal.js +++ b/src/test_utils/expect_deep_equal.js @@ -18,7 +18,7 @@ */ import { isEqual } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; // expect.js's `eql` method provides nice error messages but sometimes misses things // since it only tests loose (==) equality. This function uses lodash's `isEqual` as a diff --git a/test/api_integration/apis/general/cookies.js b/test/api_integration/apis/general/cookies.js index d377ca1eac6b..7791f3bde406 100644 --- a/test/api_integration/apis/general/cookies.js +++ b/test/api_integration/apis/general/cookies.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/general/csp.js b/test/api_integration/apis/general/csp.js index 3ae762567727..f3501aa55ada 100644 --- a/test/api_integration/apis/general/csp.js +++ b/test/api_integration/apis/general/csp.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/home/sample_data.js b/test/api_integration/apis/home/sample_data.js index e71c98eb9679..81fb6235520e 100644 --- a/test/api_integration/apis/home/sample_data.js +++ b/test/api_integration/apis/home/sample_data.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index 94ac82a6118d..7e04e3f7204d 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { errors as esErrors } from 'elasticsearch'; import Boom from 'boom'; diff --git a/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js b/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js index da375e76d54b..f303bca0da57 100644 --- a/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export async function getIndexNotFoundError(es) { try { diff --git a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js index 58f5407f81de..e0e18b4734ff 100644 --- a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js +++ b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js index c8030fd3e4e8..2201b5631665 100644 --- a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js +++ b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/query_params.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js index f0f9d73dc6ec..e2eebfa9e6d8 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js index 26497d317f27..8a2af8040b2f 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { sortBy } from 'lodash'; export default function ({ getService }) { diff --git a/test/api_integration/apis/kql_telemetry/kql_telemetry.js b/test/api_integration/apis/kql_telemetry/kql_telemetry.js index 6ed48434064e..b17dec2ef437 100644 --- a/test/api_integration/apis/kql_telemetry/kql_telemetry.js +++ b/test/api_integration/apis/kql_telemetry/kql_telemetry.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Promise from 'bluebird'; import { get } from 'lodash'; diff --git a/test/api_integration/apis/management/saved_objects/relationships.js b/test/api_integration/apis/management/saved_objects/relationships.js index e31a5fe3aaa7..2a866245b1aa 100644 --- a/test/api_integration/apis/management/saved_objects/relationships.js +++ b/test/api_integration/apis/management/saved_objects/relationships.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const Joi = require('joi'); export default function ({ getService }) { diff --git a/test/api_integration/apis/saved_objects/bulk_create.js b/test/api_integration/apis/saved_objects/bulk_create.js index 44aaaf0fa55b..e77e08d949f2 100644 --- a/test/api_integration/apis/saved_objects/bulk_create.js +++ b/test/api_integration/apis/saved_objects/bulk_create.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/bulk_get.js b/test/api_integration/apis/saved_objects/bulk_get.js index da208a5cbe70..1d129b7d738e 100644 --- a/test/api_integration/apis/saved_objects/bulk_get.js +++ b/test/api_integration/apis/saved_objects/bulk_get.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/create.js b/test/api_integration/apis/saved_objects/create.js index 17b4fc55fbb4..ccc436a757a8 100644 --- a/test/api_integration/apis/saved_objects/create.js +++ b/test/api_integration/apis/saved_objects/create.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/delete.js b/test/api_integration/apis/saved_objects/delete.js index 72cf9a9cbf52..a9037bf69740 100644 --- a/test/api_integration/apis/saved_objects/delete.js +++ b/test/api_integration/apis/saved_objects/delete.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/export.js b/test/api_integration/apis/saved_objects/export.js index 078ecd44aa4c..75829c750787 100644 --- a/test/api_integration/apis/saved_objects/export.js +++ b/test/api_integration/apis/saved_objects/export.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/find.js b/test/api_integration/apis/saved_objects/find.js index f6e07fd4fb5c..3ad2ca3f5057 100644 --- a/test/api_integration/apis/saved_objects/find.js +++ b/test/api_integration/apis/saved_objects/find.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/get.js b/test/api_integration/apis/saved_objects/get.js index 0734918f5f3e..58d12af7f9d0 100644 --- a/test/api_integration/apis/saved_objects/get.js +++ b/test/api_integration/apis/saved_objects/get.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/saved_objects/import.js b/test/api_integration/apis/saved_objects/import.js index b38109d32e7e..19fd051e5f44 100644 --- a/test/api_integration/apis/saved_objects/import.js +++ b/test/api_integration/apis/saved_objects/import.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { join } from 'path'; export default function ({ getService }) { diff --git a/test/api_integration/apis/saved_objects/resolve_import_errors.js b/test/api_integration/apis/saved_objects/resolve_import_errors.js index adffbe03117f..84867960a8e3 100644 --- a/test/api_integration/apis/saved_objects/resolve_import_errors.js +++ b/test/api_integration/apis/saved_objects/resolve_import_errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { join } from 'path'; export default function ({ getService }) { diff --git a/test/api_integration/apis/saved_objects/update.js b/test/api_integration/apis/saved_objects/update.js index 4e56a9f12088..25a97d9e00b7 100644 --- a/test/api_integration/apis/saved_objects/update.js +++ b/test/api_integration/apis/saved_objects/update.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/scripts/languages.js b/test/api_integration/apis/scripts/languages.js index b8145f034468..89da7ed2083a 100644 --- a/test/api_integration/apis/scripts/languages.js +++ b/test/api_integration/apis/scripts/languages.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/search/count.js b/test/api_integration/apis/search/count.js index 1fc4cbf9b6ad..de0d161551d9 100644 --- a/test/api_integration/apis/search/count.js +++ b/test/api_integration/apis/search/count.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const esArchiver = getService('esArchiver'); diff --git a/test/api_integration/apis/shorten/index.js b/test/api_integration/apis/shorten/index.js index fdd5421b7774..5e6ab4c354d4 100644 --- a/test/api_integration/apis/shorten/index.js +++ b/test/api_integration/apis/shorten/index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const esArchiver = getService('esArchiver'); diff --git a/test/api_integration/apis/stats/stats.js b/test/api_integration/apis/stats/stats.js index ef0d76e0e36a..a02c3f1408c0 100644 --- a/test/api_integration/apis/stats/stats.js +++ b/test/api_integration/apis/stats/stats.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const assertStatsAndMetrics = body => { expect(body.kibana.name).to.be.a('string'); diff --git a/test/api_integration/apis/status/status.js b/test/api_integration/apis/status/status.js index 08ab6fc7667a..c0aa080ce248 100644 --- a/test/api_integration/apis/status/status.js +++ b/test/api_integration/apis/status/status.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/test/api_integration/apis/user_action/user_action.js b/test/api_integration/apis/user_action/user_action.js index ca1d58d9dbb4..db4485c8f14f 100644 --- a/test/api_integration/apis/user_action/user_action.js +++ b/test/api_integration/apis/user_action/user_action.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { get } from 'lodash'; export default function ({ getService }) { diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index d4937962a224..1fda35f2bf1a 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; const DEFAULT_REQUEST = ` diff --git a/test/functional/apps/context/_discover_navigation.js b/test/functional/apps/context/_discover_navigation.js index 3a6c357c1ad0..19b43f5e3ffd 100644 --- a/test/functional/apps/context/_discover_navigation.js +++ b/test/functional/apps/context/_discover_navigation.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const TEST_DISCOVER_START_TIME = '2015-09-19 06:31:44.000'; const TEST_DISCOVER_END_TIME = '2015-09-23 18:31:44.000'; diff --git a/test/functional/apps/context/_filters.js b/test/functional/apps/context/_filters.js index fe3a16d2d42f..6823d78e2330 100644 --- a/test/functional/apps/context/_filters.js +++ b/test/functional/apps/context/_filters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const TEST_INDEX_PATTERN = 'logstash-*'; const TEST_ANCHOR_TYPE = '_doc'; diff --git a/test/functional/apps/context/_size.js b/test/functional/apps/context/_size.js index 3513a2fc5376..749ab797fc6c 100644 --- a/test/functional/apps/context/_size.js +++ b/test/functional/apps/context/_size.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const TEST_INDEX_PATTERN = 'logstash-*'; const TEST_ANCHOR_TYPE = '_doc'; diff --git a/test/functional/apps/dashboard/bwc_shared_urls.js b/test/functional/apps/dashboard/bwc_shared_urls.js index 7c3acfba906a..69ded31fcc1d 100644 --- a/test/functional/apps/dashboard/bwc_shared_urls.js +++ b/test/functional/apps/dashboard/bwc_shared_urls.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['dashboard', 'header']); diff --git a/test/functional/apps/dashboard/create_and_add_embeddables.js b/test/functional/apps/dashboard/create_and_add_embeddables.js index c138e3462e80..84c16feef0b5 100644 --- a/test/functional/apps/dashboard/create_and_add_embeddables.js +++ b/test/functional/apps/dashboard/create_and_add_embeddables.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { VisualizeConstants diff --git a/test/functional/apps/dashboard/dashboard_clone.js b/test/functional/apps/dashboard/dashboard_clone.js index 817d0e6dcd69..493c31578e35 100644 --- a/test/functional/apps/dashboard/dashboard_clone.js +++ b/test/functional/apps/dashboard/dashboard_clone.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.js b/test/functional/apps/dashboard/dashboard_filter_bar.js index a393a949377e..1b29a67a0c77 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.js +++ b/test/functional/apps/dashboard/dashboard_filter_bar.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const dashboardExpect = getService('dashboardExpect'); diff --git a/test/functional/apps/dashboard/dashboard_filtering.js b/test/functional/apps/dashboard/dashboard_filtering.js index 8c2ef2ea37a1..c3f426e7d568 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.js +++ b/test/functional/apps/dashboard/dashboard_filtering.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; /** * Test the querying capabilities of dashboard, and make sure visualizations show the expected results, especially diff --git a/test/functional/apps/dashboard/dashboard_grid.js b/test/functional/apps/dashboard/dashboard_grid.js index 6aacd82003bc..f8eb220d6098 100644 --- a/test/functional/apps/dashboard/dashboard_grid.js +++ b/test/functional/apps/dashboard/dashboard_grid.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const browser = getService('browser'); diff --git a/test/functional/apps/dashboard/dashboard_listing.js b/test/functional/apps/dashboard/dashboard_listing.js index 2545ef1b4dae..84ab47ae592e 100644 --- a/test/functional/apps/dashboard/dashboard_listing.js +++ b/test/functional/apps/dashboard/dashboard_listing.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['dashboard', 'header', 'common']); diff --git a/test/functional/apps/dashboard/dashboard_options.js b/test/functional/apps/dashboard/dashboard_options.js index 02dc1e7a4af7..db1c7091a78f 100644 --- a/test/functional/apps/dashboard/dashboard_options.js +++ b/test/functional/apps/dashboard/dashboard_options.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/dashboard_query_bar.js b/test/functional/apps/dashboard/dashboard_query_bar.js index 224ae819de8d..f6f3b8a89451 100644 --- a/test/functional/apps/dashboard/dashboard_query_bar.js +++ b/test/functional/apps/dashboard/dashboard_query_bar.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/dashboard/dashboard_save.js b/test/functional/apps/dashboard/dashboard_save.js index 31b155916607..83ddaf480472 100644 --- a/test/functional/apps/dashboard/dashboard_save.js +++ b/test/functional/apps/dashboard/dashboard_save.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects }) { const PageObjects = getPageObjects(['dashboard', 'header']); diff --git a/test/functional/apps/dashboard/dashboard_snapshots.js b/test/functional/apps/dashboard/dashboard_snapshots.js index 0f382f79cd09..62c2e2254602 100644 --- a/test/functional/apps/dashboard/dashboard_snapshots.js +++ b/test/functional/apps/dashboard/dashboard_snapshots.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects, updateBaselines }) { const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common']); diff --git a/test/functional/apps/dashboard/dashboard_state.js b/test/functional/apps/dashboard/dashboard_state.js index ed8999eb5977..ca50e81d924e 100644 --- a/test/functional/apps/dashboard/dashboard_state.js +++ b/test/functional/apps/dashboard/dashboard_state.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PIE_CHART_VIS_NAME, AREA_CHART_VIS_NAME } from '../../page_objects/dashboard_page'; import { diff --git a/test/functional/apps/dashboard/dashboard_time.js b/test/functional/apps/dashboard/dashboard_time.js index b34d061f608a..8ce77f7ee46f 100644 --- a/test/functional/apps/dashboard/dashboard_time.js +++ b/test/functional/apps/dashboard/dashboard_time.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const dashboardName = 'Dashboard Test Time'; diff --git a/test/functional/apps/dashboard/data_shared_attributes.js b/test/functional/apps/dashboard/data_shared_attributes.js index 27ac2184071f..8a760b6f35d0 100644 --- a/test/functional/apps/dashboard/data_shared_attributes.js +++ b/test/functional/apps/dashboard/data_shared_attributes.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/embed_mode.js b/test/functional/apps/dashboard/embed_mode.js index 22fb42108ce2..f5b99bf30ca9 100644 --- a/test/functional/apps/dashboard/embed_mode.js +++ b/test/functional/apps/dashboard/embed_mode.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/embeddable_rendering.js b/test/functional/apps/dashboard/embeddable_rendering.js index 97d8e2ec15f6..614a66c4f473 100644 --- a/test/functional/apps/dashboard/embeddable_rendering.js +++ b/test/functional/apps/dashboard/embeddable_rendering.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; /** * This tests both that one of each visualization can be added to a dashboard (as opposed to opening an existing diff --git a/test/functional/apps/dashboard/empty_dashboard.js b/test/functional/apps/dashboard/empty_dashboard.js index 36f57d48c510..26745ed61910 100644 --- a/test/functional/apps/dashboard/empty_dashboard.js +++ b/test/functional/apps/dashboard/empty_dashboard.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); diff --git a/test/functional/apps/dashboard/full_screen_mode.js b/test/functional/apps/dashboard/full_screen_mode.js index 68bb2f58be8d..0475c40eff0c 100644 --- a/test/functional/apps/dashboard/full_screen_mode.js +++ b/test/functional/apps/dashboard/full_screen_mode.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/panel_controls.js b/test/functional/apps/dashboard/panel_controls.js index 39f1eca46494..c5c98f191421 100644 --- a/test/functional/apps/dashboard/panel_controls.js +++ b/test/functional/apps/dashboard/panel_controls.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PIE_CHART_VIS_NAME } from '../../page_objects/dashboard_page'; import { diff --git a/test/functional/apps/dashboard/panel_expand_toggle.js b/test/functional/apps/dashboard/panel_expand_toggle.js index af74fe6a4829..e61d4f4015a0 100644 --- a/test/functional/apps/dashboard/panel_expand_toggle.js +++ b/test/functional/apps/dashboard/panel_expand_toggle.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/dashboard/time_zones.js b/test/functional/apps/dashboard/time_zones.js index 514b0366d19b..10f91448c370 100644 --- a/test/functional/apps/dashboard/time_zones.js +++ b/test/functional/apps/dashboard/time_zones.js @@ -18,7 +18,7 @@ */ import path from 'path'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const pieChart = getService('pieChart'); diff --git a/test/functional/apps/dashboard/view_edit.js b/test/functional/apps/dashboard/view_edit.js index 7851d5320f2e..edef26dbc2d3 100644 --- a/test/functional/apps/dashboard/view_edit.js +++ b/test/functional/apps/dashboard/view_edit.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const queryBar = getService('queryBar'); diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index d4167b5cfae7..e6c783a80156 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/discover/_errors.js b/test/functional/apps/discover/_errors.js index 87cdba3d9ed6..060639d5c49b 100644 --- a/test/functional/apps/discover/_errors.js +++ b/test/functional/apps/discover/_errors.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index d295a502094a..dc2c1b468f98 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/discover/_inspector.js b/test/functional/apps/discover/_inspector.js index 5b269ef6902d..6a2144e82992 100644 --- a/test/functional/apps/discover/_inspector.js +++ b/test/functional/apps/discover/_inspector.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['common', 'visualize', 'timePicker']); diff --git a/test/functional/apps/discover/_large_string.js b/test/functional/apps/discover/_large_string.js index 9feed7c9202e..426779bd0c49 100644 --- a/test/functional/apps/discover/_large_string.js +++ b/test/functional/apps/discover/_large_string.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index bfe90cf17003..4b85593d1f02 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/discover/_sidebar.js b/test/functional/apps/discover/_sidebar.js index 865b0ea7d71b..26a47b0a1242 100644 --- a/test/functional/apps/discover/_sidebar.js +++ b/test/functional/apps/discover/_sidebar.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/discover/_source_filters.js b/test/functional/apps/discover/_source_filters.js index a230c5625ac8..14ecde383fd4 100644 --- a/test/functional/apps/discover/_source_filters.js +++ b/test/functional/apps/discover/_source_filters.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/getting_started/_shakespeare.js b/test/functional/apps/getting_started/_shakespeare.js index 4dd763900110..39bb6acb7494 100644 --- a/test/functional/apps/getting_started/_shakespeare.js +++ b/test/functional/apps/getting_started/_shakespeare.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/home/_add_data.js b/test/functional/apps/home/_add_data.js index f6cf02e51826..7b6fa5c1614d 100644 --- a/test/functional/apps/home/_add_data.js +++ b/test/functional/apps/home/_add_data.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/home/_home.js b/test/functional/apps/home/_home.js index 3eaa0c5bdef1..f4a9b53d89ec 100644 --- a/test/functional/apps/home/_home.js +++ b/test/functional/apps/home/_home.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { diff --git a/test/functional/apps/home/_navigation.js b/test/functional/apps/home/_navigation.js index c31b3a6100cd..cc297856e045 100644 --- a/test/functional/apps/home/_navigation.js +++ b/test/functional/apps/home/_navigation.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { diff --git a/test/functional/apps/home/_sample_data.js b/test/functional/apps/home/_sample_data.js index 700eea39f461..e77996224094 100644 --- a/test/functional/apps/home/_sample_data.js +++ b/test/functional/apps/home/_sample_data.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/management/_create_index_pattern_wizard.js b/test/functional/apps/management/_create_index_pattern_wizard.js index 5cde83bed5f9..3539fd975b74 100644 --- a/test/functional/apps/management/_create_index_pattern_wizard.js +++ b/test/functional/apps/management/_create_index_pattern_wizard.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_handle_alias.js b/test/functional/apps/management/_handle_alias.js index 7a866a0274bc..1556897d6938 100644 --- a/test/functional/apps/management/_handle_alias.js +++ b/test/functional/apps/management/_handle_alias.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/management/_handle_version_conflict.js b/test/functional/apps/management/_handle_version_conflict.js index 722e855edf3a..ce5f968a3711 100644 --- a/test/functional/apps/management/_handle_version_conflict.js +++ b/test/functional/apps/management/_handle_version_conflict.js @@ -27,7 +27,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/management/_import_objects.js b/test/functional/apps/management/_import_objects.js index 7fc7bf276289..73e5e7e0cecb 100644 --- a/test/functional/apps/management/_import_objects.js +++ b/test/functional/apps/management/_import_objects.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import path from 'path'; export default function ({ getService, getPageObjects }) { diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index 251a17ec1bfd..b49bdd5bf738 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_index_pattern_filter.js b/test/functional/apps/management/_index_pattern_filter.js index a27d52d75b35..0985639ac3c9 100644 --- a/test/functional/apps/management/_index_pattern_filter.js +++ b/test/functional/apps/management/_index_pattern_filter.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_index_pattern_popularity.js b/test/functional/apps/management/_index_pattern_popularity.js index 32ee0a8934c4..72f368c9c714 100644 --- a/test/functional/apps/management/_index_pattern_popularity.js +++ b/test/functional/apps/management/_index_pattern_popularity.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_index_pattern_results_sort.js b/test/functional/apps/management/_index_pattern_results_sort.js index f8cfb55db001..d834ad0c1dfd 100644 --- a/test/functional/apps/management/_index_pattern_results_sort.js +++ b/test/functional/apps/management/_index_pattern_results_sort.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_kibana_settings.js b/test/functional/apps/management/_kibana_settings.js index 08cdfa3494e8..084523e00615 100644 --- a/test/functional/apps/management/_kibana_settings.js +++ b/test/functional/apps/management/_kibana_settings.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_mgmt_import_saved_objects.js b/test/functional/apps/management/_mgmt_import_saved_objects.js index 914c989cf1c6..973e394078c4 100644 --- a/test/functional/apps/management/_mgmt_import_saved_objects.js +++ b/test/functional/apps/management/_mgmt_import_saved_objects.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import path from 'path'; export default function ({ getService, getPageObjects }) { diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index 86e7ab7b51a3..a3077e965dd4 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -29,7 +29,7 @@ // 3. Filter in Discover by the scripted field // 4. Visualize with aggregation on the scripted field by clicking discover.clickFieldListItemVisualize -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_scripted_fields_filter.js b/test/functional/apps/management/_scripted_fields_filter.js index 21be262e1809..8783e5a10c19 100644 --- a/test/functional/apps/management/_scripted_fields_filter.js +++ b/test/functional/apps/management/_scripted_fields_filter.js @@ -18,7 +18,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/test/functional/apps/management/_scripted_fields_preview.js b/test/functional/apps/management/_scripted_fields_preview.js index 093d242ba368..f6f2de7c793d 100644 --- a/test/functional/apps/management/_scripted_fields_preview.js +++ b/test/functional/apps/management/_scripted_fields_preview.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const browser = getService('browser'); diff --git a/test/functional/apps/management/_test_huge_fields.js b/test/functional/apps/management/_test_huge_fields.js index 3fde7937a769..57b65c33055d 100644 --- a/test/functional/apps/management/_test_huge_fields.js +++ b/test/functional/apps/management/_test_huge_fields.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/test/functional/apps/status_page/index.js b/test/functional/apps/status_page/index.js index 52d26cd9f3a4..34f2df287dd6 100644 --- a/test/functional/apps/status_page/index.js +++ b/test/functional/apps/status_page/index.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/test/functional/apps/timelion/_expression_typeahead.js b/test/functional/apps/timelion/_expression_typeahead.js index aca178a906a8..7cc0740823f3 100644 --- a/test/functional/apps/timelion/_expression_typeahead.js +++ b/test/functional/apps/timelion/_expression_typeahead.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects }) { const PageObjects = getPageObjects(['common', 'timelion', 'settings', 'timePicker']); diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 1fffbc275935..1799a72e5eb1 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_chart_types.js b/test/functional/apps/visualize/_chart_types.js index 0912e1536e87..596c3001285f 100644 --- a/test/functional/apps/visualize/_chart_types.js +++ b/test/functional/apps/visualize/_chart_types.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index 16942dc26e57..02fa7dd62711 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_data_table_nontimeindex.js b/test/functional/apps/visualize/_data_table_nontimeindex.js index eeb58c197c0b..102b70ca8a6b 100644 --- a/test/functional/apps/visualize/_data_table_nontimeindex.js +++ b/test/functional/apps/visualize/_data_table_nontimeindex.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_embedding_chart.js b/test/functional/apps/visualize/_embedding_chart.js index b6caa77d3240..0b59699d4775 100644 --- a/test/functional/apps/visualize/_embedding_chart.js +++ b/test/functional/apps/visualize/_embedding_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const filterBar = getService('filterBar'); diff --git a/test/functional/apps/visualize/_experimental_vis.js b/test/functional/apps/visualize/_experimental_vis.js index 6cce432fd2c3..386185cd9fcc 100644 --- a/test/functional/apps/visualize/_experimental_vis.js +++ b/test/functional/apps/visualize/_experimental_vis.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default ({ getService, getPageObjects }) => { const log = getService('log'); diff --git a/test/functional/apps/visualize/_gauge_chart.js b/test/functional/apps/visualize/_gauge_chart.js index 080f3eaf52eb..d58a2cab872b 100644 --- a/test/functional/apps/visualize/_gauge_chart.js +++ b/test/functional/apps/visualize/_gauge_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_heatmap_chart.js b/test/functional/apps/visualize/_heatmap_chart.js index 795cfbe0e076..075585b4216f 100644 --- a/test/functional/apps/visualize/_heatmap_chart.js +++ b/test/functional/apps/visualize/_heatmap_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_histogram_request_start.js b/test/functional/apps/visualize/_histogram_request_start.js index 95eda5003e7f..e1642c1383fb 100644 --- a/test/functional/apps/visualize/_histogram_request_start.js +++ b/test/functional/apps/visualize/_histogram_request_start.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_input_control_vis.js b/test/functional/apps/visualize/_input_control_vis.js index 8afdaccf4232..a10c0284b3e7 100644 --- a/test/functional/apps/visualize/_input_control_vis.js +++ b/test/functional/apps/visualize/_input_control_vis.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const filterBar = getService('filterBar'); diff --git a/test/functional/apps/visualize/_lab_mode.js b/test/functional/apps/visualize/_lab_mode.js index d45d9cc63662..68440c68e358 100644 --- a/test/functional/apps/visualize/_lab_mode.js +++ b/test/functional/apps/visualize/_lab_mode.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_line_chart.js b/test/functional/apps/visualize/_line_chart.js index 350168006227..e291e58780bd 100644 --- a/test/functional/apps/visualize/_line_chart.js +++ b/test/functional/apps/visualize/_line_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_linked_saved_searches.js b/test/functional/apps/visualize/_linked_saved_searches.js index 9a80126f5447..5343873e9e0a 100644 --- a/test/functional/apps/visualize/_linked_saved_searches.js +++ b/test/functional/apps/visualize/_linked_saved_searches.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const filterBar = getService('filterBar'); diff --git a/test/functional/apps/visualize/_markdown_vis.js b/test/functional/apps/visualize/_markdown_vis.js index 7d6ee24083c4..4fca691153b3 100644 --- a/test/functional/apps/visualize/_markdown_vis.js +++ b/test/functional/apps/visualize/_markdown_vis.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['common', 'visualize', 'header']); diff --git a/test/functional/apps/visualize/_metric_chart.js b/test/functional/apps/visualize/_metric_chart.js index fbece9f72481..904693528553 100644 --- a/test/functional/apps/visualize/_metric_chart.js +++ b/test/functional/apps/visualize/_metric_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_pie_chart.js b/test/functional/apps/visualize/_pie_chart.js index 853cabef206f..583f8328a29e 100644 --- a/test/functional/apps/visualize/_pie_chart.js +++ b/test/functional/apps/visualize/_pie_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_point_series_options.js b/test/functional/apps/visualize/_point_series_options.js index 5d5729e75caf..8e01b87309a0 100644 --- a/test/functional/apps/visualize/_point_series_options.js +++ b/test/functional/apps/visualize/_point_series_options.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_region_map.js b/test/functional/apps/visualize/_region_map.js index f724e0029fd7..053e1bafdbe6 100644 --- a/test/functional/apps/visualize/_region_map.js +++ b/test/functional/apps/visualize/_region_map.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { diff --git a/test/functional/apps/visualize/_shared_item.js b/test/functional/apps/visualize/_shared_item.js index 85861f21a69d..9fe38be15a74 100644 --- a/test/functional/apps/visualize/_shared_item.js +++ b/test/functional/apps/visualize/_shared_item.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_tag_cloud.js b/test/functional/apps/visualize/_tag_cloud.js index 693e435e810b..116c5d10019e 100644 --- a/test/functional/apps/visualize/_tag_cloud.js +++ b/test/functional/apps/visualize/_tag_cloud.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const filterBar = getService('filterBar'); diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index a739ae857717..7d097214c338 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index 6cb5ab6807f5..8018c69bdec2 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; // tslint:disable-next-line:no-default-export diff --git a/test/functional/apps/visualize/_tsvb_markdown.ts b/test/functional/apps/visualize/_tsvb_markdown.ts index 55a5f6f79dc2..3e62eba78a52 100644 --- a/test/functional/apps/visualize/_tsvb_markdown.ts +++ b/test/functional/apps/visualize/_tsvb_markdown.ts @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; // tslint:disable-next-line:no-default-export diff --git a/test/functional/apps/visualize/_vega_chart.js b/test/functional/apps/visualize/_vega_chart.js index 1e7fe5b2fce2..186318ebe632 100644 --- a/test/functional/apps/visualize/_vega_chart.js +++ b/test/functional/apps/visualize/_vega_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['common', 'header', 'timePicker', 'visualize']); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.js b/test/functional/apps/visualize/_vertical_bar_chart.js index b5e7bd122560..54cda5a9ed8b 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.js +++ b/test/functional/apps/visualize/_vertical_bar_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.js b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.js index 992521094fe7..e845742036e8 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.js +++ b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/apps/visualize/_visualize_listing.js b/test/functional/apps/visualize/_visualize_listing.js index 016514c70fad..fda15510b469 100644 --- a/test/functional/apps/visualize/_visualize_listing.js +++ b/test/functional/apps/visualize/_visualize_listing.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects }) { const PageObjects = getPageObjects(['visualize', 'header', 'common']); diff --git a/test/functional/page_objects/common_page.js b/test/functional/page_objects/common_page.js index 9962aa204943..90a8689cfb51 100644 --- a/test/functional/page_objects/common_page.js +++ b/test/functional/page_objects/common_page.js @@ -18,7 +18,7 @@ */ import { delay } from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import getUrl from '../../../src/test_utils/get_url'; diff --git a/test/functional/page_objects/discover_page.js b/test/functional/page_objects/discover_page.js index 531fd9f984a0..502dbf5de17c 100644 --- a/test/functional/page_objects/discover_page.js +++ b/test/functional/page_objects/discover_page.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function DiscoverPageProvider({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index 815f1a851b3f..2e728db3b388 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -18,7 +18,7 @@ */ import { map as mapAsync } from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function SettingsPageProvider({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index d7506442aabc..10822b92219b 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -19,7 +19,7 @@ import { VisualizeConstants } from '../../../src/legacy/core_plugins/kibana/public/visualize/visualize_constants'; import Bluebird from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function VisualizePageProvider({ getService, getPageObjects, updateBaselines }) { const browser = getService('browser'); diff --git a/test/functional/services/dashboard/expectations.js b/test/functional/services/dashboard/expectations.js index e8f85251eefa..cd610e8a5f02 100644 --- a/test/functional/services/dashboard/expectations.js +++ b/test/functional/services/dashboard/expectations.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function DashboardExpectProvider({ getService, getPageObjects }) { const log = getService('log'); diff --git a/test/functional/services/inspector.js b/test/functional/services/inspector.js index eb0de451b240..8a3c54b6556a 100644 --- a/test/functional/services/inspector.js +++ b/test/functional/services/inspector.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function InspectorProvider({ getService }) { const log = getService('log'); diff --git a/test/functional/services/remote/__tests__/remote_default_window_size.js b/test/functional/services/remote/__tests__/remote_default_window_size.js index ffa66bcc7c89..c5ef5fcc3d03 100644 --- a/test/functional/services/remote/__tests__/remote_default_window_size.js +++ b/test/functional/services/remote/__tests__/remote_default_window_size.js @@ -19,7 +19,7 @@ import { fork } from 'child_process'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const FTR_SCRIPT = require.resolve('../../../../../scripts/functional_test_runner'); const CONFIG_PATH = require.resolve('./fixtures/several_nested_window_size_changes/config.js'); diff --git a/test/functional/services/snapshots.js b/test/functional/services/snapshots.js index b19149a8a1af..131be48dd3b1 100644 --- a/test/functional/services/snapshots.js +++ b/test/functional/services/snapshots.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { dirname, resolve } from 'path'; import { writeFile, readFileSync } from 'fs'; import { fromNode as fcb, promisify } from 'bluebird'; diff --git a/test/functional/services/visualizations/pie_chart.js b/test/functional/services/visualizations/pie_chart.js index c5d0d68dec39..cad3f4a589b4 100644 --- a/test/functional/services/visualizations/pie_chart.js +++ b/test/functional/services/visualizations/pie_chart.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function PieChartProvider({ getService }) { const log = getService('log'); diff --git a/test/interpreter_functional/test_suites/run_pipeline/basic.js b/test/interpreter_functional/test_suites/run_pipeline/basic.js index d1ca3240fef1..183fb8e2f1db 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/basic.js +++ b/test/interpreter_functional/test_suites/run_pipeline/basic.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { expectExpressionProvider } from './helpers'; // this file showcases how to use testing utilities defined in helpers.js together with the kbn_tp_run_pipeline diff --git a/test/interpreter_functional/test_suites/run_pipeline/helpers.js b/test/interpreter_functional/test_suites/run_pipeline/helpers.js index 8d8f65bd8d8e..aacdf1f615bd 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/helpers.js +++ b/test/interpreter_functional/test_suites/run_pipeline/helpers.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; // helper for testing interpreter expressions export const expectExpressionProvider = ({ getService, updateBaselines }) => { diff --git a/test/plugin_functional/test_suites/app_plugins/app_navigation.js b/test/plugin_functional/test_suites/app_plugins/app_navigation.js index 1adcde72e1aa..a6c5b9542f56 100644 --- a/test/plugin_functional/test_suites/app_plugins/app_navigation.js +++ b/test/plugin_functional/test_suites/app_plugins/app_navigation.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const appsMenu = getService('appsMenu'); diff --git a/test/plugin_functional/test_suites/custom_visualizations/self_changing_vis.js b/test/plugin_functional/test_suites/custom_visualizations/self_changing_vis.js index dee2515f9bd2..74519b8117b6 100644 --- a/test/plugin_functional/test_suites/custom_visualizations/self_changing_vis.js +++ b/test/plugin_functional/test_suites/custom_visualizations/self_changing_vis.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); diff --git a/test/plugin_functional/test_suites/embedding_visualizations/embed_by_id.js b/test/plugin_functional/test_suites/embedding_visualizations/embed_by_id.js index bd0866882c1f..dbcf859906dc 100644 --- a/test/plugin_functional/test_suites/embedding_visualizations/embed_by_id.js +++ b/test/plugin_functional/test_suites/embedding_visualizations/embed_by_id.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { delay } from 'bluebird'; export default function ({ getService }) { diff --git a/test/plugin_functional/test_suites/panel_actions/panel_actions.js b/test/plugin_functional/test_suites/panel_actions/panel_actions.js index 0202fb1f5d53..d7152e088515 100644 --- a/test/plugin_functional/test_suites/panel_actions/panel_actions.js +++ b/test/plugin_functional/test_suites/panel_actions/panel_actions.js @@ -17,7 +17,7 @@ * under the License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const dashboardPanelActions = getService('dashboardPanelActions'); diff --git a/test/tsconfig.json b/test/tsconfig.json index f72d03a94f26..5df729fbde21 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -3,8 +3,7 @@ "compilerOptions": { "types": [ "node", - "mocha", - "@kbn/test/types/expect.js" + "mocha" ] }, "include": [ diff --git a/tsconfig.json b/tsconfig.json index 59f963b038b8..d9750b3f259d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -53,8 +53,7 @@ "types": [ "node", "jest", - "react", - "@kbn/test/types/expect.js" + "react" ] }, "include": [ diff --git a/tslint.yaml b/tslint.yaml index c914787ec7a6..c6447271a710 100644 --- a/tslint.yaml +++ b/tslint.yaml @@ -67,3 +67,7 @@ rules: * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + module-migration: + - true + - from: expect.js + to: '@kbn/expect' diff --git a/x-pack/common/__tests__/poller.js b/x-pack/common/__tests__/poller.js index 681a70c56280..1e82fcc36728 100644 --- a/x-pack/common/__tests__/poller.js +++ b/x-pack/common/__tests__/poller.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { Poller } from '../poller'; diff --git a/x-pack/package.json b/x-pack/package.json index 413b9ad22be2..2ad347a2d728 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -27,6 +27,7 @@ "devDependencies": { "@kbn/dev-utils": "1.0.0", "@kbn/es": "1.0.0", + "@kbn/expect": "1.0.0", "@kbn/plugin-helpers": "9.0.2", "@kbn/test": "1.0.0", "@storybook/addon-actions": "^4.1.7", @@ -90,7 +91,6 @@ "enzyme-adapter-utils": "^1.10.0", "enzyme-to-json": "^3.3.4", "execa": "^1.0.0", - "expect.js": "0.3.1", "fancy-log": "^1.3.2", "fetch-mock": "7.3.0", "graphql-code-generator": "^0.13.0", diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/__tests__/markdown.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/__tests__/markdown.js index d4ea050951c9..e1b0fe770cd3 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/__tests__/markdown.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/__tests__/markdown.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { markdown } from '../markdown'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from '../../common/__tests__/fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/all.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/all.js index 90558c26d5c8..3cde6599d3da 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/all.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/all.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { all } from '../all'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/alterColumn.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/alterColumn.js index a9ad20c05c6f..e4487b5bb4ca 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/alterColumn.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/alterColumn.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { alterColumn } from '../alterColumn'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/any.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/any.js index bc67aa377e49..5c5b35fa3616 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/any.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/any.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { any } from '../any'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/as.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/as.js index 82a8d2974227..9da489fc9e4f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/as.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/as.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { asFn } from '../as'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/axis_config.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/axis_config.js index 1e4bbccb8ae3..06f7bca30598 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/axis_config.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/axis_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { axisConfig } from '../axisConfig'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from '../__tests__/fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/case.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/case.js index c5fd1f14e79d..37aaa96a7fa1 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/case.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/case.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { caseFn } from '../case'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/clear.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/clear.js index fc6ca6c813d2..80f3b6a4f257 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/clear.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/clear.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { clear } from '../clear'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/columns.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/columns.js index ca1e647cbe9e..f4be4920c573 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/columns.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/columns.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { columns } from '../columns'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js index 2bd31f5d69ff..26e7b83258b3 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { compare } from '../compare'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/container_style.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/container_style.js index 7daef98b0929..77a9bef72d3e 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/container_style.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/container_style.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { containerStyle } from '../containerStyle'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { elasticLogo } from '../../../lib/elastic_logo'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/context.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/context.js index da162dc9150b..7d3ce308d679 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/context.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/context.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { context } from '../context'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable, emptyTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/csv.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/csv.js index 8f79cab5577a..03bd7669063b 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/csv.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/csv.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { csv } from '../csv'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/date.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/date.js index 94b6e7eb4f67..7f79f7cbc463 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/date.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/date.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { date } from '../date'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/do.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/do.js index 000e614a35c9..6cb6af5405c2 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/do.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/do.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { doFn } from '../do'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/dropdown_control.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/dropdown_control.js index 437e55a197c4..0c977759b18a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/dropdown_control.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/dropdown_control.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { dropdownControl } from '../dropdownControl'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/eq.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/eq.js index a419dd98f3ff..1e03c73cbcf2 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/eq.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/eq.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { eq } from '../eq'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/exactly.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/exactly.js index e9f37efd15c2..444befdcd0ff 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/exactly.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/exactly.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { exactly } from '../exactly'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyFilter } from './fixtures/test_filters'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/filterrows.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/filterrows.js index baa7096cb632..6ab8fd58f27e 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/filterrows.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/filterrows.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { filterrows } from '../filterrows'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/font.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/font.js index 0bd5871b03ad..0848d7361b68 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/font.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/font.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { openSans } from '../../../../common/lib/fonts'; import { font } from '../font'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatdate.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatdate.js index d9f916907904..bcbd5f4b5eca 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatdate.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatdate.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { formatdate } from '../formatdate'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatnumber.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatnumber.js index b0d8a7df62f1..c0e10f308002 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatnumber.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/formatnumber.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { formatnumber } from '../formatnumber'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/getCell.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/getCell.js index 7b73dbec4df0..f780aadb4032 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/getCell.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/getCell.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getCell } from '../getCell'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_flot_axis_config.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_flot_axis_config.js index 2a1fca38f268..0e309f667ac8 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_flot_axis_config.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_flot_axis_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getFlotAxisConfig } from '../plot/get_flot_axis_config'; import { xAxisConfig, yAxisConfig, hideAxis } from './fixtures/test_styles'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_font_spec.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_font_spec.js index 4f2fb67cd938..91555ee0382f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_font_spec.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_font_spec.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { defaultSpec, getFontSpec } from '../plot/get_font_spec'; import { fontStyle } from './fixtures/test_styles'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_tick_hash.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_tick_hash.js index 02412862d951..7ca21c792003 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_tick_hash.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/get_tick_hash.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getTickHash } from '../plot/get_tick_hash'; describe('getTickHash', () => { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gt.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gt.js index ca490aa88fec..7f0e259a5211 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gt.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gt.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { gt } from '../gt'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gte.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gte.js index ba4f0f7a3f9b..a6d88b2d839a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gte.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/gte.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { gte } from '../gte'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/head.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/head.js index d9cd5a074376..2822eb39ae47 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/head.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/head.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { head } from '../head'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/if.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/if.js index aee9efc5203c..4c95af2c40bc 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/if.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/if.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ifFn } from '../if'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js index 304d970882bf..0d1c80665f57 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { image } from '../image'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { elasticLogo } from '../../../lib/elastic_logo'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lt.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lt.js index 3597bd3805d6..abc0f6e66641 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lt.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lt.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { lt } from '../lt'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lte.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lte.js index e800b72c13ff..3eeadbb62b27 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lte.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/lte.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { lte } from '../lte'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/mapColumn.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/mapColumn.js index 87db17cf8b31..bdcdf3962554 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/mapColumn.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/mapColumn.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { mapColumn } from '../mapColumn'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable, emptyTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/math.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/math.js index f290cce86515..da5069764927 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/math.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/math.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { math } from '../math'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/metric.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/metric.js index 587e7fbf1f8b..f59b0c7bf52a 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/metric.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/metric.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { metric } from '../metric'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { fontStyle } from './fixtures/test_styles'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/neq.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/neq.js index 3d2ca7b90017..c4abc22249dc 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/neq.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/neq.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { neq } from '../neq'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/palette.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/palette.js index ecb3ed8b2bbd..d3f828cfbcf0 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/palette.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/palette.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { palette } from '../palette'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { palettes } from '../../../../common/lib/palettes'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/pie.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/pie.js index 2048b6763fb2..d51c718ca4ce 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/pie.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/pie.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { pie } from '../pie'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testPie } from './fixtures/test_pointseries'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/plot.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/plot.js index 3d6c62419ef4..fadf847135a4 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/plot.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/plot.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { plot } from '../plot'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testPlot } from './fixtures/test_pointseries'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/ply.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/ply.js index 54e33de91a47..b22ac6df0ed3 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/ply.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/ply.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ply } from '../ply'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js index 61df4292e025..70ff9d2c6a28 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { progress } from '../progress'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { fontStyle } from './fixtures/test_styles'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/render.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/render.js index 720242418e0a..c29df283fdc1 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/render.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/render.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { render } from '../render'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/repeat_image.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/repeat_image.js index 0a18b7d25071..65d17cf2d638 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/repeat_image.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/repeat_image.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { repeatImage } from '../repeatImage'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { elasticOutline } from '../../../lib/elastic_outline'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/replace.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/replace.js index 55fcbf10d7fd..3eea71fb1cdb 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/replace.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/replace.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { replace } from '../replace'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/reveal_image.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/reveal_image.js index 3a3707e7c0b7..8f33f831c834 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/reveal_image.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/reveal_image.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { revealImage } from '../revealImage'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { elasticOutline } from '../../../lib/elastic_outline'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rounddate.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rounddate.js index ab66ef05f4f2..6f4402d5234f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rounddate.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rounddate.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { rounddate } from '../rounddate'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rowCount.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rowCount.js index c50f39f7b308..350ffca635d8 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rowCount.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/rowCount.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { rowCount } from '../rowCount'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style.js index a0de47643594..9130f0d34e45 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { seriesStyle } from '../seriesStyle'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style_to_flot.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style_to_flot.js index adb6b48b9b28..e84c9fc6e6e6 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style_to_flot.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/series_style_to_flot.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { seriesStyleToFlot } from '../plot/series_style_to_flot'; describe('seriesStyleToFlot', () => { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/sort.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/sort.js index 9940be856ec9..3c927cde9ccd 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/sort.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/sort.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { sort } from '../sort'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/staticColumn.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/staticColumn.js index 01d00a3b74bf..d34a2fe4c3e4 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/staticColumn.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/staticColumn.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { staticColumn } from '../staticColumn'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable, emptyTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/string.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/string.js index 7961d0553644..5fd11273df7f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/string.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/string.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { string } from '../string'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/switch.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/switch.js index 769b0ae8c557..8a7b52ae87a8 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/switch.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/switch.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { switchFn } from '../switch'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/table.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/table.js index 0980f4b124f4..4ba2b3149e06 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/table.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/table.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { table } from '../table'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/tail.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/tail.js index 2e2148237df3..05e1b2e8f91d 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/tail.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/tail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { tail } from '../tail'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; import { emptyTable, testTable } from './fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter.js index 70a3a007b889..76bc2ee9ed0f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { timefilter } from '../timefilter'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter_control.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter_control.js index 1341f961412d..e46c9c0f1981 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter_control.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/timefilter_control.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { timefilterControl } from '../timefilterControl'; import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/demodata.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/demodata.js index 1871bc560b79..1892029395a7 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/demodata.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/demodata.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { demodata } from '../demodata'; const nullFilter = { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_expression_type.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_expression_type.js index f22daa0a8cf5..3e621145e068 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_expression_type.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_expression_type.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getExpressionType } from '../pointseries/lib/get_expression_type'; import { emptyTable, testTable } from '../../common/__tests__/fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_field_names.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_field_names.js index 9b3f9990d112..2cf9693a5f15 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_field_names.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/get_field_names.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parse } from 'tinymath'; import { getFieldNames } from '../pointseries/lib/get_field_names'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/is_column_reference.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/is_column_reference.js index 10951e73b301..8e8a760be9a2 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/is_column_reference.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/is_column_reference.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isColumnReference } from '../pointseries/lib/is_column_reference'; describe('isColumnReference', () => { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/pointseries.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/pointseries.js index c2c7fb8f4a47..f8e7c7f650b6 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/pointseries.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/__tests__/pointseries.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { pointseries } from '../pointseries'; import { emptyTable, testTable } from '../../common/__tests__/fixtures/test_tables'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js index cf1ae0ea37af..dbc129094acf 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getFormObject } from '../get_form_object'; describe('getFormObject', () => { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/autocomplete.js b/x-pack/plugins/canvas/common/lib/__tests__/autocomplete.js index 72d79adf2a03..58d689c029f6 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/autocomplete.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/autocomplete.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { functionSpecs } from '../../../__tests__/fixtures/function_specs'; import { getAutocompleteSuggestions } from '../autocomplete'; diff --git a/x-pack/plugins/canvas/common/lib/__tests__/find_in_object.js b/x-pack/plugins/canvas/common/lib/__tests__/find_in_object.js index b07cd4563a12..f3fa5ebb81a1 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/find_in_object.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/find_in_object.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { findInObject } from '../find_in_object'; const findMe = { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/get_colors_from_palette.js b/x-pack/plugins/canvas/common/lib/__tests__/get_colors_from_palette.js index 79824edc2e2f..e397bda763f1 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/get_colors_from_palette.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/get_colors_from_palette.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getColorsFromPalette } from '../../lib/get_colors_from_palette'; import { grayscalePalette, diff --git a/x-pack/plugins/canvas/common/lib/__tests__/get_field_type.js b/x-pack/plugins/canvas/common/lib/__tests__/get_field_type.js index cb8f7f68a796..974880e74e32 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/get_field_type.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/get_field_type.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getFieldType } from '../get_field_type'; import { emptyTable, diff --git a/x-pack/plugins/canvas/common/lib/__tests__/get_legend_config.js b/x-pack/plugins/canvas/common/lib/__tests__/get_legend_config.js index cca2cd73d0fa..ba43db7a8367 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/get_legend_config.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/get_legend_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLegendConfig } from '../get_legend_config'; describe('getLegendConfig', () => { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/httpurl.js b/x-pack/plugins/canvas/common/lib/__tests__/httpurl.js index 5d7397ed87a5..cefe2530a01f 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/httpurl.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/httpurl.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isValidHttpUrl } from '../httpurl'; describe('httpurl.isValidHttpUrl', () => { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/latest_change.js b/x-pack/plugins/canvas/common/lib/__tests__/latest_change.js index cc5c246b2c07..f3678267540b 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/latest_change.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/latest_change.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { latestChange } from '../latest_change'; describe('latestChange', () => { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/pivot_object_array.js b/x-pack/plugins/canvas/common/lib/__tests__/pivot_object_array.js index 58173c4c5a87..1ef875feacdc 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/pivot_object_array.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/pivot_object_array.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { pivotObjectArray } from '../pivot_object_array'; describe('pivotObjectArray', () => { diff --git a/x-pack/plugins/canvas/common/lib/__tests__/unquote_string.js b/x-pack/plugins/canvas/common/lib/__tests__/unquote_string.js index 465338816f15..52fcabf5ae7e 100644 --- a/x-pack/plugins/canvas/common/lib/__tests__/unquote_string.js +++ b/x-pack/plugins/canvas/common/lib/__tests__/unquote_string.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { unquoteString } from '../unquote_string'; describe('unquoteString', () => { diff --git a/x-pack/plugins/canvas/public/components/download/__tests__/download.js b/x-pack/plugins/canvas/public/components/download/__tests__/download.js index 36c3a199e6fc..6697730b0db6 100644 --- a/x-pack/plugins/canvas/public/components/download/__tests__/download.js +++ b/x-pack/plugins/canvas/public/components/download/__tests__/download.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { render } from 'enzyme'; import { Download } from '../'; diff --git a/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js b/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js index bae592801f53..c159f478766c 100644 --- a/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js +++ b/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { shallow } from 'enzyme'; import { EuiLoadingSpinner, EuiIcon } from '@elastic/eui'; import { Loading } from '../loading'; diff --git a/x-pack/plugins/canvas/public/functions/__tests__/asset.js b/x-pack/plugins/canvas/public/functions/__tests__/asset.js index ea9f1d051ca6..208af754e910 100644 --- a/x-pack/plugins/canvas/public/functions/__tests__/asset.js +++ b/x-pack/plugins/canvas/public/functions/__tests__/asset.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { functionWrapper } from '../../../__tests__/helpers/function_wrapper'; import { asset } from '../asset'; diff --git a/x-pack/plugins/canvas/public/lib/__tests__/clipboard.js b/x-pack/plugins/canvas/public/lib/__tests__/clipboard.js index d940701c2e71..c616a76d0dcc 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/clipboard.js +++ b/x-pack/plugins/canvas/public/lib/__tests__/clipboard.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { setClipboardData, getClipboardData } from '../clipboard'; import { elements } from '../../../__tests__/fixtures/workpads'; diff --git a/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js b/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js index 68c45d0eb7e4..756dd4e36e75 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js +++ b/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import lzString from 'lz-string'; import { historyProvider } from '../history_provider'; diff --git a/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js b/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js index c5d84e74a3e0..75454890f971 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js +++ b/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { prepend, append } from '../modify_path'; describe('modify paths', () => { diff --git a/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js b/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js index 24665a11c50f..9e582ddd1858 100644 --- a/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js +++ b/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getState, getValue, getError } from '../resolved_arg'; describe('resolved arg helper', () => { 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 index a1e5418b0daf..198ccb2ffc38 100644 --- 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 @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSiblingContext } from '../elements'; const state = { diff --git a/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js b/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js index 0a5db9119896..e1f7509325a7 100644 --- a/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js +++ b/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { get } from 'lodash'; import { elementsReducer } from '../elements'; import { actionCreator } from './fixtures/action_creator'; diff --git a/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js index 7b8bc923a20c..ef52a80b8960 100644 --- a/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js +++ b/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as actions from '../../actions/resolved_args'; import { flushContextAfterIndex } from '../../actions/elements'; import { resolvedArgsReducer } from '../resolved_args'; diff --git a/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js index 6fa3b4e35db0..315720192785 100644 --- a/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js +++ b/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as selector from '../resolved_args'; describe('resolved args selector', () => { diff --git a/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js b/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js index f1ff31874935..5cfdf726dd25 100644 --- a/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js +++ b/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as selector from '../workpad'; describe('workpad selectors', () => { diff --git a/x-pack/plugins/canvas/server/usage/__tests__/collector.handle_response.js b/x-pack/plugins/canvas/server/usage/__tests__/collector.handle_response.js index 06c12ca61493..edb90f90612a 100644 --- a/x-pack/plugins/canvas/server/usage/__tests__/collector.handle_response.js +++ b/x-pack/plugins/canvas/server/usage/__tests__/collector.handle_response.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleResponse } from '../collector'; import { workpads } from '../../../__tests__/fixtures/workpads'; diff --git a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_es_error.js index b8d59590ebf3..f3237563edb4 100644 --- a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/cross_cluster_replication/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/cross_cluster_replication/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/plugins/cross_cluster_replication/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/plugins/cross_cluster_replication/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/plugins/cross_cluster_replication/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/plugins/cross_cluster_replication/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/cross_cluster_replication/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index ffbbd1395a41..dc641bef9108 100644 --- a/x-pack/plugins/cross_cluster_replication/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/cross_cluster_replication/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_auth_scope.js b/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_auth_scope.js index d3f28a1556b8..644d006de400 100644 --- a/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_auth_scope.js +++ b/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_auth_scope.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { CONFIG_DASHBOARD_ONLY_MODE_ROLES, diff --git a/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_request_interceptor.js b/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_request_interceptor.js index b8c46c9e97f1..7250293fd50b 100644 --- a/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_request_interceptor.js +++ b/x-pack/plugins/dashboard_mode/server/__tests__/dashboard_mode_request_interceptor.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Hapi from 'hapi'; import Chance from 'chance'; diff --git a/x-pack/plugins/graph/public/__tests__/workspace.js b/x-pack/plugins/graph/public/__tests__/workspace.js index 2b3fe539377a..592872c96ee0 100644 --- a/x-pack/plugins/graph/public/__tests__/workspace.js +++ b/x-pack/plugins/graph/public/__tests__/workspace.js @@ -5,7 +5,7 @@ */ const gws = require('../graphClientWorkspace.js'); -const expect = require('expect.js'); +const expect = require('@kbn/expect'); describe('graphui-workspace', function () { describe('createWorkspace()', function () { diff --git a/x-pack/plugins/graph/server/lib/__tests__/check_license.js b/x-pack/plugins/graph/server/lib/__tests__/check_license.js index abdb1fb316bd..c341dfbc378c 100644 --- a/x-pack/plugins/graph/server/lib/__tests__/check_license.js +++ b/x-pack/plugins/graph/server/lib/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import sinon from 'sinon'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/grokdebugger/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/grokdebugger/server/lib/check_license/__tests__/check_license.js index 7d2c0d73c442..556abf1a405b 100644 --- a/x-pack/plugins/grokdebugger/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/grokdebugger/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/grokdebugger/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/grokdebugger/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index 9196b8b81347..5458dfa9599a 100644 --- a/x-pack/plugins/grokdebugger/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/grokdebugger/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Boom from 'boom'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; diff --git a/x-pack/plugins/grokdebugger/server/models/grokdebugger_request/__tests__/grokdebugger_request.js b/x-pack/plugins/grokdebugger/server/models/grokdebugger_request/__tests__/grokdebugger_request.js index a6bc0448a0d1..a87999873e40 100644 --- a/x-pack/plugins/grokdebugger/server/models/grokdebugger_request/__tests__/grokdebugger_request.js +++ b/x-pack/plugins/grokdebugger/server/models/grokdebugger_request/__tests__/grokdebugger_request.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { GrokdebuggerRequest } from '../grokdebugger_request'; describe('grokdebugger_request', () => { diff --git a/x-pack/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js b/x-pack/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js index f483352a70d3..b4e7eb0814bf 100644 --- a/x-pack/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js +++ b/x-pack/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { GrokdebuggerResponse } from '../grokdebugger_response'; describe('grokdebugger_response', () => { diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/index_lifecycle_management/server/lib/check_license/__tests__/check_license.js index 19a7b5675926..394c2c4735c0 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_es_error.js index 394c18214000..467cc4fcdae1 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/plugins/index_lifecycle_management/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/plugins/index_lifecycle_management/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/index_lifecycle_management/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index 359b3fb2ce6f..24cbaae2b2b6 100644 --- a/x-pack/plugins/index_lifecycle_management/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/index_lifecycle_management/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/conjunction.js b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/conjunction.js index 496d15f6b32a..e24b7e455e04 100644 --- a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/conjunction.js +++ b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/conjunction.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSuggestionsProvider } from '../conjunction'; describe('Kuery conjunction suggestions', function () { diff --git a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/escape_kuery.js b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/escape_kuery.js index 9ec2086f8c59..ae43f5d7f8ca 100644 --- a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/escape_kuery.js +++ b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/escape_kuery.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { escapeQuotes, escapeKuery } from '../escape_kuery'; describe('Kuery escape', function () { diff --git a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/field.js b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/field.js index 6535886d372c..f95615ae40c2 100644 --- a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/field.js +++ b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/field.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSuggestionsProvider } from '../field'; import indexPatternResponse from '../__fixtures__/index_pattern_response.json'; import { isFilterable } from 'ui/index_patterns/static_utils'; diff --git a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/operator.js b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/operator.js index a9bc8e988aac..d56601c997f8 100644 --- a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/operator.js +++ b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/operator.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSuggestionsProvider } from '../operator'; import indexPatternResponse from '../__fixtures__/index_pattern_response.json'; diff --git a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/value.js b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/value.js index e7120ca428ac..d2cce4fe5928 100644 --- a/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/value.js +++ b/x-pack/plugins/kuery_autocomplete/public/autocomplete_providers/__tests__/value.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import fetchMock from 'fetch-mock'; import { getSuggestionsProvider } from '../value'; diff --git a/x-pack/plugins/logstash/common/lib/__tests__/get_moment.js b/x-pack/plugins/logstash/common/lib/__tests__/get_moment.js index 69ccd634ec6e..a90099f465cc 100755 --- a/x-pack/plugins/logstash/common/lib/__tests__/get_moment.js +++ b/x-pack/plugins/logstash/common/lib/__tests__/get_moment.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getMoment } from '../get_moment'; describe('get_moment', () => { diff --git a/x-pack/plugins/logstash/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/logstash/server/lib/check_license/__tests__/check_license.js index 449ff3a60b9e..0a8014c1b861 100755 --- a/x-pack/plugins/logstash/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/logstash/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100755 --- a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_es_error.js index f1b956bdcc3b..4d5e0852b9e0 100755 --- a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100755 --- a/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/logstash/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/logstash/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js b/x-pack/plugins/logstash/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js index 582c021892d4..5e532b68e2bc 100755 --- a/x-pack/plugins/logstash/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js +++ b/x-pack/plugins/logstash/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { fetchAllFromScroll } from '../fetch_all_from_scroll'; import { set } from 'lodash'; diff --git a/x-pack/plugins/logstash/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/logstash/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index c63eef750bee..fb71aba3fa94 100755 --- a/x-pack/plugins/logstash/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/logstash/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/logstash/server/models/cluster/__tests__/cluster.js b/x-pack/plugins/logstash/server/models/cluster/__tests__/cluster.js index 04c47389ee71..2f7af6a564b0 100755 --- a/x-pack/plugins/logstash/server/models/cluster/__tests__/cluster.js +++ b/x-pack/plugins/logstash/server/models/cluster/__tests__/cluster.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Cluster } from '../cluster'; describe('cluster', () => { diff --git a/x-pack/plugins/logstash/server/models/pipeline/__tests__/pipeline.js b/x-pack/plugins/logstash/server/models/pipeline/__tests__/pipeline.js index bbce4d29007b..ed95abef2e22 100755 --- a/x-pack/plugins/logstash/server/models/pipeline/__tests__/pipeline.js +++ b/x-pack/plugins/logstash/server/models/pipeline/__tests__/pipeline.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Pipeline } from '../pipeline'; describe('pipeline', () => { diff --git a/x-pack/plugins/logstash/server/models/pipeline_list_item/__tests__/pipeline_list_item.js b/x-pack/plugins/logstash/server/models/pipeline_list_item/__tests__/pipeline_list_item.js index 9bd5955dd41d..90bbd2d7b1df 100755 --- a/x-pack/plugins/logstash/server/models/pipeline_list_item/__tests__/pipeline_list_item.js +++ b/x-pack/plugins/logstash/server/models/pipeline_list_item/__tests__/pipeline_list_item.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PipelineListItem } from '../pipeline_list_item'; describe('pipeline_list_item', () => { diff --git a/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js b/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js index 1403856019f8..d966d7d5a06a 100644 --- a/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js +++ b/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSeverity, getSeverityWithLow, diff --git a/x-pack/plugins/ml/common/util/__tests__/job_utils.js b/x-pack/plugins/ml/common/util/__tests__/job_utils.js index ea53af72b066..12711a8d0296 100644 --- a/x-pack/plugins/ml/common/util/__tests__/job_utils.js +++ b/x-pack/plugins/ml/common/util/__tests__/job_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { calculateDatafeedFrequencyDefaultSeconds, isTimeSeriesViewJob, diff --git a/x-pack/plugins/ml/common/util/__tests__/parse_interval.js b/x-pack/plugins/ml/common/util/__tests__/parse_interval.js index 44d647563fb1..d06e1412b509 100644 --- a/x-pack/plugins/ml/common/util/__tests__/parse_interval.js +++ b/x-pack/plugins/ml/common/util/__tests__/parse_interval.js @@ -7,7 +7,7 @@ import { parseInterval } from '../parse_interval'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML parse interval util', function () { it('correctly parses an interval containing unit and value', function () { diff --git a/x-pack/plugins/ml/common/util/__tests__/string_utils.js b/x-pack/plugins/ml/common/util/__tests__/string_utils.js index 16e416af3806..e2a791c74bd7 100644 --- a/x-pack/plugins/ml/common/util/__tests__/string_utils.js +++ b/x-pack/plugins/ml/common/util/__tests__/string_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { renderTemplate } from '../string_utils'; describe('ML - string utils', () => { diff --git a/x-pack/plugins/ml/public/components/annotations/annotations_table/__tests__/annotations_table_directive.js b/x-pack/plugins/ml/public/components/annotations/annotations_table/__tests__/annotations_table_directive.js index 2a382992fa59..d53271aba551 100644 --- a/x-pack/plugins/ml/public/components/annotations/annotations_table/__tests__/annotations_table_directive.js +++ b/x-pack/plugins/ml/public/components/annotations/annotations_table/__tests__/annotations_table_directive.js @@ -7,7 +7,7 @@ import jobConfig from '../../../../../common/types/__mocks__/job_config_farequote'; import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { ml } from '../../../../services/ml_api_service'; diff --git a/x-pack/plugins/ml/public/components/chart_tooltip/__tests__/chart_tooltip.js b/x-pack/plugins/ml/public/components/chart_tooltip/__tests__/chart_tooltip.js index 817e5894211b..a542b5284b70 100644 --- a/x-pack/plugins/ml/public/components/chart_tooltip/__tests__/chart_tooltip.js +++ b/x-pack/plugins/ml/public/components/chart_tooltip/__tests__/chart_tooltip.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { mlChartTooltipService } from '../chart_tooltip_service'; diff --git a/x-pack/plugins/ml/public/components/confirm_modal/__tests__/confirm_modal_controller.js b/x-pack/plugins/ml/public/components/confirm_modal/__tests__/confirm_modal_controller.js index 764b6ca2eaf0..0f7d525e19cb 100644 --- a/x-pack/plugins/ml/public/components/confirm_modal/__tests__/confirm_modal_controller.js +++ b/x-pack/plugins/ml/public/components/confirm_modal/__tests__/confirm_modal_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const mockModalInstance = { close: function () {}, dismiss: function () {} }; diff --git a/x-pack/plugins/ml/public/components/controls/select_interval/__tests__/select_interval_directive.js b/x-pack/plugins/ml/public/components/controls/select_interval/__tests__/select_interval_directive.js index aa18b75e26d2..67b39d9bf85f 100644 --- a/x-pack/plugins/ml/public/components/controls/select_interval/__tests__/select_interval_directive.js +++ b/x-pack/plugins/ml/public/components/controls/select_interval/__tests__/select_interval_directive.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { interval$ } from '../select_interval'; diff --git a/x-pack/plugins/ml/public/components/form_label/__tests__/form_label.js b/x-pack/plugins/ml/public/components/form_label/__tests__/form_label.js index 756bfbae6c9d..25d76e79d8a0 100644 --- a/x-pack/plugins/ml/public/components/form_label/__tests__/form_label.js +++ b/x-pack/plugins/ml/public/components/form_label/__tests__/form_label.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - ', () => { let $scope; diff --git a/x-pack/plugins/ml/public/components/json_tooltip/__tests__/json_tooltip.js b/x-pack/plugins/ml/public/components/json_tooltip/__tests__/json_tooltip.js index ae0ed7f557af..889778c64445 100644 --- a/x-pack/plugins/ml/public/components/json_tooltip/__tests__/json_tooltip.js +++ b/x-pack/plugins/ml/public/components/json_tooltip/__tests__/json_tooltip.js @@ -5,7 +5,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getTooltips } from '../tooltips'; diff --git a/x-pack/plugins/ml/public/components/kql_filter_bar/__tests__/utils.js b/x-pack/plugins/ml/public/components/kql_filter_bar/__tests__/utils.js index 512c26a5cdc8..9d7880eaf4e7 100644 --- a/x-pack/plugins/ml/public/components/kql_filter_bar/__tests__/utils.js +++ b/x-pack/plugins/ml/public/components/kql_filter_bar/__tests__/utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { removeFilterFromQueryString, getQueryPattern } from '../utils'; describe('ML - KqlFilterBar utils', () => { diff --git a/x-pack/plugins/ml/public/components/loading_indicator/__tests__/loading_indicator_directive.js b/x-pack/plugins/ml/public/components/loading_indicator/__tests__/loading_indicator_directive.js index 391e5a255047..c0d461d95cd7 100644 --- a/x-pack/plugins/ml/public/components/loading_indicator/__tests__/loading_indicator_directive.js +++ b/x-pack/plugins/ml/public/components/loading_indicator/__tests__/loading_indicator_directive.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - ', () => { let $scope; diff --git a/x-pack/plugins/ml/public/components/messagebar/__tests__/messagebar.js b/x-pack/plugins/ml/public/components/messagebar/__tests__/messagebar.js index 2727d69e5ef3..5cbcdd9b8afc 100644 --- a/x-pack/plugins/ml/public/components/messagebar/__tests__/messagebar.js +++ b/x-pack/plugins/ml/public/components/messagebar/__tests__/messagebar.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Message Bar Controller', () => { beforeEach(() => { diff --git a/x-pack/plugins/ml/public/components/rule_editor/__tests__/utils.js b/x-pack/plugins/ml/public/components/rule_editor/__tests__/utils.js index bde9ebe4df3c..88818a3c978b 100644 --- a/x-pack/plugins/ml/public/components/rule_editor/__tests__/utils.js +++ b/x-pack/plugins/ml/public/components/rule_editor/__tests__/utils.js @@ -5,7 +5,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isValidRule, buildRuleDescription, diff --git a/x-pack/plugins/ml/public/datavisualizer/__tests__/datavisualizer_controller.js b/x-pack/plugins/ml/public/datavisualizer/__tests__/datavisualizer_controller.js index a130512216d0..9283f8233546 100644 --- a/x-pack/plugins/ml/public/datavisualizer/__tests__/datavisualizer_controller.js +++ b/x-pack/plugins/ml/public/datavisualizer/__tests__/datavisualizer_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; // Import this way to be able to stub/mock functions later on in the tests using sinon. diff --git a/x-pack/plugins/ml/public/explorer/__tests__/explorer_controller.js b/x-pack/plugins/ml/public/explorer/__tests__/explorer_controller.js index 19fa6632c14d..d4fe0de11ca0 100644 --- a/x-pack/plugins/ml/public/explorer/__tests__/explorer_controller.js +++ b/x-pack/plugins/ml/public/explorer/__tests__/explorer_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Explorer Controller', () => { beforeEach(() => { diff --git a/x-pack/plugins/ml/public/formatters/__tests__/abbreviate_whole_number.js b/x-pack/plugins/ml/public/formatters/__tests__/abbreviate_whole_number.js index 582d9bac39d7..4e85bae4b186 100644 --- a/x-pack/plugins/ml/public/formatters/__tests__/abbreviate_whole_number.js +++ b/x-pack/plugins/ml/public/formatters/__tests__/abbreviate_whole_number.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { abbreviateWholeNumber } from '../abbreviate_whole_number'; describe('ML - abbreviateWholeNumber formatter', () => { diff --git a/x-pack/plugins/ml/public/formatters/__tests__/format_value.js b/x-pack/plugins/ml/public/formatters/__tests__/format_value.js index 69362e76cece..ffdbdd915d3a 100644 --- a/x-pack/plugins/ml/public/formatters/__tests__/format_value.js +++ b/x-pack/plugins/ml/public/formatters/__tests__/format_value.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment-timezone'; import { formatValue } from '../format_value'; diff --git a/x-pack/plugins/ml/public/formatters/__tests__/metric_change_description.js b/x-pack/plugins/ml/public/formatters/__tests__/metric_change_description.js index 9c4b1516915a..45864ce58bf8 100644 --- a/x-pack/plugins/ml/public/formatters/__tests__/metric_change_description.js +++ b/x-pack/plugins/ml/public/formatters/__tests__/metric_change_description.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getMetricChangeDescription } from '../metric_change_description'; diff --git a/x-pack/plugins/ml/public/formatters/__tests__/round_to_decimal_place.js b/x-pack/plugins/ml/public/formatters/__tests__/round_to_decimal_place.js index 389c53300b36..b7e63846c530 100644 --- a/x-pack/plugins/ml/public/formatters/__tests__/round_to_decimal_place.js +++ b/x-pack/plugins/ml/public/formatters/__tests__/round_to_decimal_place.js @@ -5,7 +5,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { roundToDecimalPlace } from '../round_to_decimal_place'; describe('ML - roundToDecimalPlace formatter', () => { diff --git a/x-pack/plugins/ml/public/jobs/new_job/advanced/__tests__/new_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/advanced/__tests__/new_job_controller.js index 704f1466b405..2061066ca3df 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/advanced/__tests__/new_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/advanced/__tests__/new_job_controller.js @@ -6,7 +6,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Advanced Job Wizard - New Job Controller', () => { beforeEach(() => { diff --git a/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_filter_modal/__tests__/detector_filter_modal_controller.js b/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_filter_modal/__tests__/detector_filter_modal_controller.js index 8e7e31ac5afd..e712cad93200 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_filter_modal/__tests__/detector_filter_modal_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_filter_modal/__tests__/detector_filter_modal_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const mockModalInstance = { close: function () {}, dismiss: function () {} }; diff --git a/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_modal/__tests__/detector_modal_controller.js b/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_modal/__tests__/detector_modal_controller.js index 235a8ba321d4..002050e0413f 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_modal/__tests__/detector_modal_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/advanced/detector_modal/__tests__/detector_modal_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const mockModalInstance = { close: function () {}, dismiss: function () {} }; diff --git a/x-pack/plugins/ml/public/jobs/new_job/advanced/save_status_modal/__tests__/save_status_modal_controller.js b/x-pack/plugins/ml/public/jobs/new_job/advanced/save_status_modal/__tests__/save_status_modal_controller.js index 97411067f41e..a86202f546c6 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/advanced/save_status_modal/__tests__/save_status_modal_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/advanced/save_status_modal/__tests__/save_status_modal_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const mockModalInstance = { close: function () { }, dismiss: function () { } }; diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/__tests__/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/__tests__/create_job_controller.js index 448d1bfa600d..12ed469ab610 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/__tests__/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/__tests__/create_job_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; // Import this way to be able to stub/mock functions later on in the tests using sinon. diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/__tests__/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/__tests__/create_job_controller.js index 430be2c92737..de0d4860184e 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/__tests__/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/__tests__/create_job_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; // Import this way to be able to stub/mock functions later on in the tests using sinon. diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/__tests__/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/__tests__/create_job_controller.js index 2ea1913461ca..06c6b90323cf 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/__tests__/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/__tests__/create_job_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Recognize Wizard - Create Job Controller', () => { diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/single_metric/create_job/__tests__/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/single_metric/create_job/__tests__/create_job_controller.js index ea7622a08af2..930f6756eb06 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/single_metric/create_job/__tests__/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/single_metric/create_job/__tests__/create_job_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; // Import this way to be able to stub/mock functions later on in the tests using sinon. diff --git a/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/index_or_search/__tests__/index_or_search_controller.js b/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/index_or_search/__tests__/index_or_search_controller.js index d06a045b6147..6e277d24908f 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/index_or_search/__tests__/index_or_search_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/index_or_search/__tests__/index_or_search_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Index Or Search Controller', () => { beforeEach(() => { diff --git a/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/job_type/__tests__/job_type_controller.js b/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/job_type/__tests__/job_type_controller.js index 33500fd19951..f8fd13b2ae36 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/job_type/__tests__/job_type_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/wizard/steps/job_type/__tests__/job_type_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; // Import this way to be able to stub/mock functions later on in the tests using sinon. diff --git a/x-pack/plugins/ml/public/license/__tests__/check_license.js b/x-pack/plugins/ml/public/license/__tests__/check_license.js index 92dd5d27db61..b65b5fa246d9 100644 --- a/x-pack/plugins/ml/public/license/__tests__/check_license.js +++ b/x-pack/plugins/ml/public/license/__tests__/check_license.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { xpackFeatureProvider, } from '../check_license'; diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseries_chart_directive.js b/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseries_chart_directive.js index 19e68e6cbcca..9ee71c676c6c 100644 --- a/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseries_chart_directive.js +++ b/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseries_chart_directive.js @@ -5,7 +5,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { TimeseriesChart } from '../components/timeseries_chart/timeseries_chart'; diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseriesexplorer_controller.js b/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseriesexplorer_controller.js index 6c3bb0a9a325..42510c5a30fd 100644 --- a/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseriesexplorer_controller.js +++ b/x-pack/plugins/ml/public/timeseriesexplorer/__tests__/timeseriesexplorer_controller.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('ML - Time Series Explorer Controller', () => { beforeEach(() => { diff --git a/x-pack/plugins/ml/public/util/__tests__/app_state_utils.js b/x-pack/plugins/ml/public/util/__tests__/app_state_utils.js index 2b0224ff112b..3653d23464b6 100644 --- a/x-pack/plugins/ml/public/util/__tests__/app_state_utils.js +++ b/x-pack/plugins/ml/public/util/__tests__/app_state_utils.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { BehaviorSubject } from 'rxjs'; diff --git a/x-pack/plugins/ml/public/util/__tests__/chart_utils.js b/x-pack/plugins/ml/public/util/__tests__/chart_utils.js index 979615f2778b..0949605e9599 100644 --- a/x-pack/plugins/ml/public/util/__tests__/chart_utils.js +++ b/x-pack/plugins/ml/public/util/__tests__/chart_utils.js @@ -8,7 +8,7 @@ import $ from 'jquery'; import d3 from 'd3'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { chartLimits, filterAxisLabels, diff --git a/x-pack/plugins/ml/public/util/__tests__/custom_url_utils.js b/x-pack/plugins/ml/public/util/__tests__/custom_url_utils.js index 9d7537ec2315..2081fbcb8138 100644 --- a/x-pack/plugins/ml/public/util/__tests__/custom_url_utils.js +++ b/x-pack/plugins/ml/public/util/__tests__/custom_url_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { replaceTokensInUrlValue, getUrlForRecord, diff --git a/x-pack/plugins/ml/public/util/__tests__/field_types_utils.js b/x-pack/plugins/ml/public/util/__tests__/field_types_utils.js index 80426d1005aa..c04545be05b3 100644 --- a/x-pack/plugins/ml/public/util/__tests__/field_types_utils.js +++ b/x-pack/plugins/ml/public/util/__tests__/field_types_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ML_JOB_FIELD_TYPES, KBN_FIELD_TYPES } from 'plugins/ml/../common/constants/field_types'; import { kbnTypeToMLJobType } from 'plugins/ml/util/field_types_utils'; diff --git a/x-pack/plugins/ml/public/util/__tests__/ml_time_buckets.js b/x-pack/plugins/ml/public/util/__tests__/ml_time_buckets.js index 57069994ef91..c0ac9487a1ff 100644 --- a/x-pack/plugins/ml/public/util/__tests__/ml_time_buckets.js +++ b/x-pack/plugins/ml/public/util/__tests__/ml_time_buckets.js @@ -7,7 +7,7 @@ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { IntervalHelperProvider, diff --git a/x-pack/plugins/ml/public/util/__tests__/string_utils.js b/x-pack/plugins/ml/public/util/__tests__/string_utils.js index e8d4d5645d18..bdf467a9399a 100644 --- a/x-pack/plugins/ml/public/util/__tests__/string_utils.js +++ b/x-pack/plugins/ml/public/util/__tests__/string_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { replaceStringTokens, detectorToString, diff --git a/x-pack/plugins/ml/server/client/__tests__/elasticsearch_ml.js b/x-pack/plugins/ml/server/client/__tests__/elasticsearch_ml.js index dd2ade261f0b..87ab4573c509 100644 --- a/x-pack/plugins/ml/server/client/__tests__/elasticsearch_ml.js +++ b/x-pack/plugins/ml/server/client/__tests__/elasticsearch_ml.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { elasticsearchJsPlugin } from '../elasticsearch_ml'; diff --git a/x-pack/plugins/ml/server/lib/__tests__/query_utils.js b/x-pack/plugins/ml/server/lib/__tests__/query_utils.js index 1a936bdf9655..671bbf1a9487 100644 --- a/x-pack/plugins/ml/server/lib/__tests__/query_utils.js +++ b/x-pack/plugins/ml/server/lib/__tests__/query_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { buildBaseFilterCriteria, buildSamplerAggregation, diff --git a/x-pack/plugins/ml/server/lib/__tests__/security_utils.js b/x-pack/plugins/ml/server/lib/__tests__/security_utils.js index fbcd3ee281a4..073b6c3c50b8 100644 --- a/x-pack/plugins/ml/server/lib/__tests__/security_utils.js +++ b/x-pack/plugins/ml/server/lib/__tests__/security_utils.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isSecurityDisabled } from '../security_utils'; diff --git a/x-pack/plugins/ml/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/ml/server/lib/check_license/__tests__/check_license.js index 8ed3158e9b64..f65b9c98be8e 100644 --- a/x-pack/plugins/ml/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/ml/server/lib/check_license/__tests__/check_license.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { set } from 'lodash'; import { checkLicense, isBasicLicense } from '../check_license'; diff --git a/x-pack/plugins/ml/server/models/bucket_span_estimator/__tests__/bucket_span_estimator.js b/x-pack/plugins/ml/server/models/bucket_span_estimator/__tests__/bucket_span_estimator.js index 06a937ed68ac..7b52ed9000e5 100644 --- a/x-pack/plugins/ml/server/models/bucket_span_estimator/__tests__/bucket_span_estimator.js +++ b/x-pack/plugins/ml/server/models/bucket_span_estimator/__tests__/bucket_span_estimator.js @@ -7,7 +7,7 @@ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { estimateBucketSpanFactory } from '../bucket_span_estimator'; // Mock callWithRequest with the ability to simulate returning different diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/job_validation.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/job_validation.js index 70f338f71927..6747743676f7 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/job_validation.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/job_validation.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { validateJob } from '../job_validation'; // mock callWithRequest diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_bucket_span.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_bucket_span.js index 7253f393b2cd..30bced32688f 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_bucket_span.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_bucket_span.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { validateBucketSpan } from '../validate_bucket_span'; import { SKIP_BUCKET_SPAN_ESTIMATION } from '../../../../common/constants/validation'; diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_cardinality.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_cardinality.js index aa48d9f8df4e..876b4542f688 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_cardinality.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_cardinality.js @@ -7,7 +7,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { validateCardinality } from '../validate_cardinality'; import mockFareQuoteCardinality from './mock_farequote_cardinality'; diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_influencers.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_influencers.js index 4d4b4e0ebeed..38a1c5731b3b 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_influencers.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_influencers.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { validateInfluencers } from '../validate_influencers'; describe('ML - validateInfluencers', () => { diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_model_memory_limit.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_model_memory_limit.js index da65d5928d81..2184445481eb 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_model_memory_limit.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_model_memory_limit.js @@ -6,7 +6,7 @@ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { validateModelMemoryLimit } from '../validate_model_memory_limit'; describe('ML - validateModelMemoryLimit', () => { diff --git a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_time_range.js b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_time_range.js index f8a4bb2c9da0..17297d6c863b 100644 --- a/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_time_range.js +++ b/x-pack/plugins/ml/server/models/job_validation/__tests__/validate_time_range.js @@ -7,7 +7,7 @@ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isValidTimeField, validateTimeRange } from '../validate_time_range'; import mockTimeField from './mock_time_field'; diff --git a/x-pack/plugins/monitoring/__tests__/deprecations.js b/x-pack/plugins/monitoring/__tests__/deprecations.js index 2bc46bbe9974..9e444651d4cb 100644 --- a/x-pack/plugins/monitoring/__tests__/deprecations.js +++ b/x-pack/plugins/monitoring/__tests__/deprecations.js @@ -5,7 +5,7 @@ */ import { noop } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { deprecations as deprecationsModule } from '../deprecations'; import sinon from 'sinon'; diff --git a/x-pack/plugins/monitoring/common/__tests__/format_timestamp_to_duration.js b/x-pack/plugins/monitoring/common/__tests__/format_timestamp_to_duration.js index 1ff2f1b7a7e7..6a4469341809 100644 --- a/x-pack/plugins/monitoring/common/__tests__/format_timestamp_to_duration.js +++ b/x-pack/plugins/monitoring/common/__tests__/format_timestamp_to_duration.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { formatTimestampToDuration } from '../format_timestamp_to_duration'; import { CALCULATE_DURATION_SINCE, CALCULATE_DURATION_UNTIL } from '../constants'; diff --git a/x-pack/plugins/monitoring/public/components/alerts/__tests__/map_severity.js b/x-pack/plugins/monitoring/public/components/alerts/__tests__/map_severity.js index 13734f1d96f2..c2f1ef703846 100644 --- a/x-pack/plugins/monitoring/public/components/alerts/__tests__/map_severity.js +++ b/x-pack/plugins/monitoring/public/components/alerts/__tests__/map_severity.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { mapSeverity } from '../map_severity'; describe('mapSeverity', () => { diff --git a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_color.js b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_color.js index 900c19ec8f76..7b70f1d1fb22 100644 --- a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_color.js +++ b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_color.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getColor } from '../get_color'; describe('getColors', function () { diff --git a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_last_value.js b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_last_value.js index 7f81cc3c0e8b..97f77882631c 100644 --- a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_last_value.js +++ b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_last_value.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLastValue } from '../get_last_value'; describe('monitoringChartGetLastValue', function () { diff --git a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_title.js b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_title.js index e981924060a7..20c1c1303d15 100644 --- a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_title.js +++ b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_title.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getTitle } from '../get_title'; describe('getTitle', function () { diff --git a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_values_for_legend.js b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_values_for_legend.js index 0f2e56621208..1338d40470ed 100644 --- a/x-pack/plugins/monitoring/public/components/chart/__tests__/get_values_for_legend.js +++ b/x-pack/plugins/monitoring/public/components/chart/__tests__/get_values_for_legend.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { findIndexByX, getValuesByX, getValuesForSeriesIndex } from '../get_values_for_legend'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/config.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/config.js index 887e7fd678fd..82814428a800 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/config.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { Config } from '../config'; import { Graph } from '../graph'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/pipeline_state.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/pipeline_state.js index 1a734debc21e..ae0c88da39cd 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/pipeline_state.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/__tests__/pipeline_state.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { PipelineState } from '../pipeline_state'; import { Config } from '../config'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/boolean_edge.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/boolean_edge.js index a1abcf6385f7..3d1979c42ef8 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/boolean_edge.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/boolean_edge.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { BooleanEdge } from '../boolean_edge'; import { Edge } from '../edge'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge.js index 00105ce32703..db8f2446a8c4 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Edge } from '../edge'; describe('Edge', () => { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge_factory.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge_factory.js index cb9b831f4e35..e206d080d358 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge_factory.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/edge_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { edgeFactory } from '../edge_factory'; import { Edge } from '../edge'; import { BooleanEdge } from '../boolean_edge'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/if_vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/if_vertex.js index 4b98217e1817..cc4bb419f0f2 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/if_vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/if_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { IfVertex } from '../if_vertex'; import { Vertex } from '../vertex'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/index.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/index.js index 4844ef90d1c6..0c0a014efdc9 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/index.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/index.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Graph } from '../'; import { Vertex } from '../vertex'; import { PluginVertex } from '../plugin_vertex'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js index 45d4789b73b3..8d9ccc17c282 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Vertex } from '../vertex'; import { PluginVertex, diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/queue_vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/queue_vertex.js index eb091e6bdf68..997306f52cc5 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/queue_vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/queue_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { QueueVertex } from '../queue_vertex'; import { Vertex } from '../vertex'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex.js index bc29533affd6..3c2a68ad67cc 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Graph } from '../'; describe('Vertex', () => { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex_factory.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex_factory.js index 5cb914a5e421..cbfa070fe201 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex_factory.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/vertex_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { vertexFactory } from '../vertex_factory'; import { PluginVertex } from '../plugin_vertex'; import { IfVertex } from '../if_vertex'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/if_statement.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/if_statement.js index a4347f508a77..1f2d68ba5ee5 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/if_statement.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/if_statement.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { IfStatement } from '../if_statement'; import { PluginVertex } from '../../graph/plugin_vertex'; import { IfElement } from '../../list/if_element'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/make_statement.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/make_statement.js index eb5754169d00..c1794852d342 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/make_statement.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/make_statement.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { makeStatement } from '../make_statement'; import { PluginVertex } from '../../graph/plugin_vertex'; import { IfVertex } from '../../graph/if_vertex'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/pipeline.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/pipeline.js index b8c835b9bd4b..7f96298b1530 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/pipeline.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/pipeline.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Pipeline } from '../'; import { Graph } from '../../graph'; import { IfStatement } from '../if_statement'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/plugin_statement.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/plugin_statement.js index eafde6839eda..3bbce82b3f02 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/plugin_statement.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/plugin_statement.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { PluginStatement } from '../plugin_statement'; describe('PluginStatement class', () => { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/queue.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/queue.js index 4f7060461486..7288065e282e 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/queue.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/queue.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Queue } from '../queue'; describe('Queue class', () => { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/statement.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/statement.js index f695bf36d2a1..e2c0904a0938 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/statement.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/statement.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Statement } from '../statement'; describe('Statement class', () => { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/utils.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/utils.js index 53c7a1a3d0f2..fc50c3b9dfed 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/utils.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/__tests__/utils.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isVertexPipelineStage } from '../utils'; describe('Utils', () => { diff --git a/x-pack/plugins/monitoring/public/directives/main/__tests__/monitoring_main_controller.js b/x-pack/plugins/monitoring/public/directives/main/__tests__/monitoring_main_controller.js index 98a107d6e25c..927387b42e1b 100644 --- a/x-pack/plugins/monitoring/public/directives/main/__tests__/monitoring_main_controller.js +++ b/x-pack/plugins/monitoring/public/directives/main/__tests__/monitoring_main_controller.js @@ -5,7 +5,7 @@ */ import { noop } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { MonitoringMainController } from '../'; const getMockLicenseService = (options) => ({ mlIsSupported: () => options.mlIsSupported }); diff --git a/x-pack/plugins/monitoring/public/lib/__tests__/format_number.js b/x-pack/plugins/monitoring/public/lib/__tests__/format_number.js index 209207b52db4..e26e637c7a39 100644 --- a/x-pack/plugins/monitoring/public/lib/__tests__/format_number.js +++ b/x-pack/plugins/monitoring/public/lib/__tests__/format_number.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { formatNumber, formatBytesUsage } from '../format_number'; diff --git a/x-pack/plugins/monitoring/public/lib/logstash/__tests__/pipelines.js b/x-pack/plugins/monitoring/public/lib/logstash/__tests__/pipelines.js index 7013db3d9356..bb914379aa11 100644 --- a/x-pack/plugins/monitoring/public/lib/logstash/__tests__/pipelines.js +++ b/x-pack/plugins/monitoring/public/lib/logstash/__tests__/pipelines.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isPipelineMonitoringSupportedInVersion } from '../pipelines'; describe('pipelines', () => { diff --git a/x-pack/plugins/monitoring/public/services/__tests__/breadcrumbs.js b/x-pack/plugins/monitoring/public/services/__tests__/breadcrumbs.js index 6943d6f4e068..547505c0d5fe 100644 --- a/x-pack/plugins/monitoring/public/services/__tests__/breadcrumbs.js +++ b/x-pack/plugins/monitoring/public/services/__tests__/breadcrumbs.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { breadcrumbsProvider } from '../breadcrumbs_provider'; import { MonitoringMainController } from 'plugins/monitoring/directives/main'; diff --git a/x-pack/plugins/monitoring/public/services/__tests__/executor_provider.js b/x-pack/plugins/monitoring/public/services/__tests__/executor_provider.js index 805fac434bd6..36ab9431058e 100644 --- a/x-pack/plugins/monitoring/public/services/__tests__/executor_provider.js +++ b/x-pack/plugins/monitoring/public/services/__tests__/executor_provider.js @@ -5,7 +5,7 @@ */ import ngMock from 'ng_mock'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { executorProvider } from '../executor_provider'; import Promise from 'bluebird'; diff --git a/x-pack/plugins/monitoring/public/views/__tests__/base_controller.js b/x-pack/plugins/monitoring/public/views/__tests__/base_controller.js index b10e27872879..ed9899183463 100644 --- a/x-pack/plugins/monitoring/public/views/__tests__/base_controller.js +++ b/x-pack/plugins/monitoring/public/views/__tests__/base_controller.js @@ -5,7 +5,7 @@ */ import { spy, stub } from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { MonitoringViewBaseController } from '../'; import { timefilter } from 'ui/timefilter'; diff --git a/x-pack/plugins/monitoring/public/views/__tests__/base_table_controller.js b/x-pack/plugins/monitoring/public/views/__tests__/base_table_controller.js index 8614fa90a6af..5c2791d781f4 100644 --- a/x-pack/plugins/monitoring/public/views/__tests__/base_table_controller.js +++ b/x-pack/plugins/monitoring/public/views/__tests__/base_table_controller.js @@ -5,7 +5,7 @@ */ import { spy, stub } from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { MonitoringViewBaseTableController } from '../'; describe('MonitoringViewBaseTableController', function () { diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/aws.js b/x-pack/plugins/monitoring/server/cloud/__tests__/aws.js index 37e0c5531ea0..4339d0fe3df9 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/aws.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/aws.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { AWS, AWSCloudService } from '../aws'; describe('AWS', () => { diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/azure.js b/x-pack/plugins/monitoring/server/cloud/__tests__/azure.js index 4e6efe9463b5..cb5251f7844f 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/azure.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/azure.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { AZURE } from '../azure'; describe('Azure', () => { diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_detector.js b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_detector.js index 19e49bec43c8..f290f789a319 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_detector.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_detector.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { CloudDetector } from '../cloud_detector'; describe('CloudDetector', () => { diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_response.js b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_response.js index a8cb5c8949c6..e0f31615ed15 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_response.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_response.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { CloudServiceResponse } from '../cloud_response'; describe('CloudServiceResponse', () => { diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_service.js b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_service.js index 34d47d24c51e..72c40b0a29b8 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_service.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_service.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { CloudService } from '../cloud_service'; import { CloudServiceResponse } from '../cloud_response'; diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_services.js b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_services.js index 99c5a0845971..e1139db313e9 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_services.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/cloud_services.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { CLOUD_SERVICES } from '../cloud_services'; import { AWS } from '../aws'; import { AZURE } from '../azure'; diff --git a/x-pack/plugins/monitoring/server/cloud/__tests__/gcp.js b/x-pack/plugins/monitoring/server/cloud/__tests__/gcp.js index 467ea8b5ff0c..88b9e9e3e1c3 100644 --- a/x-pack/plugins/monitoring/server/cloud/__tests__/gcp.js +++ b/x-pack/plugins/monitoring/server/cloud/__tests__/gcp.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { GCP } from '../gcp'; describe('GCP', () => { diff --git a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_cluster_search.js b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_cluster_search.js index 1b7d9a0f58bf..b790aba05351 100644 --- a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_cluster_search.js +++ b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_cluster_search.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { createStubs } from './fixtures/create_stubs'; import { alertsClusterSearch } from '../alerts_cluster_search'; diff --git a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_clusters_aggregation.js b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_clusters_aggregation.js index f209a5f17789..8af04a4bdb7b 100644 --- a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_clusters_aggregation.js +++ b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/alerts_clusters_aggregation.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { merge } from 'lodash'; import { createStubs } from './fixtures/create_stubs'; diff --git a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/check_license.js b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/check_license.js index df3876367b18..ec18d85752a6 100644 --- a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/check_license.js +++ b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/check_license.js @@ -5,7 +5,7 @@ */ import { checkLicense, checkLicenseGenerator } from '../check_license'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; describe('Monitoring Check License', () => { diff --git a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/verify_monitoring_license.js b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/verify_monitoring_license.js index 86902c6400ad..c70c298bf359 100644 --- a/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/verify_monitoring_license.js +++ b/x-pack/plugins/monitoring/server/cluster_alerts/__tests__/verify_monitoring_license.js @@ -5,7 +5,7 @@ */ import { verifyMonitoringLicense } from '../verify_monitoring_license'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; describe('Monitoring Verify License', () => { diff --git a/x-pack/plugins/monitoring/server/es_client/__tests__/instantiate_client.js b/x-pack/plugins/monitoring/server/es_client/__tests__/instantiate_client.js index 6ebd3fb7fd05..bc2afc7c25e1 100644 --- a/x-pack/plugins/monitoring/server/es_client/__tests__/instantiate_client.js +++ b/x-pack/plugins/monitoring/server/es_client/__tests__/instantiate_client.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { get, noop } from 'lodash'; import { exposeClient, hasMonitoringCluster } from '../instantiate_client'; diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/__tests__/bulk_uploader.js b/x-pack/plugins/monitoring/server/kibana_monitoring/__tests__/bulk_uploader.js index 6f7b6b338353..6c034ddac626 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/__tests__/bulk_uploader.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/__tests__/bulk_uploader.js @@ -6,7 +6,7 @@ import { noop } from 'lodash'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { BulkUploader } from '../bulk_uploader'; const FETCH_INTERVAL = 300; diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/check_for_email_value.js b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/check_for_email_value.js index 4189903684a9..9823fd603221 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/check_for_email_value.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/check_for_email_value.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { checkForEmailValue } from '../get_settings_collector'; describe('getSettingsCollector / checkForEmailValue', () => { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js index 0d32c1d47985..083e6de3599a 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { set } from 'lodash'; diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/event_roller.js b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/event_roller.js index 61b1e6a673d9..a97a3e28564f 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/event_roller.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/event_roller.js @@ -5,7 +5,7 @@ */ import { EventRoller } from '../event_roller'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; const events = [ { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_requests.js b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_requests.js index 6fb139283038..a5baeb452928 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_requests.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_requests.js @@ -6,7 +6,7 @@ import _ from 'lodash'; import { mapRequests } from '../map_requests'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Map requests', () => { it('flatten ports', () => { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_response_times.js b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_response_times.js index 224b948732f0..15c987ec3326 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_response_times.js +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/__tests__/map_response_times.js @@ -6,7 +6,7 @@ import { isEqual } from 'lodash'; import { mapResponseTimes } from '../map_response_times'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Map response times', () => { it('flatten ports', () => { diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_auto.js b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_auto.js index 50bcac815045..879f42f78797 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_auto.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_auto.js @@ -5,7 +5,7 @@ */ import { calculateAuto } from '../calculate_auto.js'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; import moment from 'moment'; diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_availabiilty.js b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_availabiilty.js index fb8193e6afcd..3f70db5124fc 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_availabiilty.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_availabiilty.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { calculateAvailability } from '../calculate_availability'; diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_overall_status.js b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_overall_status.js index 8019c3f30977..88c84a08541b 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_overall_status.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_overall_status.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { calculateOverallStatus } from '../calculate_overall_status'; describe('Calculate Kibana Cluster Helath', () => { diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_rate.js b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_rate.js index c9fac06fac7d..3dc8808d1699 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_rate.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_rate.js @@ -5,7 +5,7 @@ */ import { calculateRate } from '../calculate_rate'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Calculate Rate', () => { it('returns null when all fields are undefined', () => { diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_timeseries_interval.js b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_timeseries_interval.js index 8c2cf3c97aa1..3c4061490ebc 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/calculate_timeseries_interval.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/calculate_timeseries_interval.js @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { calculateTimeseriesInterval } from '../calculate_timeseries_interval'; describe('calculateTimeseriesInterval', () => { diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/ccs_utils.js b/x-pack/plugins/monitoring/server/lib/__tests__/ccs_utils.js index e2aa07ad78ee..d17177102dbf 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/ccs_utils.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/ccs_utils.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { parseCrossClusterPrefix, prefixIndexPattern } from '../ccs_utils'; diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/create_query.js b/x-pack/plugins/monitoring/server/lib/__tests__/create_query.js index 8ad0e4e5a953..cc064c4688f8 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/create_query.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/create_query.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { MissingRequiredError } from '../error_missing_required'; import { ElasticsearchMetric } from '../metrics'; diff --git a/x-pack/plugins/monitoring/server/lib/__tests__/process_version_string.js b/x-pack/plugins/monitoring/server/lib/__tests__/process_version_string.js index 14f6870331db..729e43d2f0c7 100644 --- a/x-pack/plugins/monitoring/server/lib/__tests__/process_version_string.js +++ b/x-pack/plugins/monitoring/server/lib/__tests__/process_version_string.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { normalizeVersionString } from '../normalize_version_string'; describe('Normalizing Version String', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/create_beats_query.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/create_beats_query.js index 0e6c8ba53aa2..d4b47070c80a 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/create_beats_query.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/create_beats_query.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createBeatsQuery } from '../create_beats_query'; describe('createBeatsQuery', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beat_summary.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beat_summary.js index 8cf25533178b..fc5124b7d304 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beat_summary.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beat_summary.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_beat_summary'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('get_beat_summary', () => { it('Handles empty aggregation', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats.js index bbe9de2da5eb..73b1bf77b3e0 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_beats'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('beats/get_beats', () => { it('Handles empty response', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats_for_clusters.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats_for_clusters.js index 2a77e2825a11..9fa13b71637a 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats_for_clusters.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_beats_for_clusters.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_beats_for_clusters'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('get_beats_for_clusters', () => { it('Handles empty aggregation', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_latest_stats.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_latest_stats.js index ec21e1865224..39b85baf7311 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_latest_stats.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_latest_stats.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_latest_stats'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('beats/get_latest_stats', () => { it('Handle empty response', () => { diff --git a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_stats.js b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_stats.js index 857259dd4b23..bf47aa1a2a56 100644 --- a/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_stats.js +++ b/x-pack/plugins/monitoring/server/lib/beats/__tests__/get_stats.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_stats'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('beats/get_stats', () => { it('Handle empty response', () => { diff --git a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/flag_supported_clusters.js b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/flag_supported_clusters.js index b5358a1f5478..78c98ba05b8a 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/flag_supported_clusters.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/flag_supported_clusters.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { flagSupportedClusters } from '../flag_supported_clusters'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_cluster_status.js b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_cluster_status.js index e6df2396ea34..87f61a0ba87c 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_cluster_status.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_cluster_status.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getClusterStatus } from '../get_cluster_status'; let clusterStats = {}; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_state.js b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_state.js index 3c5f8d2822df..0b7dabeba72d 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_state.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_state.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_clusters_state'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { set } from 'lodash'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_stats.js b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_stats.js index cd9098a29020..e4755e704bf9 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_stats.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleClusterStats } from '../get_clusters_stats'; describe('handleClusterStats', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_last_recovery.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_last_recovery.js index 7bec0eacd964..bd867a7475f1 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_last_recovery.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_last_recovery.js @@ -5,7 +5,7 @@ */ import { handleLastRecoveries, filterOldShardActivity } from '../get_last_recovery'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('get_last_recovery', () => { // Note: times are from the epoch! diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_ml_jobs.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_ml_jobs.js index b661f11a2720..f97b56d538a8 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_ml_jobs.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/__tests__/get_ml_jobs.js @@ -5,7 +5,7 @@ */ import { set } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleResponse } from '../get_ml_jobs'; describe('Get ML Jobs', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_index_summary.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_index_summary.js index 1f395a746420..114984c3f6d7 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_index_summary.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_index_summary.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleResponse } from '../get_index_summary'; describe('get_index_summary handleResponse', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_indices.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_indices.js index fbe84b9e3d09..5c1e4c84898f 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_indices.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/indices/__tests__/get_indices.js @@ -5,7 +5,7 @@ */ import { handleResponse } from '../get_indices'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Get Elasticsearch Indices', () => { it('handle an empty response', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/calculate_node_type.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/calculate_node_type.js index 5d3de396d935..b9adcb725f0b 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/calculate_node_type.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/calculate_node_type.js @@ -5,7 +5,7 @@ */ import { set } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { calculateNodeType } from '../calculate_node_type.js'; const masterNodeId = 'def456'; diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_summary.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_summary.js index 22e41a02eef8..40904aac2cde 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_summary.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_summary.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleResponse } from '../get_node_summary'; describe('Elasticsearch Node Summary get_node_summary handleResponse', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_type_class_label.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_type_class_label.js index c149c6e3100e..4c21391a9ae6 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_type_class_label.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/get_node_type_class_label.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getNodeTypeClassLabel } from '../get_node_type_class_label'; describe('Node Type and Label', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/lookups.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/lookups.js index b16f857acdb9..a8c0f483ec1f 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/lookups.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/__tests__/lookups.js @@ -5,7 +5,7 @@ */ import { nodeTypeClass, nodeTypeLabel } from '../lookups'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; describe('Node Types Lookups', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/get_shard_stats.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/get_shard_stats.js index 043c87877e34..299dc0f61a41 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/get_shard_stats.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/get_shard_stats.js @@ -5,7 +5,7 @@ */ import { cloneDeep } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { handleResponse } from '../get_shard_stats'; import { shardStatsFixture, clusterFixture } from './fixtures'; diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/normalize_shard_objects.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/normalize_shard_objects.js index 6ec0114742af..a615a2859a7b 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/normalize_shard_objects.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/__tests__/normalize_shard_objects.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { normalizeIndexShards, normalizeNodeShards } from '../normalize_shard_objects'; function getIndexShardBucket(indexName) { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/cluster.js b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/cluster.js index e464ea323ca7..2f52f8300255 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/cluster.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/cluster.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { checkClusterSettings } from '../'; describe('Elasticsearch Cluster Settings', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/find_reason.js b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/find_reason.js index e5e93d5f475f..b3515c4c0c0a 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/find_reason.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/find_reason.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { findReason } from '../find_reason'; describe('Elasticsearch Settings Find Reason for No Data', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/nodes.js b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/nodes.js index 4d41a9b541a2..b0914bbc9861 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/nodes.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch_settings/__tests__/nodes.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { checkNodesSettings } from '../'; describe('Elasticsearch Nodes Settings', () => { diff --git a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js index 12d3b3f99013..3b25aa752b48 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { errors } from 'elasticsearch'; import { forbidden, unauthorized } from 'boom'; import { isAuthError, handleAuthError } from '../auth_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/errors/__tests__/known_errors.js b/x-pack/plugins/monitoring/server/lib/errors/__tests__/known_errors.js index 73a0e0f00774..c2b21f354abf 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/__tests__/known_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/__tests__/known_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { errors } from 'elasticsearch'; import { isKnownError, handleKnownError } from '../known_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/kibana/__tests__/get_kibana_info.js b/x-pack/plugins/monitoring/server/lib/kibana/__tests__/get_kibana_info.js index d84d163c5c11..4d8a63308d26 100644 --- a/x-pack/plugins/monitoring/server/lib/kibana/__tests__/get_kibana_info.js +++ b/x-pack/plugins/monitoring/server/lib/kibana/__tests__/get_kibana_info.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { handleResponse } from '../get_kibana_info'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_node_info.js b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_node_info.js index 5ecfb0a902f8..2cf407bfea7b 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_node_info.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_node_info.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { handleResponse } from '../get_node_info'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js index 97a4610a8831..f0e81eb63ddd 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { _vertexStats, _enrichStateWithStatsAggregation diff --git a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipelines.js b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipelines.js index 6aefd1c0b88b..47735e08c470 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipelines.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipelines.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { _handleResponse, processPipelinesAPIResponse } from '../get_pipelines'; diff --git a/x-pack/plugins/remote_clusters/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/remote_clusters/server/lib/check_license/__tests__/check_license.js index 19a7b5675926..394c2c4735c0 100644 --- a/x-pack/plugins/remote_clusters/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/remote_clusters/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_es_error.js index b8d59590ebf3..f3237563edb4 100644 --- a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/remote_clusters/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/remote_clusters/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/plugins/remote_clusters/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/plugins/remote_clusters/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/plugins/remote_clusters/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/plugins/remote_clusters/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/remote_clusters/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index ffbbd1395a41..dc641bef9108 100644 --- a/x-pack/plugins/remote_clusters/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/remote_clusters/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/reporting/common/__tests__/export_types_registry.js b/x-pack/plugins/reporting/common/__tests__/export_types_registry.js index 9df8b8b47f50..02aff84fb7d0 100644 --- a/x-pack/plugins/reporting/common/__tests__/export_types_registry.js +++ b/x-pack/plugins/reporting/common/__tests__/export_types_registry.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ExportTypesRegistry } from '../export_types_registry'; describe('ExportTypesRegistry', function () { diff --git a/x-pack/plugins/reporting/export_types/csv/server/__tests__/execute_job.js b/x-pack/plugins/reporting/export_types/csv/server/__tests__/execute_job.js index ee851694f03d..b8799f7a516d 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/__tests__/execute_job.js +++ b/x-pack/plugins/reporting/export_types/csv/server/__tests__/execute_job.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Puid from 'puid'; import sinon from 'sinon'; import nodeCrypto from '@elastic/node-crypto'; diff --git a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/escape_value.js b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/escape_value.js index e8dd84637589..7e2b38f380e8 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/escape_value.js +++ b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/escape_value.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createEscapeValue } from '../escape_value'; describe('escapeValue', function () { diff --git a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/field_format_map.js b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/field_format_map.js index d11552daf9e8..15d2bbbc60a4 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/field_format_map.js +++ b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/field_format_map.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FieldFormat } from '../../../../../../../../src/legacy/ui/field_formats/field_format.js'; import { FieldFormatsService } from '../../../../../../../../src/legacy/ui/field_formats/field_formats_service.js'; diff --git a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/flatten_hit.js b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/flatten_hit.js index 005862a61fee..4abf31bb3e5e 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/flatten_hit.js +++ b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/flatten_hit.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createFlattenHit } from '../flatten_hit'; describe('flattenHit', function () { diff --git a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/format_csv_values.js b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/format_csv_values.js index 9faa32fee9b0..e3d588b5f48f 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/format_csv_values.js +++ b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/format_csv_values.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { createFormatCsvValues } from '../format_csv_values'; describe('formatCsvValues', function () { diff --git a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/max_size_string_builder.js b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/max_size_string_builder.js index 15a10934b5db..32b68e6c7ba0 100644 --- a/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/max_size_string_builder.js +++ b/x-pack/plugins/reporting/export_types/csv/server/lib/__tests__/max_size_string_builder.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { MaxSizeStringBuilder } from '../max_size_string_builder'; describe('MaxSizeStringBuilder', function () { diff --git a/x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js b/x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js index cf81cbf5ced2..e3af8b2c0029 100644 --- a/x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js +++ b/x-pack/plugins/reporting/server/browsers/extract/__tests__/extract.js @@ -6,7 +6,7 @@ import fs from 'fs'; import crypto from 'crypto'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { resolve } from 'path'; import { extract } from '../extract'; diff --git a/x-pack/plugins/reporting/server/lib/__tests__/check_license.js b/x-pack/plugins/reporting/server/lib/__tests__/check_license.js index dc42258a7897..480cf4d3e14e 100644 --- a/x-pack/plugins/reporting/server/lib/__tests__/check_license.js +++ b/x-pack/plugins/reporting/server/lib/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicenseFactory } from '../check_license'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/cancellation_token.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/cancellation_token.js index 5a394c1ac29f..b40765810fb6 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/cancellation_token.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/cancellation_token.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { CancellationToken } from '../../helpers/cancellation_token'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js index 533ba93735c4..7b0b5e3e468c 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/create_index.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { createIndex } from '../../helpers/create_index'; import { ClientMock } from '../fixtures/elasticsearch'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js index f0264ce3985e..d41b29106bb9 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { WorkerTimeoutError, UnspecifiedWorkerError } from '../../helpers/errors'; describe('custom errors', function () { diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js index cfd25e73640d..e57e62c229ff 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/helpers/index_timestamp.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import moment from 'moment'; import { constants } from '../../constants'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js index ad2da1957938..3d25b4529853 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/index.js @@ -5,7 +5,7 @@ */ import events from 'events'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; import { noop, times } from 'lodash'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js index 15ef68c1cb83..233ecb07ca44 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/job.js @@ -5,7 +5,7 @@ */ import events from 'events'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; import { QueueMock } from './fixtures/queue'; diff --git a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js index 7607049479f6..bb3f9495e88f 100644 --- a/x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js +++ b/x-pack/plugins/reporting/server/lib/esqueue/__tests__/worker.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import moment from 'moment'; import { noop, random, get, find, identity } from 'lodash'; diff --git a/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_config.js b/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_config.js index 78c449b7f6c2..9a74ba63b8e3 100644 --- a/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_config.js +++ b/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { validateConfig } from '../validate_config'; diff --git a/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_max_content_length.js b/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_max_content_length.js index 604bd7552529..fc825952e34b 100644 --- a/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_max_content_length.js +++ b/x-pack/plugins/reporting/server/lib/validate/__tests__/validate_max_content_length.js @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import sinon from 'sinon'; import { validateMaxContentLength } from '../validate_max_content_length'; diff --git a/x-pack/plugins/reporting/server/routes/lib/__tests__/authorized_user_pre_routing.test.js b/x-pack/plugins/reporting/server/routes/lib/__tests__/authorized_user_pre_routing.test.js index 3c5d044212d1..42b2019507fe 100644 --- a/x-pack/plugins/reporting/server/routes/lib/__tests__/authorized_user_pre_routing.test.js +++ b/x-pack/plugins/reporting/server/routes/lib/__tests__/authorized_user_pre_routing.test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { authorizedUserPreRoutingFactory } from '../authorized_user_pre_routing'; diff --git a/x-pack/plugins/rollup/server/lib/__tests__/jobs_compatibility.js b/x-pack/plugins/rollup/server/lib/__tests__/jobs_compatibility.js index 45953b04143b..90ec30fd05b5 100644 --- a/x-pack/plugins/rollup/server/lib/__tests__/jobs_compatibility.js +++ b/x-pack/plugins/rollup/server/lib/__tests__/jobs_compatibility.js @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { areJobsCompatible, mergeJobConfigurations } from '../jobs_compatibility'; import { jobs } from './fixtures'; diff --git a/x-pack/plugins/rollup/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/rollup/server/lib/check_license/__tests__/check_license.js index 19a7b5675926..394c2c4735c0 100644 --- a/x-pack/plugins/rollup/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/rollup/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_es_error.js index b8d59590ebf3..f3237563edb4 100644 --- a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/rollup/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/rollup/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/plugins/rollup/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/plugins/rollup/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/plugins/rollup/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/plugins/rollup/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/rollup/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index ffbbd1395a41..dc641bef9108 100644 --- a/x-pack/plugins/rollup/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/rollup/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/searchprofiler/public/__tests__/app_util.js b/x-pack/plugins/searchprofiler/public/__tests__/app_util.js index 2c085296d0db..164e7394dead 100644 --- a/x-pack/plugins/searchprofiler/public/__tests__/app_util.js +++ b/x-pack/plugins/searchprofiler/public/__tests__/app_util.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { checkForParseErrors } from '../app_util.js'; describe('checkForParseErrors', function () { diff --git a/x-pack/plugins/searchprofiler/public/directives/profile_tree/__tests__/profile_tree.js b/x-pack/plugins/searchprofiler/public/directives/profile_tree/__tests__/profile_tree.js index 745cfb94ac81..6da9a452e5e3 100644 --- a/x-pack/plugins/searchprofiler/public/directives/profile_tree/__tests__/profile_tree.js +++ b/x-pack/plugins/searchprofiler/public/directives/profile_tree/__tests__/profile_tree.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as util from '../util.js'; import { normalized, breakdown } from './fixtures/breakdown.js'; import { inputTimes, normalizedTimes } from './fixtures/normalize_times.js'; diff --git a/x-pack/plugins/searchprofiler/public/filters/__tests__/ns_to_pretty.js b/x-pack/plugins/searchprofiler/public/filters/__tests__/ns_to_pretty.js index 3519c411951f..85208495fc18 100644 --- a/x-pack/plugins/searchprofiler/public/filters/__tests__/ns_to_pretty.js +++ b/x-pack/plugins/searchprofiler/public/filters/__tests__/ns_to_pretty.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { nsToPretty } from '../ns_to_pretty.js'; describe('nsToPretty', function () { diff --git a/x-pack/plugins/searchprofiler/server/lib/__tests__/check_license.js b/x-pack/plugins/searchprofiler/server/lib/__tests__/check_license.js index 17dacc31680b..f1e19b61cbe2 100644 --- a/x-pack/plugins/searchprofiler/server/lib/__tests__/check_license.js +++ b/x-pack/plugins/searchprofiler/server/lib/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/security/public/lib/__tests__/parse_next.js b/x-pack/plugins/security/public/lib/__tests__/parse_next.js index 615c348c33b1..7516433c77f8 100644 --- a/x-pack/plugins/security/public/lib/__tests__/parse_next.js +++ b/x-pack/plugins/security/public/lib/__tests__/parse_next.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parseNext } from '../parse_next'; describe('parseNext', () => { diff --git a/x-pack/plugins/security/public/lib/__tests__/util.js b/x-pack/plugins/security/public/lib/__tests__/util.js index 766c384456aa..3f7d8aea53a8 100644 --- a/x-pack/plugins/security/public/lib/__tests__/util.js +++ b/x-pack/plugins/security/public/lib/__tests__/util.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { toggle, toggleSort } from '../../../public/lib/util'; describe('util', () => { diff --git a/x-pack/plugins/security/server/lib/__tests__/auth_redirect.js b/x-pack/plugins/security/server/lib/__tests__/auth_redirect.js index c511eca58ac4..32bc341ce58f 100644 --- a/x-pack/plugins/security/server/lib/__tests__/auth_redirect.js +++ b/x-pack/plugins/security/server/lib/__tests__/auth_redirect.js @@ -5,7 +5,7 @@ */ import Boom from 'boom'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { hFixture } from './__fixtures__/h'; diff --git a/x-pack/plugins/security/server/lib/__tests__/auth_scope_service.js b/x-pack/plugins/security/server/lib/__tests__/auth_scope_service.js index 8f3c3acede0b..d54d53d12142 100644 --- a/x-pack/plugins/security/server/lib/__tests__/auth_scope_service.js +++ b/x-pack/plugins/security/server/lib/__tests__/auth_scope_service.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { AuthScopeService } from '../auth_scope_service'; diff --git a/x-pack/plugins/security/server/lib/__tests__/check_license.js b/x-pack/plugins/security/server/lib/__tests__/check_license.js index 365cf399519d..a2bf1faf031e 100644 --- a/x-pack/plugins/security/server/lib/__tests__/check_license.js +++ b/x-pack/plugins/security/server/lib/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/security/server/lib/__tests__/errors.js b/x-pack/plugins/security/server/lib/__tests__/errors.js index 5ec42f7d30f0..2cf7b6957a2b 100644 --- a/x-pack/plugins/security/server/lib/__tests__/errors.js +++ b/x-pack/plugins/security/server/lib/__tests__/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as errors from '../errors'; diff --git a/x-pack/plugins/security/server/lib/__tests__/parse_next.js b/x-pack/plugins/security/server/lib/__tests__/parse_next.js index 615c348c33b1..7516433c77f8 100644 --- a/x-pack/plugins/security/server/lib/__tests__/parse_next.js +++ b/x-pack/plugins/security/server/lib/__tests__/parse_next.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parseNext } from '../parse_next'; describe('parseNext', () => { diff --git a/x-pack/plugins/security/server/lib/__tests__/validate_config.js b/x-pack/plugins/security/server/lib/__tests__/validate_config.js index 26d84f6f5559..c5a96bc8253f 100644 --- a/x-pack/plugins/security/server/lib/__tests__/validate_config.js +++ b/x-pack/plugins/security/server/lib/__tests__/validate_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { validateConfig } from '../validate_config'; diff --git a/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js b/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js index de5061fc65ba..44916c6a7bb8 100644 --- a/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js +++ b/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import Boom from 'boom'; diff --git a/x-pack/plugins/security/server/lib/authentication/__tests__/session.js b/x-pack/plugins/security/server/lib/authentication/__tests__/session.js index 832adef2439e..4a47fe12c68b 100644 --- a/x-pack/plugins/security/server/lib/authentication/__tests__/session.js +++ b/x-pack/plugins/security/server/lib/authentication/__tests__/session.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { serverFixture } from '../../__tests__/__fixtures__/server'; diff --git a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/basic.js b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/basic.js index 0226c9b36b5c..eaaa6fae4df3 100644 --- a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/basic.js +++ b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/basic.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { requestFixture } from '../../../__tests__/__fixtures__/request'; import { LoginAttempt } from '../../login_attempt'; diff --git a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js index 902db0fc1a2d..ebc33d6b7f59 100644 --- a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js +++ b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { requestFixture } from '../../../__tests__/__fixtures__/request'; import { LoginAttempt } from '../../login_attempt'; diff --git a/x-pack/plugins/security/server/routes/api/v1/__tests__/authenticate.js b/x-pack/plugins/security/server/routes/api/v1/__tests__/authenticate.js index 0945782e932b..df87a630a98c 100644 --- a/x-pack/plugins/security/server/routes/api/v1/__tests__/authenticate.js +++ b/x-pack/plugins/security/server/routes/api/v1/__tests__/authenticate.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Boom from 'boom'; import Joi from 'joi'; import sinon from 'sinon'; diff --git a/x-pack/plugins/security/server/routes/api/v1/__tests__/users.js b/x-pack/plugins/security/server/routes/api/v1/__tests__/users.js index 39ab7d7627bd..05c5cad41e2c 100644 --- a/x-pack/plugins/security/server/routes/api/v1/__tests__/users.js +++ b/x-pack/plugins/security/server/routes/api/v1/__tests__/users.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import Joi from 'joi'; import sinon from 'sinon'; diff --git a/x-pack/plugins/tilemap/server/lib/__tests__/inspect_settings.js b/x-pack/plugins/tilemap/server/lib/__tests__/inspect_settings.js index a50a9298e2ee..3f900c3b6af6 100644 --- a/x-pack/plugins/tilemap/server/lib/__tests__/inspect_settings.js +++ b/x-pack/plugins/tilemap/server/lib/__tests__/inspect_settings.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { inspectSettings } from '../../../server/lib/inspect_settings'; describe('inspectSettings', function () { diff --git a/x-pack/plugins/watcher/__tests__/plugin_definition.js b/x-pack/plugins/watcher/__tests__/plugin_definition.js index eb0c2d011eb6..c95d5aba8bbc 100644 --- a/x-pack/plugins/watcher/__tests__/plugin_definition.js +++ b/x-pack/plugins/watcher/__tests__/plugin_definition.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { pluginDefinition } from '../plugin_definition'; describe ('pluginDefinition', () => { diff --git a/x-pack/plugins/watcher/common/lib/get_action_type/__tests__/get_action_type.js b/x-pack/plugins/watcher/common/lib/get_action_type/__tests__/get_action_type.js index 3ee5a1d75b4b..7b2fd7bd8406 100644 --- a/x-pack/plugins/watcher/common/lib/get_action_type/__tests__/get_action_type.js +++ b/x-pack/plugins/watcher/common/lib/get_action_type/__tests__/get_action_type.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getActionType } from '../get_action_type'; import { ACTION_TYPES } from '../../../../common/constants'; diff --git a/x-pack/plugins/watcher/common/lib/get_moment/__tests__/get_moment.js b/x-pack/plugins/watcher/common/lib/get_moment/__tests__/get_moment.js index 69ccd634ec6e..a90099f465cc 100644 --- a/x-pack/plugins/watcher/common/lib/get_moment/__tests__/get_moment.js +++ b/x-pack/plugins/watcher/common/lib/get_moment/__tests__/get_moment.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getMoment } from '../get_moment'; describe('get_moment', () => { diff --git a/x-pack/plugins/watcher/public/lib/sortable_boolean/__tests__/sortable_boolean.js b/x-pack/plugins/watcher/public/lib/sortable_boolean/__tests__/sortable_boolean.js index ba32ba27f53d..b51130c83645 100644 --- a/x-pack/plugins/watcher/public/lib/sortable_boolean/__tests__/sortable_boolean.js +++ b/x-pack/plugins/watcher/public/lib/sortable_boolean/__tests__/sortable_boolean.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { sortableBoolean } from '../sortable_boolean'; describe('sortable_boolean', () => { diff --git a/x-pack/plugins/watcher/server/lib/check_license/__tests__/check_license.js b/x-pack/plugins/watcher/server/lib/check_license/__tests__/check_license.js index fe410e498b91..3dc2eced25a8 100644 --- a/x-pack/plugins/watcher/server/lib/check_license/__tests__/check_license.js +++ b/x-pack/plugins/watcher/server/lib/check_license/__tests__/check_license.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { checkLicense } from '../check_license'; diff --git a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_es_error.js b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_es_error.js index 394c18214000..467cc4fcdae1 100644 --- a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/plugins/watcher/server/lib/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/plugins/watcher/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js b/x-pack/plugins/watcher/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js index 582c021892d4..5e532b68e2bc 100644 --- a/x-pack/plugins/watcher/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js +++ b/x-pack/plugins/watcher/server/lib/fetch_all_from_scroll/__tests__/fetch_all_from_scroll.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { fetchAllFromScroll } from '../fetch_all_from_scroll'; import { set } from 'lodash'; diff --git a/x-pack/plugins/watcher/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/plugins/watcher/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/plugins/watcher/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/plugins/watcher/server/lib/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/plugins/watcher/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/plugins/watcher/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index 359b3fb2ce6f..24cbaae2b2b6 100644 --- a/x-pack/plugins/watcher/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/plugins/watcher/server/lib/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; describe('license_pre_routing_factory', () => { diff --git a/x-pack/plugins/watcher/server/models/action_status/__tests__/action_status.js b/x-pack/plugins/watcher/server/models/action_status/__tests__/action_status.js index b30d29af611d..911c960efdab 100644 --- a/x-pack/plugins/watcher/server/models/action_status/__tests__/action_status.js +++ b/x-pack/plugins/watcher/server/models/action_status/__tests__/action_status.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ActionStatus } from '../action_status'; import { ACTION_STATES } from '../../../../common/constants'; import moment from 'moment'; diff --git a/x-pack/plugins/watcher/server/models/execute_details/__tests__/execute_details.js b/x-pack/plugins/watcher/server/models/execute_details/__tests__/execute_details.js index bdd4a13eb8e3..00937bbc6204 100644 --- a/x-pack/plugins/watcher/server/models/execute_details/__tests__/execute_details.js +++ b/x-pack/plugins/watcher/server/models/execute_details/__tests__/execute_details.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ExecuteDetails } from '../execute_details'; describe('execute_details', () => { diff --git a/x-pack/plugins/watcher/server/models/fields/__tests__/fields.js b/x-pack/plugins/watcher/server/models/fields/__tests__/fields.js index 9588c51a2ad4..5c872ff56749 100644 --- a/x-pack/plugins/watcher/server/models/fields/__tests__/fields.js +++ b/x-pack/plugins/watcher/server/models/fields/__tests__/fields.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { find } from 'lodash'; import { Fields } from '../fields'; diff --git a/x-pack/plugins/watcher/server/models/settings/__tests__/settings.js b/x-pack/plugins/watcher/server/models/settings/__tests__/settings.js index 6c34467ef862..7add7a0e0564 100644 --- a/x-pack/plugins/watcher/server/models/settings/__tests__/settings.js +++ b/x-pack/plugins/watcher/server/models/settings/__tests__/settings.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { Settings } from '../settings'; describe('settings module', () => { diff --git a/x-pack/plugins/watcher/server/models/watch/__tests__/base_watch.js b/x-pack/plugins/watcher/server/models/watch/__tests__/base_watch.js index 9740874cb92a..fbbbd52c7987 100644 --- a/x-pack/plugins/watcher/server/models/watch/__tests__/base_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/__tests__/base_watch.js @@ -5,7 +5,7 @@ */ import proxyquire from 'proxyquire'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; const actionFromUpstreamJSONMock = sinon.stub(); diff --git a/x-pack/plugins/watcher/server/models/watch/__tests__/json_watch.js b/x-pack/plugins/watcher/server/models/watch/__tests__/json_watch.js index e4b258d51cfe..a38b10afcd28 100644 --- a/x-pack/plugins/watcher/server/models/watch/__tests__/json_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/__tests__/json_watch.js @@ -5,7 +5,7 @@ */ import { pick } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; diff --git a/x-pack/plugins/watcher/server/models/watch/__tests__/monitoring_watch.js b/x-pack/plugins/watcher/server/models/watch/__tests__/monitoring_watch.js index c580d8c8f776..44e457476815 100644 --- a/x-pack/plugins/watcher/server/models/watch/__tests__/monitoring_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/__tests__/monitoring_watch.js @@ -5,7 +5,7 @@ */ import { pick } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; diff --git a/x-pack/plugins/watcher/server/models/watch/__tests__/threshold_watch.js b/x-pack/plugins/watcher/server/models/watch/__tests__/threshold_watch.js index 635d23734b96..a93280d5c6aa 100644 --- a/x-pack/plugins/watcher/server/models/watch/__tests__/threshold_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/__tests__/threshold_watch.js @@ -5,7 +5,7 @@ */ import { pick } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; import { COMPARATORS, SORT_ORDERS } from '../../../../common/constants'; diff --git a/x-pack/plugins/watcher/server/models/watch/__tests__/watch.js b/x-pack/plugins/watcher/server/models/watch/__tests__/watch.js index ac186b384657..14d5005b13e0 100644 --- a/x-pack/plugins/watcher/server/models/watch/__tests__/watch.js +++ b/x-pack/plugins/watcher/server/models/watch/__tests__/watch.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import proxyquire from 'proxyquire'; import { WATCH_TYPES } from '../../../../common/constants'; diff --git a/x-pack/plugins/watcher/server/models/watch/threshold_watch/__tests__/format_visualize_data.js b/x-pack/plugins/watcher/server/models/watch/threshold_watch/__tests__/format_visualize_data.js index 41c84f1750a5..04239ab6e1b5 100644 --- a/x-pack/plugins/watcher/server/models/watch/threshold_watch/__tests__/format_visualize_data.js +++ b/x-pack/plugins/watcher/server/models/watch/threshold_watch/__tests__/format_visualize_data.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { AGG_TYPES } from '../../../../../common/constants'; import { formatVisualizeData } from '../format_visualize_data'; diff --git a/x-pack/plugins/watcher/server/models/watch_history_item/__tests__/watch_history_item.js b/x-pack/plugins/watcher/server/models/watch_history_item/__tests__/watch_history_item.js index 2d13243f8a6d..a22609db226e 100644 --- a/x-pack/plugins/watcher/server/models/watch_history_item/__tests__/watch_history_item.js +++ b/x-pack/plugins/watcher/server/models/watch_history_item/__tests__/watch_history_item.js @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { WatchHistoryItem } from '../watch_history_item'; describe('watch_history_item', () => { diff --git a/x-pack/plugins/watcher/server/models/watch_status/__tests__/watch_status.js b/x-pack/plugins/watcher/server/models/watch_status/__tests__/watch_status.js index 4b1649ab4c1e..e29c8dd2a529 100644 --- a/x-pack/plugins/watcher/server/models/watch_status/__tests__/watch_status.js +++ b/x-pack/plugins/watcher/server/models/watch_status/__tests__/watch_status.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { WatchStatus } from '../watch_status'; import { ACTION_STATES, WATCH_STATES, WATCH_STATE_COMMENTS } from '../../../../common/constants'; import moment from 'moment'; diff --git a/x-pack/plugins/xpack_main/public/hacks/__tests__/fetch_telemetry.js b/x-pack/plugins/xpack_main/public/hacks/__tests__/fetch_telemetry.js index 903abf4d202d..1dfeefdd295e 100644 --- a/x-pack/plugins/xpack_main/public/hacks/__tests__/fetch_telemetry.js +++ b/x-pack/plugins/xpack_main/public/hacks/__tests__/fetch_telemetry.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { fetchTelemetry } from '../fetch_telemetry'; diff --git a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/click_banner.js b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/click_banner.js index 3a1e528e3fc4..d77c77cf5335 100644 --- a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/click_banner.js +++ b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/click_banner.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { uiModules } from 'ui/modules'; diff --git a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/handle_old_settings.js b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/handle_old_settings.js index 3ceb31cb2eb3..ab17b0080463 100644 --- a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/handle_old_settings.js +++ b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/handle_old_settings.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { CONFIG_TELEMETRY } from '../../../../common/constants'; diff --git a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/render_banner.js b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/render_banner.js index de8c690c1a39..0ba0a21b6413 100644 --- a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/render_banner.js +++ b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/render_banner.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { renderBanner } from '../render_banner'; diff --git a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/should_show_banner.js b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/should_show_banner.js index ed9d3e79a0c5..e78d69f25ecb 100644 --- a/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/should_show_banner.js +++ b/x-pack/plugins/xpack_main/public/hacks/welcome_banner/__tests__/should_show_banner.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { CONFIG_TELEMETRY } from '../../../../common/constants'; diff --git a/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info.js b/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info.js index 70eb4925fe1a..a6ee8cb0c8d6 100644 --- a/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info.js +++ b/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { XPackInfoProvider } from 'plugins/xpack_main/services/xpack_info'; import { MockWindowProvider } from './_mock_window'; diff --git a/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info_signature.js b/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info_signature.js index 47db141d610d..980d8f649f1d 100644 --- a/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info_signature.js +++ b/x-pack/plugins/xpack_main/public/services/__tests__/xpack_info_signature.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import { XPackInfoSignatureProvider } from 'plugins/xpack_main/services/xpack_info_signature'; import { MockWindowProvider } from './_mock_window'; diff --git a/x-pack/plugins/xpack_main/server/lib/__tests__/call_cluster_factory.js b/x-pack/plugins/xpack_main/server/lib/__tests__/call_cluster_factory.js index 9c7f17a9e507..9251829f0760 100644 --- a/x-pack/plugins/xpack_main/server/lib/__tests__/call_cluster_factory.js +++ b/x-pack/plugins/xpack_main/server/lib/__tests__/call_cluster_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { callClusterFactory } from '../call_cluster_factory'; diff --git a/x-pack/plugins/xpack_main/server/lib/__tests__/inject_xpack_info_signature.js b/x-pack/plugins/xpack_main/server/lib/__tests__/inject_xpack_info_signature.js index c044636a2c93..c0f52b1cb7f1 100644 --- a/x-pack/plugins/xpack_main/server/lib/__tests__/inject_xpack_info_signature.js +++ b/x-pack/plugins/xpack_main/server/lib/__tests__/inject_xpack_info_signature.js @@ -5,7 +5,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { injectXPackInfoSignature } from '../inject_xpack_info_signature'; describe('injectXPackInfoSignature()', () => { diff --git a/x-pack/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js b/x-pack/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js index 863f07725ad2..26bce06adaab 100644 --- a/x-pack/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js +++ b/x-pack/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js @@ -5,7 +5,7 @@ */ import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { replaceInjectedVars } from '../replace_injected_vars'; diff --git a/x-pack/plugins/xpack_main/server/lib/__tests__/xpack_info.js b/x-pack/plugins/xpack_main/server/lib/__tests__/xpack_info.js index 8cb75f3cb642..88ba3d600327 100644 --- a/x-pack/plugins/xpack_main/server/lib/__tests__/xpack_info.js +++ b/x-pack/plugins/xpack_main/server/lib/__tests__/xpack_info.js @@ -5,7 +5,7 @@ */ import { createHash } from 'crypto'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { XPackInfo } from '../xpack_info'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_info.js b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_info.js index 2331c8b01bce..863556b70df4 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_info.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_info.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { getClusterInfo } from '../get_cluster_info'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_stats.js index 6e3bc59928a2..ce4620d34601 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_cluster_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { TIMEOUT } from '../constants'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_local_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_local_stats.js index 03056f8c9e26..153166c4b1f1 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_local_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_local_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { mockGetClusterInfo } from './get_cluster_info'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_xpack.js b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_xpack.js index c4cc1fa249a1..bc9c6981e441 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_xpack.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/local/__tests__/get_xpack.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { TIMEOUT } from '../constants'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/create_query.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/create_query.js index 7ad932bdef02..2d35c10ea218 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/create_query.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/create_query.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { set } from 'lodash'; import { createTypeFilter, createQuery } from '../create_query.js'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_all_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_all_stats.js index 3357f27ad644..fff281a0d87e 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_all_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_all_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { addStackStats, getAllStats, getAllStatsForServer, handleAllStats } from '../get_all_stats'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_beats_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_beats_stats.js index 42642b16de4c..529cd306275b 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_beats_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_beats_stats.js @@ -6,7 +6,7 @@ import { fetchBeatsStats, processResults } from '../get_beats_stats'; import sinon from 'sinon'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import beatsStatsResultSet from './fixtures/beats_stats_results'; const getBaseOptions = () => ({ diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_cluster_uuids.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_cluster_uuids.js index 6ec260f8f4f4..e3153670ac58 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_cluster_uuids.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_cluster_uuids.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { getClusterUuids, fetchClusterUuids, handleClusterUuidsResponse } from '../get_cluster_uuids'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_es_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_es_stats.js index 5005037bd641..6f13a1e1bdf7 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_es_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_es_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { fetchElasticsearchStats, getElasticsearchStats, handleElasticsearchStats } from '../get_es_stats'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_high_level_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_high_level_stats.js index a071837a163f..be86130f2452 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_high_level_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_high_level_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { fetchHighLevelStats, getHighLevelStats, handleHighLevelStatsResponse } from '../get_high_level_stats'; diff --git a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_kibana_stats.js b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_kibana_stats.js index 4811f825ed7b..4d0ad95c919c 100644 --- a/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_kibana_stats.js +++ b/x-pack/plugins/xpack_main/server/lib/telemetry/monitoring/__tests__/get_kibana_stats.js @@ -5,7 +5,7 @@ */ import { getUsageStats, combineStats, rollUpTotals } from '../get_kibana_stats'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; describe('Get Kibana Stats', () => { describe('Make a map of usage stats for each cluster', () => { diff --git a/x-pack/plugins/xpack_main/server/routes/api/v1/__tests__/xpack_info.js b/x-pack/plugins/xpack_main/server/routes/api/v1/__tests__/xpack_info.js index 9e095a12dad7..178564e4578f 100644 --- a/x-pack/plugins/xpack_main/server/routes/api/v1/__tests__/xpack_info.js +++ b/x-pack/plugins/xpack_main/server/routes/api/v1/__tests__/xpack_info.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { xpackInfoRoute } from '../xpack_info'; diff --git a/x-pack/plugins/xpack_main/server/routes/api/v1/telemetry/__tests__/telemetry.js b/x-pack/plugins/xpack_main/server/routes/api/v1/telemetry/__tests__/telemetry.js index a16d9187e2ca..1d657df734fe 100644 --- a/x-pack/plugins/xpack_main/server/routes/api/v1/telemetry/__tests__/telemetry.js +++ b/x-pack/plugins/xpack_main/server/routes/api/v1/telemetry/__tests__/telemetry.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import sinon from 'sinon'; import { getTelemetry } from '../telemetry'; diff --git a/x-pack/server/lib/__tests__/key_case_converter.js b/x-pack/server/lib/__tests__/key_case_converter.js index 78a627ffc855..b5f4515844d1 100644 --- a/x-pack/server/lib/__tests__/key_case_converter.js +++ b/x-pack/server/lib/__tests__/key_case_converter.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { convertKeysToSnakeCaseDeep, convertKeysToCamelCaseDeep } from '../key_case_converter'; describe('key_case_converter', () => { diff --git a/x-pack/server/lib/__tests__/kibana_state.js b/x-pack/server/lib/__tests__/kibana_state.js index 3b0b8f8a2ea2..f0576701c980 100644 --- a/x-pack/server/lib/__tests__/kibana_state.js +++ b/x-pack/server/lib/__tests__/kibana_state.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import rison from 'rison-node'; import { parseKibanaState } from '../parse_kibana_state'; diff --git a/x-pack/server/lib/__tests__/mirror_plugin_status.js b/x-pack/server/lib/__tests__/mirror_plugin_status.js index 438393214154..745c69b7a3d7 100644 --- a/x-pack/server/lib/__tests__/mirror_plugin_status.js +++ b/x-pack/server/lib/__tests__/mirror_plugin_status.js @@ -5,7 +5,7 @@ */ import EventEmitter from 'events'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { mirrorPluginStatus } from '../mirror_plugin_status'; describe('mirror_plugin_status', () => { diff --git a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_custom_error.js b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_custom_error.js index 443744ccb0cc..f9c102be7a1f 100644 --- a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_custom_error.js +++ b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_custom_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapCustomError } from '../wrap_custom_error'; describe('wrap_custom_error', () => { diff --git a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_es_error.js b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_es_error.js index 394c18214000..467cc4fcdae1 100644 --- a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_es_error.js +++ b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_es_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapEsError } from '../wrap_es_error'; describe('wrap_es_error', () => { diff --git a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_unknown_error.js b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_unknown_error.js index 6d6a336417be..85e0b2b3033a 100644 --- a/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_unknown_error.js +++ b/x-pack/server/lib/create_router/error_wrappers/__tests__/wrap_unknown_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { wrapUnknownError } from '../wrap_unknown_error'; describe('wrap_unknown_error', () => { diff --git a/x-pack/server/lib/create_router/is_es_error_factory/__tests__/is_es_error_factory.js b/x-pack/server/lib/create_router/is_es_error_factory/__tests__/is_es_error_factory.js index d50ff9480d3e..76fdf7b36c3d 100644 --- a/x-pack/server/lib/create_router/is_es_error_factory/__tests__/is_es_error_factory.js +++ b/x-pack/server/lib/create_router/is_es_error_factory/__tests__/is_es_error_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { isEsErrorFactory } from '../is_es_error_factory'; import { set } from 'lodash'; diff --git a/x-pack/server/lib/create_router/license_pre_routing_factory/__tests__/license_pre_routing_factory.js b/x-pack/server/lib/create_router/license_pre_routing_factory/__tests__/license_pre_routing_factory.js index 5192181d3776..cbb0ca1d6076 100644 --- a/x-pack/server/lib/create_router/license_pre_routing_factory/__tests__/license_pre_routing_factory.js +++ b/x-pack/server/lib/create_router/license_pre_routing_factory/__tests__/license_pre_routing_factory.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { licensePreRoutingFactory } from '../license_pre_routing_factory'; import { LICENSE_STATUS_INVALID, LICENSE_STATUS_VALID } from '../../../../../common/constants'; diff --git a/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js b/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js index a1268eea645e..2fa316b4d647 100644 --- a/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js +++ b/x-pack/test/api_integration/apis/beats/assign_tags_to_beats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js b/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js index ba3d6792367e..246fc13812a0 100644 --- a/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js +++ b/x-pack/test/api_integration/apis/beats/create_enrollment_tokens.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { ES_INDEX_NAME } from './constants'; diff --git a/x-pack/test/api_integration/apis/beats/enroll_beat.js b/x-pack/test/api_integration/apis/beats/enroll_beat.js index 72933f295022..395886fc550a 100644 --- a/x-pack/test/api_integration/apis/beats/enroll_beat.js +++ b/x-pack/test/api_integration/apis/beats/enroll_beat.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import moment from 'moment'; import { ES_INDEX_NAME } from './constants'; diff --git a/x-pack/test/api_integration/apis/beats/get_beat.js b/x-pack/test/api_integration/apis/beats/get_beat.js index bb300f5c3e23..7d5979fc65ac 100644 --- a/x-pack/test/api_integration/apis/beats/get_beat.js +++ b/x-pack/test/api_integration/apis/beats/get_beat.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/beats/list_beats.js b/x-pack/test/api_integration/apis/beats/list_beats.js index b78939b30b62..456ecc318b16 100644 --- a/x-pack/test/api_integration/apis/beats/list_beats.js +++ b/x-pack/test/api_integration/apis/beats/list_beats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js b/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js index 1bc0664d6f80..fc55ee9d9da2 100644 --- a/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js +++ b/x-pack/test/api_integration/apis/beats/remove_tags_from_beats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/beats/set_config.js b/x-pack/test/api_integration/apis/beats/set_config.js index 2c023ecbbf0a..53fa2b0133ee 100644 --- a/x-pack/test/api_integration/apis/beats/set_config.js +++ b/x-pack/test/api_integration/apis/beats/set_config.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/beats/set_tag.js b/x-pack/test/api_integration/apis/beats/set_tag.js index 445f939dd80c..ee9a601b2509 100644 --- a/x-pack/test/api_integration/apis/beats/set_tag.js +++ b/x-pack/test/api_integration/apis/beats/set_tag.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/beats/update_beat.js b/x-pack/test/api_integration/apis/beats/update_beat.js index ba8ed8b9631f..e700414d45b0 100644 --- a/x-pack/test/api_integration/apis/beats/update_beat.js +++ b/x-pack/test/api_integration/apis/beats/update_beat.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ES_INDEX_NAME } from './constants'; import moment from 'moment'; diff --git a/x-pack/test/api_integration/apis/es/has_privileges.js b/x-pack/test/api_integration/apis/es/has_privileges.js index 21283d483ca3..5cbbefd8f2f3 100644 --- a/x-pack/test/api_integration/apis/es/has_privileges.js +++ b/x-pack/test/api_integration/apis/es/has_privileges.js @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; const application = 'has_privileges_test'; diff --git a/x-pack/test/api_integration/apis/es/post_privileges.js b/x-pack/test/api_integration/apis/es/post_privileges.js index bf2266575d3b..4b1695487f83 100644 --- a/x-pack/test/api_integration/apis/es/post_privileges.js +++ b/x-pack/test/api_integration/apis/es/post_privileges.js @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/infra/log_entries.ts b/x-pack/test/api_integration/apis/infra/log_entries.ts index c2e37e5e578d..79a39163e235 100644 --- a/x-pack/test/api_integration/apis/infra/log_entries.ts +++ b/x-pack/test/api_integration/apis/infra/log_entries.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; import { ascending, pairs } from 'd3-array'; -import expect from 'expect.js'; import gql from 'graphql-tag'; import { InfraTimeKey } from '../../../../plugins/infra/public/graphql/types'; diff --git a/x-pack/test/api_integration/apis/infra/log_item.ts b/x-pack/test/api_integration/apis/infra/log_item.ts index bfdde32fa57a..798f12477a81 100644 --- a/x-pack/test/api_integration/apis/infra/log_item.ts +++ b/x-pack/test/api_integration/apis/infra/log_item.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { flyoutItemQuery } from '../../../../plugins/infra/public/containers/logs/flyout_item.gql_query'; import { FlyoutItemQuery } from '../../../../plugins/infra/public/graphql/types'; import { KbnTestProvider } from './types'; diff --git a/x-pack/test/api_integration/apis/infra/log_summary.ts b/x-pack/test/api_integration/apis/infra/log_summary.ts index 7530ec303079..2682987f9c0b 100644 --- a/x-pack/test/api_integration/apis/infra/log_summary.ts +++ b/x-pack/test/api_integration/apis/infra/log_summary.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; import { pairs } from 'd3-array'; -import expect from 'expect.js'; import gql from 'graphql-tag'; import { KbnTestProvider } from './types'; diff --git a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts index 94301c7f4278..5e67b82508e9 100644 --- a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts +++ b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; import { ascending, pairs } from 'd3-array'; -import expect from 'expect.js'; import gql from 'graphql-tag'; import { InfraTimeKey } from '../../../../plugins/infra/public/graphql/types'; diff --git a/x-pack/test/api_integration/apis/infra/metadata.ts b/x-pack/test/api_integration/apis/infra/metadata.ts index 749c31fe2b7a..76cc2da7b7ad 100644 --- a/x-pack/test/api_integration/apis/infra/metadata.ts +++ b/x-pack/test/api_integration/apis/infra/metadata.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { metadataQuery } from '../../../../plugins/infra/public/containers/metadata/metadata.gql_query'; import { MetadataQuery } from '../../../../plugins/infra/public/graphql/types'; diff --git a/x-pack/test/api_integration/apis/infra/metrics.ts b/x-pack/test/api_integration/apis/infra/metrics.ts index 52d593789e8e..6cf3723063d5 100644 --- a/x-pack/test/api_integration/apis/infra/metrics.ts +++ b/x-pack/test/api_integration/apis/infra/metrics.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { first, last } from 'lodash'; import { metricsQuery } from '../../../../plugins/infra/public/containers/metrics/metrics.gql_query'; diff --git a/x-pack/test/api_integration/apis/infra/sources.ts b/x-pack/test/api_integration/apis/infra/sources.ts index d0002e73d987..952c1a0dd3ba 100644 --- a/x-pack/test/api_integration/apis/infra/sources.ts +++ b/x-pack/test/api_integration/apis/infra/sources.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import gql from 'graphql-tag'; import { sourceQuery } from '../../../../plugins/infra/public/containers/with_source/query_source.gql_query'; diff --git a/x-pack/test/api_integration/apis/infra/waffle.ts b/x-pack/test/api_integration/apis/infra/waffle.ts index 023bdd4f7bc7..f7aafc135202 100644 --- a/x-pack/test/api_integration/apis/infra/waffle.ts +++ b/x-pack/test/api_integration/apis/infra/waffle.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { first, last } from 'lodash'; import { waffleNodesQuery } from '../../../../plugins/infra/public/containers/waffle/waffle_nodes.gql_query'; diff --git a/x-pack/test/api_integration/apis/kibana/kql_telemetry/kql_telemetry.js b/x-pack/test/api_integration/apis/kibana/kql_telemetry/kql_telemetry.js index ab47576cdc23..43f00b920420 100644 --- a/x-pack/test/api_integration/apis/kibana/kql_telemetry/kql_telemetry.js +++ b/x-pack/test/api_integration/apis/kibana/kql_telemetry/kql_telemetry.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertestNoAuth = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/kibana/stats/stats.js b/x-pack/test/api_integration/apis/kibana/stats/stats.js index 8672f64cdf2b..48c720bb57ba 100644 --- a/x-pack/test/api_integration/apis/kibana/stats/stats.js +++ b/x-pack/test/api_integration/apis/kibana/stats/stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertestNoAuth = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/logstash/cluster/load.js b/x-pack/test/api_integration/apis/logstash/cluster/load.js index 40ff7adcff98..a20c524f0a8f 100644 --- a/x-pack/test/api_integration/apis/logstash/cluster/load.js +++ b/x-pack/test/api_integration/apis/logstash/cluster/load.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/logstash/pipeline/load.js b/x-pack/test/api_integration/apis/logstash/pipeline/load.js index 8e5c74154d12..c7b27348a0a1 100644 --- a/x-pack/test/api_integration/apis/logstash/pipeline/load.js +++ b/x-pack/test/api_integration/apis/logstash/pipeline/load.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import pipeline from './fixtures/load'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/logstash/pipeline/save.js b/x-pack/test/api_integration/apis/logstash/pipeline/save.js index cfcbdf4633d4..73e710c8f906 100644 --- a/x-pack/test/api_integration/apis/logstash/pipeline/save.js +++ b/x-pack/test/api_integration/apis/logstash/pipeline/save.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/logstash/pipelines/list.js b/x-pack/test/api_integration/apis/logstash/pipelines/list.js index 5c97f5fc933f..54b2ed0a2b26 100644 --- a/x-pack/test/api_integration/apis/logstash/pipelines/list.js +++ b/x-pack/test/api_integration/apis/logstash/pipelines/list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import pipelineList from './fixtures/list'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/management/cross_cluster_replication/auto_follow_pattern.js b/x-pack/test/api_integration/apis/management/cross_cluster_replication/auto_follow_pattern.js index 8274b3b003ff..82422e13cd19 100644 --- a/x-pack/test/api_integration/apis/management/cross_cluster_replication/auto_follow_pattern.js +++ b/x-pack/test/api_integration/apis/management/cross_cluster_replication/auto_follow_pattern.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { API_BASE_PATH } from './constants'; diff --git a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js index aa5269d80f59..f93ab9f4629c 100644 --- a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js +++ b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { FOLLOWER_INDEX_ADVANCED_SETTINGS } from '../../../../../plugins/cross_cluster_replication/common/constants'; import { API_BASE_PATH } from './constants'; diff --git a/x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters.js b/x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters.js index 45ded4427666..6e4946c465cb 100644 --- a/x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters.js +++ b/x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { API_BASE_PATH, NODE_SEED } from './constants'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js b/x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js index 0237a5821380..25bc503682bc 100644 --- a/x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js +++ b/x-pack/test/api_integration/apis/management/rollup/index_patterns_extensions.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import querystring from 'querystring'; import { registerHelpers } from './rollup.test_helpers'; diff --git a/x-pack/test/api_integration/apis/management/rollup/rollup.js b/x-pack/test/api_integration/apis/management/rollup/rollup.js index f00ea63a60db..64f958e95dd5 100644 --- a/x-pack/test/api_integration/apis/management/rollup/rollup.js +++ b/x-pack/test/api_integration/apis/management/rollup/rollup.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { API_BASE_PATH, ROLLUP_INDEX_NAME } from './constants'; import { registerHelpers } from './rollup.test_helpers'; diff --git a/x-pack/test/api_integration/apis/management/rollup/rollup_search.js b/x-pack/test/api_integration/apis/management/rollup/rollup_search.js index 4455ae8db925..2a38cd563f31 100644 --- a/x-pack/test/api_integration/apis/management/rollup/rollup_search.js +++ b/x-pack/test/api_integration/apis/management/rollup/rollup_search.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { registerHelpers } from './rollup.test_helpers'; import { API_BASE_PATH } from './constants'; diff --git a/x-pack/test/api_integration/apis/maps/migrations.js b/x-pack/test/api_integration/apis/maps/migrations.js index 74fdc46c80b0..0c1193660a1d 100644 --- a/x-pack/test/api_integration/apis/maps/migrations.js +++ b/x-pack/test/api_integration/apis/maps/migrations.js @@ -5,7 +5,7 @@ */ /* eslint max-len: 0 */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/apm/instance.js b/x-pack/test/api_integration/apis/monitoring/apm/instance.js index f66c64f1fc8e..b01bf6fdbd06 100644 --- a/x-pack/test/api_integration/apis/monitoring/apm/instance.js +++ b/x-pack/test/api_integration/apis/monitoring/apm/instance.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import apmInstanceFixture from './fixtures/instance'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/apm/instances.js b/x-pack/test/api_integration/apis/monitoring/apm/instances.js index 4ad9a666ab5d..46abe97c1ea0 100644 --- a/x-pack/test/api_integration/apis/monitoring/apm/instances.js +++ b/x-pack/test/api_integration/apis/monitoring/apm/instances.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/apm/overview.js b/x-pack/test/api_integration/apis/monitoring/apm/overview.js index 30a5ae8198b2..bcdb77383705 100644 --- a/x-pack/test/api_integration/apis/monitoring/apm/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/apm/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import apmClusterFixture from './fixtures/cluster'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/beats/detail.js b/x-pack/test/api_integration/apis/monitoring/beats/detail.js index 1af5277b653a..076b1083d9fa 100644 --- a/x-pack/test/api_integration/apis/monitoring/beats/detail.js +++ b/x-pack/test/api_integration/apis/monitoring/beats/detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import beatDetailFixture from './fixtures/detail'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/beats/list.js b/x-pack/test/api_integration/apis/monitoring/beats/list.js index 0ec1ae3226c0..b47703cc6ab3 100644 --- a/x-pack/test/api_integration/apis/monitoring/beats/list.js +++ b/x-pack/test/api_integration/apis/monitoring/beats/list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/beats/overview.js b/x-pack/test/api_integration/apis/monitoring/beats/overview.js index 67978e948c0a..f1634fcfd729 100644 --- a/x-pack/test/api_integration/apis/monitoring/beats/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/beats/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import beatsClusterFixture from './fixtures/cluster'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/cluster/list.js b/x-pack/test/api_integration/apis/monitoring/cluster/list.js index 2b920e4f2567..cc130a340dd6 100644 --- a/x-pack/test/api_integration/apis/monitoring/cluster/list.js +++ b/x-pack/test/api_integration/apis/monitoring/cluster/list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import multiclusterFixture from './fixtures/multicluster'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js index 57be7082d697..7b9f5087e78c 100644 --- a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import overviewFixture from './fixtures/overview'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/common/mappings_exist.js b/x-pack/test/api_integration/apis/monitoring/common/mappings_exist.js index a0f1e3bdb4af..5dd647b97ac4 100644 --- a/x-pack/test/api_integration/apis/monitoring/common/mappings_exist.js +++ b/x-pack/test/api_integration/apis/monitoring/common/mappings_exist.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { get } from 'lodash'; import * as esMetrics from '../../../../../plugins/monitoring/server/lib/metrics/elasticsearch/metrics'; import * as kibanaMetrics from '../../../../../plugins/monitoring/server/lib/metrics/kibana/metrics'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr.js index 249baa8c2791..8413217cbb78 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ccrFixture from './fixtures/ccr'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr_shard.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr_shard.js index e5a2418f215b..776bee5a3eaf 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr_shard.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/ccr_shard.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import ccrShardFixture from './fixtures/ccr_shard'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/index_detail.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/index_detail.js index b9af7be8154a..de21b697a7dc 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/index_detail.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/index_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import indexDetailFixture from './fixtures/index_detail'; import indexDetailAdvancedFixture from './fixtures/index_detail_advanced'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js index 9e4b07279659..085e0354ee3e 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/indices.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import relocatingShardsFixture from './fixtures/indices_shards_relocating'; import relocationShardsAllFixture from './fixtures/indices_shards_relocating_all'; import indicesRedClusterFixture from './fixtures/indices_red_cluster'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js index 35fc50c14d27..e23b5db8db22 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import nodeDetailFixture from './fixtures/node_detail'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js index 14911878dfb6..ec182a1d1b51 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail_advanced.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import nodeDetailFixture from './fixtures/node_detail_advanced'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/nodes.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/nodes.js index f1a978a8bdab..7d3bb23ebfbc 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/nodes.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import nodesListingFixtureGreen from './fixtures/nodes_listing_green'; import nodesListingFixtureRed from './fixtures/nodes_listing_red'; import nodesListingFixtureCgroup from './fixtures/nodes_listing_cgroup'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/overview.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/overview.js index 170fe101433b..cc5ab081125e 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import overviewFixtureGreenPlatinum from './fixtures/overview_green_platinum'; import overviewFixtureRedPlatinum from './fixtures/overview_red_platinum'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_cluster.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_cluster.js index 0c17f08ff336..521d201c9d1d 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_cluster.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_cluster.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js index 0c500610b1ed..c383a65f4a15 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_enabled.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_enabled.js index 7b5c73f029a4..9b85887311e9 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_enabled.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_enabled.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_interval.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_interval.js index ac469fb3e886..a58cc01c3871 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_interval.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/set_collection_interval.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/monitoring/kibana/instance.js b/x-pack/test/api_integration/apis/monitoring/kibana/instance.js index e0a67839e296..e2906e74c517 100644 --- a/x-pack/test/api_integration/apis/monitoring/kibana/instance.js +++ b/x-pack/test/api_integration/apis/monitoring/kibana/instance.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import instanceFixture from './fixtures/instance'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/kibana/listing.js b/x-pack/test/api_integration/apis/monitoring/kibana/listing.js index 013f20486d9a..c6db6171d530 100644 --- a/x-pack/test/api_integration/apis/monitoring/kibana/listing.js +++ b/x-pack/test/api_integration/apis/monitoring/kibana/listing.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import listingFixture from './fixtures/listing'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/kibana/overview.js b/x-pack/test/api_integration/apis/monitoring/kibana/overview.js index c3e333962344..42c0def5050f 100644 --- a/x-pack/test/api_integration/apis/monitoring/kibana/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/kibana/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import overviewFixture from './fixtures/overview'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/logstash/node_detail.js b/x-pack/test/api_integration/apis/monitoring/logstash/node_detail.js index bbc385e3ba1c..92f093e8a334 100644 --- a/x-pack/test/api_integration/apis/monitoring/logstash/node_detail.js +++ b/x-pack/test/api_integration/apis/monitoring/logstash/node_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import nodeDetailFixture from './fixtures/node_detail'; import nodeDetailAdvancedFixture from './fixtures/node_detail_advanced'; diff --git a/x-pack/test/api_integration/apis/monitoring/logstash/nodes.js b/x-pack/test/api_integration/apis/monitoring/logstash/nodes.js index 7709eaeae0c6..ddc60e780e86 100644 --- a/x-pack/test/api_integration/apis/monitoring/logstash/nodes.js +++ b/x-pack/test/api_integration/apis/monitoring/logstash/nodes.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import nodesFixture from './fixtures/nodes'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/logstash/overview.js b/x-pack/test/api_integration/apis/monitoring/logstash/overview.js index b5053336f072..9c432486c461 100644 --- a/x-pack/test/api_integration/apis/monitoring/logstash/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/logstash/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import overviewFixture from './fixtures/overview.json'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/cluster.js b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/cluster.js index ed753e8dea9a..d9ff5303be65 100644 --- a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/cluster.js +++ b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/cluster.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import clusterFixture from './fixtures/cluster'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js index e4a99127c7bb..33fcdc6f9b5a 100644 --- a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js +++ b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import clustersFixture from './fixtures/clusters'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/security/basic_login.js b/x-pack/test/api_integration/apis/security/basic_login.js index add872ee66dd..39c6c0ef0a13 100644 --- a/x-pack/test/api_integration/apis/security/basic_login.js +++ b/x-pack/test/api_integration/apis/security/basic_login.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import request from 'request'; export default function ({ getService }) { diff --git a/x-pack/test/api_integration/apis/security/roles.js b/x-pack/test/api_integration/apis/security/roles.js index 28e6f517d8e8..46eb56ab5602 100644 --- a/x-pack/test/api_integration/apis/security/roles.js +++ b/x-pack/test/api_integration/apis/security/roles.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const es = getService('es'); diff --git a/x-pack/test/api_integration/apis/uptime/get_all_pings.js b/x-pack/test/api_integration/apis/uptime/get_all_pings.js index a3cf2774fb02..d2c7cd3b3f5c 100644 --- a/x-pack/test/api_integration/apis/uptime/get_all_pings.js +++ b/x-pack/test/api_integration/apis/uptime/get_all_pings.js @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js b/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js index 9935151b36a7..087697377ce8 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getDocCountQueryString } from '../../../../../plugins/uptime/public/components/queries/empty_state/get_doc_count'; import docCount from './fixtures/doc_count'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/error_list.js b/x-pack/test/api_integration/apis/uptime/graphql/error_list.js index 3aaf7798d1fa..862cfefec4df 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/error_list.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/error_list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getErrorListQueryString } from '../../../../../plugins/uptime/public/components/queries/error_list/get_error_list'; import errorList from './fixtures/error_list'; import errorListFilteredById from './fixtures/error_list_filtered_by_id'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js b/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js index fdbade1b1590..463b7b9bd9b2 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getFilterBarQueryString } from '../../../../../plugins/uptime/public/components/queries/filter_bar/get_filter_bar'; import filterList from './fixtures/filter_list'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js index 26e73fca2d80..8e761557b1c7 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getMonitorChartsQueryString } from '../../../../../plugins/uptime/public/components/queries/monitor_charts/get_monitor_charts'; import monitorCharts from './fixtures/monitor_charts'; import monitorChartsEmptySet from './fixtures/monitor_charts_empty_set'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_list.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_list.js index 1720d1c11db0..6e190195f520 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_list.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import monitorList from './fixtures/monitor_list'; import monitorListDownFiltered from './fixtures/monitor_list_down_filtered'; import monitorListUpFiltered from './fixtures/monitor_list_up_filtered'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js index f50e48dafc2d..15399b058f9b 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js @@ -5,7 +5,7 @@ */ import { omit } from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; // eslint-disable-next-line max-len import { getMonitorStatusBarQueryString } from '../../../../../plugins/uptime/public/components/queries/monitor_status_bar/get_monitor_status_bar'; import monitorStatus from './fixtures/monitor_status'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.js b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.js index ea44b03fbe81..89d974353b7f 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getPingsQueryString } from '../../../../../plugins/uptime/public/components/queries/ping_list/get_pings'; import pingList from './fixtures/ping_list'; import pingListCount from './fixtures/ping_list_count'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js b/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js index f1f98733be4e..4e656e001ac9 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getSnapshotQueryString } from '../../../../../plugins/uptime/public/components/queries/snapshot/get_snapshot'; import snapshot from './fixtures/snapshot'; import snapshotFilteredByDown from './fixtures/snapshot_filtered_by_down'; diff --git a/x-pack/test/api_integration/apis/xpack_main/settings/settings.js b/x-pack/test/api_integration/apis/xpack_main/settings/settings.js index 9f7055c7b833..3a19aa10e305 100644 --- a/x-pack/test/api_integration/apis/xpack_main/settings/settings.js +++ b/x-pack/test/api_integration/apis/xpack_main/settings/settings.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry.js b/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry.js index 08ebc715527b..3017a3588023 100644 --- a/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry.js +++ b/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import multiClusterFixture from './fixtures/multicluster'; import basicClusterFixture from './fixtures/basiccluster'; diff --git a/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry_local.js b/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry_local.js index 2ee08c3cdfb8..93671ccdc5fd 100644 --- a/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry_local.js +++ b/x-pack/test/api_integration/apis/xpack_main/telemetry/telemetry_local.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import _ from 'lodash'; /* diff --git a/x-pack/test/functional/apps/canvas/smoke_test.js b/x-pack/test/functional/apps/canvas/smoke_test.js index 45552e1a4067..b309472f382c 100644 --- a/x-pack/test/functional/apps/canvas/smoke_test.js +++ b/x-pack/test/functional/apps/canvas/smoke_test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { parse } from 'url'; export default function canvasSmokeTest({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js b/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js index 8a70a2c64c5d..9275a802bfaa 100644 --- a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js +++ b/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); diff --git a/x-pack/test/functional/apps/graph/graph.js b/x-pack/test/functional/apps/graph/graph.js index 655feb529cfa..b7e5e4445097 100644 --- a/x-pack/test/functional/apps/graph/graph.js +++ b/x-pack/test/functional/apps/graph/graph.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; // import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/logstash/pipeline_create.js b/x-pack/test/functional/apps/logstash/pipeline_create.js index 101f9d3f0387..7c1d1bf13d8e 100644 --- a/x-pack/test/functional/apps/logstash/pipeline_create.js +++ b/x-pack/test/functional/apps/logstash/pipeline_create.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const browser = getService('browser'); diff --git a/x-pack/test/functional/apps/logstash/pipeline_list.js b/x-pack/test/functional/apps/logstash/pipeline_list.js index 5fd40a0b3a36..d04f50690368 100644 --- a/x-pack/test/functional/apps/logstash/pipeline_list.js +++ b/x-pack/test/functional/apps/logstash/pipeline_list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { omit } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/maps/add_layer_panel.js b/x-pack/test/functional/apps/maps/add_layer_panel.js index f18ea6fb9971..1bb30477a2a9 100644 --- a/x-pack/test/functional/apps/maps/add_layer_panel.js +++ b/x-pack/test/functional/apps/maps/add_layer_panel.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects }) { const PageObjects = getPageObjects(['maps', 'common']); diff --git a/x-pack/test/functional/apps/maps/embeddable/dashboard.js b/x-pack/test/functional/apps/maps/embeddable/dashboard.js index f7e35bd5ca99..0fecfd71f3d1 100644 --- a/x-pack/test/functional/apps/maps/embeddable/dashboard.js +++ b/x-pack/test/functional/apps/maps/embeddable/dashboard.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['common', 'dashboard', 'maps']); diff --git a/x-pack/test/functional/apps/maps/es_geo_grid_source.js b/x-pack/test/functional/apps/maps/es_geo_grid_source.js index a4663256fc34..1ee034d07689 100644 --- a/x-pack/test/functional/apps/maps/es_geo_grid_source.js +++ b/x-pack/test/functional/apps/maps/es_geo_grid_source.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { diff --git a/x-pack/test/functional/apps/maps/es_search_source.js b/x-pack/test/functional/apps/maps/es_search_source.js index c9745ebbecfa..a20f41148637 100644 --- a/x-pack/test/functional/apps/maps/es_search_source.js +++ b/x-pack/test/functional/apps/maps/es_search_source.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps']); diff --git a/x-pack/test/functional/apps/maps/joins.js b/x-pack/test/functional/apps/maps/joins.js index 797622540599..4eae5e85dbec 100644 --- a/x-pack/test/functional/apps/maps/joins.js +++ b/x-pack/test/functional/apps/maps/joins.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; const JOIN_PROPERTY_NAME = '__kbnjoin__max_of_prop1_groupby_meta_for_geo_shapes*.shape_name'; const EXPECTED_JOIN_VALUES = { diff --git a/x-pack/test/functional/apps/maps/layer_errors.js b/x-pack/test/functional/apps/maps/layer_errors.js index 532cba839127..1fe9778a44db 100644 --- a/x-pack/test/functional/apps/maps/layer_errors.js +++ b/x-pack/test/functional/apps/maps/layer_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects }) { diff --git a/x-pack/test/functional/apps/maps/sample_data.js b/x-pack/test/functional/apps/maps/sample_data.js index 7e871d01f9fd..76ddeab4ae15 100644 --- a/x-pack/test/functional/apps/maps/sample_data.js +++ b/x-pack/test/functional/apps/maps/sample_data.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService, updateBaselines }) { const PageObjects = getPageObjects(['common', 'maps', 'header', 'home', 'timePicker']); diff --git a/x-pack/test/functional/apps/maps/saved_object_management.js b/x-pack/test/functional/apps/maps/saved_object_management.js index e093d86ebde8..a31bc2bdd569 100644 --- a/x-pack/test/functional/apps/maps/saved_object_management.js +++ b/x-pack/test/functional/apps/maps/saved_object_management.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getPageObjects, getService }) { diff --git a/x-pack/test/functional/apps/monitoring/beats/beat_detail.js b/x-pack/test/functional/apps/monitoring/beats/beat_detail.js index 5ca033549f93..d352579e0116 100644 --- a/x-pack/test/functional/apps/monitoring/beats/beat_detail.js +++ b/x-pack/test/functional/apps/monitoring/beats/beat_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/beats/cluster.js b/x-pack/test/functional/apps/monitoring/beats/cluster.js index 949feef98785..8ee93066254d 100644 --- a/x-pack/test/functional/apps/monitoring/beats/cluster.js +++ b/x-pack/test/functional/apps/monitoring/beats/cluster.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/beats/listing.js b/x-pack/test/functional/apps/monitoring/beats/listing.js index 0a0148aee69c..700b5d593ecb 100644 --- a/x-pack/test/functional/apps/monitoring/beats/listing.js +++ b/x-pack/test/functional/apps/monitoring/beats/listing.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/beats/overview.js b/x-pack/test/functional/apps/monitoring/beats/overview.js index 049ffc963c4f..1c8b70a46284 100644 --- a/x-pack/test/functional/apps/monitoring/beats/overview.js +++ b/x-pack/test/functional/apps/monitoring/beats/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/cluster/alerts.js b/x-pack/test/functional/apps/monitoring/cluster/alerts.js index 8cc6b3e5f089..0a2ffb90c536 100644 --- a/x-pack/test/functional/apps/monitoring/cluster/alerts.js +++ b/x-pack/test/functional/apps/monitoring/cluster/alerts.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; const HIGH_ALERT_MESSAGE = 'High severity alert'; diff --git a/x-pack/test/functional/apps/monitoring/cluster/list.js b/x-pack/test/functional/apps/monitoring/cluster/list.js index aa2e8ff8ee04..c3eb509c6eed 100644 --- a/x-pack/test/functional/apps/monitoring/cluster/list.js +++ b/x-pack/test/functional/apps/monitoring/cluster/list.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/cluster/overview.js b/x-pack/test/functional/apps/monitoring/cluster/overview.js index bfbd1b69a9e5..8242150e404e 100644 --- a/x-pack/test/functional/apps/monitoring/cluster/overview.js +++ b/x-pack/test/functional/apps/monitoring/cluster/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js b/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js index dd0ea8f03ab4..718d4c012989 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/index_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js b/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js index 2dea5db65598..fc3669079dbc 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/indices.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/node_detail.js b/x-pack/test/functional/apps/monitoring/elasticsearch/node_detail.js index 1cb6902948a1..46fdd8d3921a 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/node_detail.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/node_detail.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index f57677411c21..357874d50141 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js b/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js index 1597bc6be046..3f90c6a096e9 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/shards.js b/x-pack/test/functional/apps/monitoring/elasticsearch/shards.js index dd106082d033..e22d160f4faf 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/shards.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/shards.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js b/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js index efb9fecb3744..2cdecc58266a 100644 --- a/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js +++ b/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const PageObjects = getPageObjects(['monitoring', 'common', 'header']); diff --git a/x-pack/test/functional/apps/monitoring/kibana/instance.js b/x-pack/test/functional/apps/monitoring/kibana/instance.js index c6f6fb4aaa5c..33448fc4b206 100644 --- a/x-pack/test/functional/apps/monitoring/kibana/instance.js +++ b/x-pack/test/functional/apps/monitoring/kibana/instance.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/kibana/instances.js b/x-pack/test/functional/apps/monitoring/kibana/instances.js index b79f67152b85..28bf108d59f2 100644 --- a/x-pack/test/functional/apps/monitoring/kibana/instances.js +++ b/x-pack/test/functional/apps/monitoring/kibana/instances.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/kibana/overview.js b/x-pack/test/functional/apps/monitoring/kibana/overview.js index 90a8bebe9021..7282e48fc8a9 100644 --- a/x-pack/test/functional/apps/monitoring/kibana/overview.js +++ b/x-pack/test/functional/apps/monitoring/kibana/overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/monitoring/logstash/pipelines.js b/x-pack/test/functional/apps/monitoring/logstash/pipelines.js index 613a3d87efe7..4d2a7dbc6888 100644 --- a/x-pack/test/functional/apps/monitoring/logstash/pipelines.js +++ b/x-pack/test/functional/apps/monitoring/logstash/pipelines.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { getLifecycleMethods } from '../_get_lifecycle_methods'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js index c0012ee04ab7..5546cd9311ef 100644 --- a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js +++ b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/doc_level_security_roles.js b/x-pack/test/functional/apps/security/doc_level_security_roles.js index 2229c8c08365..9ea1e30358ff 100644 --- a/x-pack/test/functional/apps/security/doc_level_security_roles.js +++ b/x-pack/test/functional/apps/security/doc_level_security_roles.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/field_level_security.js b/x-pack/test/functional/apps/security/field_level_security.js index eb9fdd2a5084..4ce68580334a 100644 --- a/x-pack/test/functional/apps/security/field_level_security.js +++ b/x-pack/test/functional/apps/security/field_level_security.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/management.js b/x-pack/test/functional/apps/security/management.js index 053f805d4e46..aa9ae9f1ed48 100644 --- a/x-pack/test/functional/apps/security/management.js +++ b/x-pack/test/functional/apps/security/management.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { USERS_PATH, EDIT_USERS_PATH, diff --git a/x-pack/test/functional/apps/security/rbac_phase1.js b/x-pack/test/functional/apps/security/rbac_phase1.js index e25dcec464a7..e8c70b0d9644 100644 --- a/x-pack/test/functional/apps/security/rbac_phase1.js +++ b/x-pack/test/functional/apps/security/rbac_phase1.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/secure_roles_perm.js b/x-pack/test/functional/apps/security/secure_roles_perm.js index 47502e7fc72a..fb5effa62775 100644 --- a/x-pack/test/functional/apps/security/secure_roles_perm.js +++ b/x-pack/test/functional/apps/security/secure_roles_perm.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/security.js b/x-pack/test/functional/apps/security/security.js index ba4ee6fb7b29..38d4d6a39398 100644 --- a/x-pack/test/functional/apps/security/security.js +++ b/x-pack/test/functional/apps/security/security.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/functional/apps/security/user_email.js b/x-pack/test/functional/apps/security/user_email.js index 331217178668..d4828b61053d 100644 --- a/x-pack/test/functional/apps/security/user_email.js +++ b/x-pack/test/functional/apps/security/user_email.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/security/users.js b/x-pack/test/functional/apps/security/users.js index 53c4df274c87..b8fabf534f6e 100644 --- a/x-pack/test/functional/apps/security/users.js +++ b/x-pack/test/functional/apps/security/users.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; export default function ({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/apps/watcher/watcher_test.js b/x-pack/test/functional/apps/watcher/watcher_test.js index 1af7da85036b..c07ab3b7155d 100644 --- a/x-pack/test/functional/apps/watcher/watcher_test.js +++ b/x-pack/test/functional/apps/watcher/watcher_test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexBy } from 'lodash'; const watchID = 'watchID'; diff --git a/x-pack/test/functional/page_objects/accountsetting_page.js b/x-pack/test/functional/page_objects/accountsetting_page.js index 90f3bc5bc181..a49b9544ce7e 100644 --- a/x-pack/test/functional/page_objects/accountsetting_page.js +++ b/x-pack/test/functional/page_objects/accountsetting_page.js @@ -5,7 +5,7 @@ */ //import { map as mapAsync } from 'bluebird'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function AccountSettingProvider({ getService }) { const testSubjects = getService('testSubjects'); diff --git a/x-pack/test/functional/page_objects/rollup_page.js b/x-pack/test/functional/page_objects/rollup_page.js index b722fd17a416..44eb762fb708 100644 --- a/x-pack/test/functional/page_objects/rollup_page.js +++ b/x-pack/test/functional/page_objects/rollup_page.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { map as mapAsync } from 'bluebird'; export function RollupPageProvider({ getService, getPageObjects }) { diff --git a/x-pack/test/functional/page_objects/space_selector_page.js b/x-pack/test/functional/page_objects/space_selector_page.js index 9f7ff9ced6b6..3be1ae174ce4 100644 --- a/x-pack/test/functional/page_objects/space_selector_page.js +++ b/x-pack/test/functional/page_objects/space_selector_page.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function SpaceSelectorPageProvider({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/x-pack/test/functional/page_objects/status_page.js b/x-pack/test/functional/page_objects/status_page.js index 36915dff5dd0..68fc931a9140 100644 --- a/x-pack/test/functional/page_objects/status_page.js +++ b/x-pack/test/functional/page_objects/status_page.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function StatusPagePageProvider({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/x-pack/test/functional/page_objects/upgrade_assistant.js b/x-pack/test/functional/page_objects/upgrade_assistant.js index f0011b76b2ac..af9d5ea55cec 100644 --- a/x-pack/test/functional/page_objects/upgrade_assistant.js +++ b/x-pack/test/functional/page_objects/upgrade_assistant.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function UpgradeAssistantProvider({ getService, getPageObjects }) { const retry = getService('retry'); diff --git a/x-pack/test/functional/services/grok_debugger.js b/x-pack/test/functional/services/grok_debugger.js index c8870e534ce5..48717bee0e3a 100644 --- a/x-pack/test/functional/services/grok_debugger.js +++ b/x-pack/test/functional/services/grok_debugger.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function GrokDebuggerProvider({ getService }) { const aceEditor = getService('aceEditor'); diff --git a/x-pack/test/functional/services/monitoring/cluster_overview.js b/x-pack/test/functional/services/monitoring/cluster_overview.js index 25c110ef4d9d..83657bd88496 100644 --- a/x-pack/test/functional/services/monitoring/cluster_overview.js +++ b/x-pack/test/functional/services/monitoring/cluster_overview.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; export function MonitoringClusterOverviewProvider({ getService }) { const testSubjects = getService('testSubjects'); diff --git a/x-pack/test/functional/services/pipeline_editor.js b/x-pack/test/functional/services/pipeline_editor.js index ad7b5e7d0147..804fdf27158f 100644 --- a/x-pack/test/functional/services/pipeline_editor.js +++ b/x-pack/test/functional/services/pipeline_editor.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { props as propsAsync } from 'bluebird'; export function PipelineEditorProvider({ getService }) { diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js index 0d3180902d55..4bfae4c24a88 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_manager_integration.js @@ -5,7 +5,7 @@ */ import _ from 'lodash'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import url from 'url'; import supertestAsPromised from 'supertest-as-promised'; diff --git a/x-pack/test/reporting/api/usage.js b/x-pack/test/reporting/api/usage.js index 0e5004e9c956..1b70ab9e4547 100644 --- a/x-pack/test/reporting/api/usage.js +++ b/x-pack/test/reporting/api/usage.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import * as GenerationUrls from './generation_urls'; export default function ({ getService }) { diff --git a/x-pack/test/reporting/functional/reporting.js b/x-pack/test/reporting/functional/reporting.js index 33f064388aa6..4e1b51ae058e 100644 --- a/x-pack/test/reporting/functional/reporting.js +++ b/x-pack/test/reporting/functional/reporting.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import path from 'path'; import mkdirp from 'mkdirp'; import fs from 'fs'; diff --git a/x-pack/test/reporting/services/reporting_api.js b/x-pack/test/reporting/services/reporting_api.js index 0c66a77a65fe..8feb7a70803e 100644 --- a/x-pack/test/reporting/services/reporting_api.js +++ b/x-pack/test/reporting/services/reporting_api.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { indexTimestamp } from '../../../plugins/reporting/server/lib/esqueue/helpers/index_timestamp'; function removeWhitespace(str) { diff --git a/x-pack/test/saml_api_integration/apis/security/saml_login.js b/x-pack/test/saml_api_integration/apis/security/saml_login.js index fe6f2bf07db0..a664d68d1b2d 100644 --- a/x-pack/test/saml_api_integration/apis/security/saml_login.js +++ b/x-pack/test/saml_api_integration/apis/security/saml_login.js @@ -8,7 +8,7 @@ import querystring from 'querystring'; import url from 'url'; import { delay } from 'bluebird'; import { getLogoutRequest, getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml_tools'; -import expect from 'expect.js'; +import expect from '@kbn/expect'; import request from 'request'; export default function ({ getService }) { diff --git a/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts b/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts index 82099fe4bd30..b0390af36017 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts index e82ea7b856a8..a0e0d21f942d 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/bulk_get.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/create.ts b/x-pack/test/saved_object_api_integration/common/suites/create.ts index 9a8de7d7f3bd..8dc73a7b31e4 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/create.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/delete.ts b/x-pack/test/saved_object_api_integration/common/suites/delete.ts index 5e4068f5b795..229ef4e625ba 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/delete.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/delete.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/export.ts b/x-pack/test/saved_object_api_integration/common/suites/export.ts index 1b55245a210c..58ebf31e5dae 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/export.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/export.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/find.ts b/x-pack/test/saved_object_api_integration/common/suites/find.ts index d71a56a79a41..f00697889a3b 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/find.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/find.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/get.ts b/x-pack/test/saved_object_api_integration/common/suites/get.ts index 1cc36b411c61..c178a2389986 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/get.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/get.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/import.ts b/x-pack/test/saved_object_api_integration/common/suites/import.ts index 9f45044031e5..816b68d3eed3 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/import.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/import.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/common/suites/resolve_import_errors.ts index c13a5bf15afe..0a06ca064bee 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/resolve_import_errors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/common/suites/update.ts b/x-pack/test/saved_object_api_integration/common/suites/update.ts index 7fa534e142b3..e292daa13d12 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/update.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/update.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getIdPrefix, getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts index cf794079a42e..efbc14060c9f 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create'; diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts index 129023130e71..0c29292f293c 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; diff --git a/x-pack/test/spaces_api_integration/common/suites/create.ts b/x-pack/test/spaces_api_integration/common/suites/create.ts index 4a8b2bc5c9e8..6af5afc2530c 100644 --- a/x-pack/test/spaces_api_integration/common/suites/create.ts +++ b/x-pack/test/spaces_api_integration/common/suites/create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { getUrlPrefix } from '../lib/space_test_utils'; import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; diff --git a/x-pack/test/spaces_api_integration/common/suites/delete.ts b/x-pack/test/spaces_api_integration/common/suites/delete.ts index 4ebd26190f9d..2cf2d9388665 100644 --- a/x-pack/test/spaces_api_integration/common/suites/delete.ts +++ b/x-pack/test/spaces_api_integration/common/suites/delete.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { getUrlPrefix } from '../lib/space_test_utils'; import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; diff --git a/x-pack/test/spaces_api_integration/common/suites/get.ts b/x-pack/test/spaces_api_integration/common/suites/get.ts index dd9e686de75a..06fda9313f7a 100644 --- a/x-pack/test/spaces_api_integration/common/suites/get.ts +++ b/x-pack/test/spaces_api_integration/common/suites/get.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperAgent } from 'superagent'; import { getUrlPrefix } from '../lib/space_test_utils'; import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; diff --git a/x-pack/test/spaces_api_integration/common/suites/get_all.ts b/x-pack/test/spaces_api_integration/common/suites/get_all.ts index 175fcc8f8bfb..64acb60308c4 100644 --- a/x-pack/test/spaces_api_integration/common/suites/get_all.ts +++ b/x-pack/test/spaces_api_integration/common/suites/get_all.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { getUrlPrefix } from '../lib/space_test_utils'; import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; diff --git a/x-pack/test/spaces_api_integration/common/suites/select.ts b/x-pack/test/spaces_api_integration/common/suites/select.ts index b9f67d9f0596..489dc9f26529 100644 --- a/x-pack/test/spaces_api_integration/common/suites/select.ts +++ b/x-pack/test/spaces_api_integration/common/suites/select.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { DEFAULT_SPACE_ID } from '../../../../plugins/spaces/common/constants'; import { getUrlPrefix } from '../lib/space_test_utils'; diff --git a/x-pack/test/spaces_api_integration/common/suites/update.ts b/x-pack/test/spaces_api_integration/common/suites/update.ts index a0cb1a944173..88297df31133 100644 --- a/x-pack/test/spaces_api_integration/common/suites/update.ts +++ b/x-pack/test/spaces_api_integration/common/suites/update.ts @@ -3,7 +3,7 @@ * 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 expect from '@kbn/expect'; import { SuperTest } from 'supertest'; import { getUrlPrefix } from '../lib/space_test_utils'; import { DescribeFn, TestDefinitionAuthentication } from '../lib/types'; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 2e9fc43a6aa6..a22ce122b176 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../tsconfig.json", "compilerOptions": { "types": [ - "@kbn/test/types/expect.js", "mocha", "node" ] diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js index 56f1171de944..ae48c38a23fe 100644 --- a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js +++ b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js @@ -5,7 +5,7 @@ */ -import expect from 'expect.js'; +import expect from '@kbn/expect'; import { ReindexStatus, REINDEX_OP_TYPE } from '../../../plugins/upgrade_assistant/common/types'; diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index dd3ab033718b..979d0737d03a 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -32,8 +32,7 @@ }, "types": [ "node", - "jest", - "@kbn/test/types/expect.js" + "jest" ] } } diff --git a/yarn.lock b/yarn.lock index 02a508c61450..1bd209686838 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9714,11 +9714,6 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect.js@0.3.1, expect.js@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/expect.js/-/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" - integrity sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s= - expect.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/expect.js/-/expect.js-0.2.0.tgz#1028533d2c1c363f74a6796ff57ec0520ded2be1" From dfeb12f50200783a8bcb8a783d584c9b85fd1984 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 25 Mar 2019 11:00:57 -0700 Subject: [PATCH 04/25] [ci] rebuild kbn-pm distributatble to ensure it is up-to-date (#33752) --- src/dev/ci_setup/setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/dev/ci_setup/setup.sh b/src/dev/ci_setup/setup.sh index c5ab06f40983..179fac9aa8a7 100755 --- a/src/dev/ci_setup/setup.sh +++ b/src/dev/ci_setup/setup.sh @@ -144,3 +144,19 @@ if [ "$GIT_CHANGES" ]; then echo -e "$GIT_CHANGES\n" exit 1 fi + +### +### rebuild kbn-pm distributable to ensure it's not out of date +### +echo " -- building kbn-pm distributable" +yarn kbn run build -i @kbn/pm + +### +### verify no git modifications +### +GIT_CHANGES="$(git ls-files --modified)" +if [ "$GIT_CHANGES" ]; then + echo -e "\n${RED}ERROR: 'yarn kbn run build -i @kbn/pm' caused changes to the following files:${C_RESET}\n" + echo -e "$GIT_CHANGES\n" + exit 1 +fi From 3f9c36bb2511f3bc30d1906aeae6906b512b06cb Mon Sep 17 00:00:00 2001 From: Brandon Kobel Date: Mon, 25 Mar 2019 11:03:25 -0700 Subject: [PATCH 05/25] Fixing the regex that is used to validate the Space ID (#33716) * Fixing the regex that is used to validate the Space id * Adding basic jest tests for the space schema's ID --- .../spaces/server/lib/space_schema.test.ts | 64 +++++++++++++++++++ .../plugins/spaces/server/lib/space_schema.ts | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/spaces/server/lib/space_schema.test.ts diff --git a/x-pack/plugins/spaces/server/lib/space_schema.test.ts b/x-pack/plugins/spaces/server/lib/space_schema.test.ts new file mode 100644 index 000000000000..6ca37affb848 --- /dev/null +++ b/x-pack/plugins/spaces/server/lib/space_schema.test.ts @@ -0,0 +1,64 @@ +/* + * 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 { spaceSchema } from './space_schema'; + +const defaultProperties = { + id: 'foo', + name: 'foo', +}; + +describe('#id', () => { + test('is optional', () => { + const result = spaceSchema.validate({ + ...defaultProperties, + id: undefined, + }); + expect(result.error).toBeNull(); + }); + + test('allows lowercase a-z, 0-9, "_" and "-"', () => { + const result = spaceSchema.validate({ + ...defaultProperties, + id: 'abcdefghijklmnopqrstuvwxyz0123456789_-', + }); + expect(result.error).toBeNull(); + }); + + test(`doesn't allow uppercase`, () => { + const result = spaceSchema.validate({ + ...defaultProperties, + id: 'Foo', + }); + expect(result.error).toMatchInlineSnapshot( + `[ValidationError: child "id" fails because ["id" with value "Foo" fails to match the lower case, a-z, 0-9, "_", and "-" are allowed pattern]]` + ); + }); + + test(`doesn't allow an empty string`, () => { + const result = spaceSchema.validate({ + ...defaultProperties, + id: '', + }); + expect(result.error).toMatchInlineSnapshot( + `[ValidationError: child "id" fails because ["id" is not allowed to be empty]]` + ); + }); + + ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', ',', '.', '/', '?'].forEach( + invalidCharacter => { + test(`doesn't allow ${invalidCharacter}`, () => { + const result = spaceSchema.validate({ + ...defaultProperties, + id: `foo-${invalidCharacter}`, + }); + expect(result.error).toMatchObject({ + message: `child "id" fails because ["id" with value "foo-${invalidCharacter}" fails to match the lower case, a-z, 0-9, "_", and "-" are allowed pattern]`, + }); + }); + } + ); +}); diff --git a/x-pack/plugins/spaces/server/lib/space_schema.ts b/x-pack/plugins/spaces/server/lib/space_schema.ts index 3343a05a9ae5..d27a855e0f91 100644 --- a/x-pack/plugins/spaces/server/lib/space_schema.ts +++ b/x-pack/plugins/spaces/server/lib/space_schema.ts @@ -8,7 +8,7 @@ import Joi from 'joi'; import { MAX_SPACE_INITIALS } from '../../common/constants'; export const spaceSchema = Joi.object({ - id: Joi.string().regex(/[a-z0-9_\-]*/, `lower case, a-z, 0-9, "_", and "-" are allowed`), + id: Joi.string().regex(/^[a-z0-9_\-]+$/, `lower case, a-z, 0-9, "_", and "-" are allowed`), name: Joi.string().required(), description: Joi.string().allow(''), initials: Joi.string().max(MAX_SPACE_INITIALS), From 5ed923e91e33d3c06234fbc221fe17f24c17aa4c Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Mon, 25 Mar 2019 14:36:40 -0400 Subject: [PATCH 06/25] Ensure the pipelines page utilizes reactNodeId (#33798) --- .../plugins/monitoring/public/views/logstash/pipelines/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js index 058b9127c82a..044f0dc2434b 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js @@ -72,6 +72,7 @@ uiRoutes title: 'Logstash Pipelines', storageKey: 'logstash.pipelines', getPageData, + reactNodeId: 'monitoringLogstashPipelinesApp', $scope, $injector }); From 0665508b6530616fb3b0f42c74be8b803f2b24ed Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Mon, 25 Mar 2019 16:23:19 -0400 Subject: [PATCH 07/25] only show charts if cell has been selected (#33680) --- x-pack/plugins/ml/public/explorer/explorer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/public/explorer/explorer.js b/x-pack/plugins/ml/public/explorer/explorer.js index d93fd30b284a..d3a178709fb8 100644 --- a/x-pack/plugins/ml/public/explorer/explorer.js +++ b/x-pack/plugins/ml/public/explorer/explorer.js @@ -810,7 +810,7 @@ export const Explorer = injectI18n(injectObservablesAsProps( this.setState(stateUpdate); - if (selectedCells !== null || influencersFilterQuery !== undefined) { + if (selectedCells !== null) { this.updateCharts( stateUpdate.anomalyChartRecords, timerange.earliestMs, timerange.latestMs ); @@ -1274,7 +1274,7 @@ export const Explorer = injectI18n(injectObservablesAsProps( - {anomalyChartRecords.length > 0 && ( + {(anomalyChartRecords.length > 0 && selectedCells !== null) && ( From c6acd796c13f09d6f4b7a1e215d895f4122e5d23 Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Mon, 25 Mar 2019 16:51:27 -0700 Subject: [PATCH 08/25] Added display name and help description to shape arg in progress view (#33819) --- x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js index bd929a32232d..6b9831d06d59 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js @@ -15,6 +15,8 @@ export const progress = () => ({ args: [ { name: 'shape', + displayName: 'Shape', + help: 'Shape of the progress indicator', argType: 'select', options: { choices: Object.keys(shapes).map(key => ({ From 67acefc28336878ab2d34d662a7dd5a0b1dbd899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Tue, 26 Mar 2019 08:47:29 +0100 Subject: [PATCH 09/25] [CCR] Client integration tests (table lists) (#33525) --- .../auto_follow_pattern_list.test.js | 321 ++++++++++++++ .../follower_indices_list.test.js | 343 +++++++++++++++ .../__jest__/client_integration/home.test.js | 84 ++++ .../client_integration/test_helpers.js | 212 ++++++++++ .../fixtures/auto_follow_pattern.js | 26 +- .../fixtures/follower_index.js | 177 +++++--- .../auto_follow_pattern_delete_provider.js | 1 + .../auto_follow_pattern_indices_preview.js | 2 +- .../follower_index_pause_provider.js | 1 + .../follower_index_resume_provider.js | 1 + .../follower_index_unfollow_provider.js | 1 + .../public/app/components/section_error.js | 3 +- .../public/app/components/section_loading.js | 3 +- .../auto_follow_pattern_list.js | 26 +- .../auto_follow_pattern_table.js | 1 + .../components/detail_panel/detail_panel.js | 390 +++++++++--------- .../components/context_menu/context_menu.js | 2 +- .../components/detail_panel/detail_panel.js | 208 +++++----- .../follower_indices_table.js | 5 +- .../follower_indices_list.js | 30 +- .../public/app/sections/home/home.js | 4 +- .../job_create.test_helpers.js | 2 +- .../sections/job_list/job_list.test.js | 18 - .../translations/translations/zh-CN.json | 1 - x-pack/test_utils/index.js | 3 +- x-pack/test_utils/lib/index.js | 1 + x-pack/test_utils/lib/strings.js | 2 +- x-pack/test_utils/lib/utils.js | 8 + x-pack/test_utils/testbed/testbed.js | 77 +++- 29 files changed, 1524 insertions(+), 429 deletions(-) create mode 100644 x-pack/plugins/cross_cluster_replication/__jest__/client_integration/auto_follow_pattern_list.test.js create mode 100644 x-pack/plugins/cross_cluster_replication/__jest__/client_integration/follower_indices_list.test.js create mode 100644 x-pack/plugins/cross_cluster_replication/__jest__/client_integration/home.test.js create mode 100644 x-pack/plugins/cross_cluster_replication/__jest__/client_integration/test_helpers.js create mode 100644 x-pack/test_utils/lib/utils.js diff --git a/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/auto_follow_pattern_list.test.js b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/auto_follow_pattern_list.test.js new file mode 100644 index 000000000000..f9933cd60f1c --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/auto_follow_pattern_list.test.js @@ -0,0 +1,321 @@ +/* + * 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 sinon from 'sinon'; + +import { initTestBed, mockAllHttpRequests, nextTick, getRandomString, findTestSubject } from './test_helpers'; +import { AutoFollowPatternList } from '../../public/app/sections/home/auto_follow_pattern_list'; +import { getAutoFollowPatternClientMock } from '../../fixtures/auto_follow_pattern'; + +jest.mock('ui/chrome', () => ({ + addBasePath: () => 'api/cross_cluster_replication', + breadcrumbs: { set: () => {} }, +})); + +jest.mock('ui/index_patterns', () => { + const { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE } = require.requireActual('../../../../../src/legacy/ui/public/index_patterns/constants'); // eslint-disable-line max-len + return { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE }; +}); + +describe('', () => { + let server; + let find; + let exists; + let component; + let getMetadataFromEuiTable; + let getUserActions; + let tableCellsValues; + let rows; + let updateHttpMockResponse; + + beforeEach(() => { + server = sinon.fakeServer.create(); + server.respondImmediately = true; + (updateHttpMockResponse = mockAllHttpRequests(server)); + }); + + describe('on component mount', () => { + beforeEach(async () => { + ({ exists } = initTestBed(AutoFollowPatternList)); + }); + + test('should show a loading indicator on component', async () => { + expect(exists('ccrAutoFollowPatternLoading')).toBe(true); + }); + }); + + describe('when there are no auto-follow patterns', () => { + beforeEach(async () => { + ({ exists, component } = initTestBed(AutoFollowPatternList)); + + await nextTick(); // We need to wait next tick for the mock server response to comes in + component.update(); + }); + + test('should display an empty prompt', async () => { + expect(exists('ccrAutoFollowPatternEmptyPrompt')).toBe(true); + }); + + test('should have a button to create a follower index', async () => { + expect(exists('ccrCreateAutoFollowPatternButton')).toBe(true); + }); + }); + + describe('when there are auto-follow patterns', async () => { + // For deterministic tests, we need to make sure that autoFollowPattern1 comes before autoFollowPattern2 + // in the table list that is rendered. As the table orders alphabetically by index name + // we prefix the random name to make sure that autoFollowPattern1 comes before autoFollowPattern2 + const testPrefix = 'prefix_'; + const testSuffix = '_suffix'; + + const autoFollowPattern1 = getAutoFollowPatternClientMock({ + name: `a${getRandomString()}`, + followIndexPattern: `${testPrefix}{{leader_index}}${testSuffix}` + }); + const autoFollowPattern2 = getAutoFollowPatternClientMock({ + name: `b${getRandomString()}`, + followIndexPattern: '{{leader_index}}' // no prefix nor suffix + }); + const autoFollowPatterns = [autoFollowPattern1, autoFollowPattern2]; + + let selectAutoFollowPatternAt; + let clickBulkDeleteButton; + let clickConfirmModalDeleteAutoFollowPattern; + let clickRowActionButtonAt; + let clickAutoFollowPatternAt; + + beforeEach(async () => { + updateHttpMockResponse('loadAutoFollowPatterns', { patterns: autoFollowPatterns }); + + // Mount the component + ({ + find, + exists, + component, + getMetadataFromEuiTable, + getUserActions, + } = initTestBed(AutoFollowPatternList)); + + await nextTick(); // Make sure that the Http request is fulfilled + component.update(); + + ({ + selectAutoFollowPatternAt, + clickBulkDeleteButton, + clickConfirmModalDeleteAutoFollowPattern, + clickRowActionButtonAt, + clickAutoFollowPatternAt, + } = getUserActions('autoFollowPatternList')); + + // Read the index list table + ({ tableCellsValues, rows } = getMetadataFromEuiTable('ccrAutoFollowPatternListTable')); + }); + + afterEach(async () => { + // The updates are not all synchronouse + // We need to wait for all the updates to ran before unmounting our component + await nextTick(100); + }); + + test('should not display the empty prompt', () => { + expect(exists('ccrFollowerIndexEmptyPrompt')).toBe(false); + }); + + test('should have a button to create an auto-follow pattern', () => { + expect(exists('ccrCreateAutoFollowPatternButton')).toBe(true); + }); + + test('should list the auto-follow patterns in the table', () => { + expect(tableCellsValues.length).toEqual(autoFollowPatterns.length); + expect(tableCellsValues).toEqual([ + [ '', // Empty because the first column is the checkbox to select row + autoFollowPattern1.name, + autoFollowPattern1.remoteCluster, + autoFollowPattern1.leaderIndexPatterns.join(', '), + testPrefix, + testSuffix, + '' // Empty because the last column is for the "actions" on the resource + ], [ '', + autoFollowPattern2.name, + autoFollowPattern2.remoteCluster, + autoFollowPattern2.leaderIndexPatterns.join(', '), + '', // no prefix + '', // no suffix + '' ] + ]); + }); + + describe('bulk delete button', () => { + test('should be visible when an auto-follow pattern is selected', () => { + expect(exists('ccrAutoFollowPatternListBulkDeleteActionButton')).toBe(false); + + selectAutoFollowPatternAt(0); + + expect(exists('ccrAutoFollowPatternListBulkDeleteActionButton')).toBe(true); + }); + + test('should update the button label according to the number of patterns selected', () => { + selectAutoFollowPatternAt(0); // 1 auto-follow pattern selected + expect(find('ccrAutoFollowPatternListBulkDeleteActionButton').text()).toEqual('Delete auto-follow pattern'); + + selectAutoFollowPatternAt(1); // 2 auto-follow patterns selected + expect(find('ccrAutoFollowPatternListBulkDeleteActionButton').text()).toEqual('Delete auto-follow patterns'); + }); + + test('should open a confirmation modal when clicking the delete button', () => { + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(false); + + selectAutoFollowPatternAt(0); + clickBulkDeleteButton(); + + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(true); + }); + + test('should remove the auto-follow pattern from the table after delete is complete', async () => { + // Make sure that we have our 2 auto-follow patterns in the table + expect(rows.length).toBe(2); + + // We wil delete the *first* auto-follow pattern in the table + updateHttpMockResponse('deleteAutoFollowPattern', { itemsDeleted: [autoFollowPattern1.name] }); + + selectAutoFollowPatternAt(0); + clickBulkDeleteButton(); + clickConfirmModalDeleteAutoFollowPattern(); + + await nextTick(); + component.update(); + + ({ rows } = getMetadataFromEuiTable('ccrAutoFollowPatternListTable')); + + expect(rows.length).toBe(1); + expect(rows[0].columns[1].value).toEqual(autoFollowPattern2.name); + }); + }); + + describe('table row actions', () => { + test('should have a "delete" and an "edit" action button on each row', () => { + const indexLastColumn = rows[0].columns.length - 1; + const tableCellActions = rows[0].columns[indexLastColumn].reactWrapper; + + const deleteButton = findTestSubject(tableCellActions, 'ccrAutoFollowPatternListDeleteActionButton'); + const editButton = findTestSubject(tableCellActions, 'ccrAutoFollowPatternListEditActionButton'); + + expect(deleteButton.length).toBe(1); + expect(editButton.length).toBe(1); + }); + + test('should open a confirmation modal when clicking on "delete" button', async () => { + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(false); + + clickRowActionButtonAt(0, 'delete'); + + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(true); + }); + }); + + describe('detail panel', () => { + test('should open a detail panel when clicking on a follower index', () => { + expect(exists('ccrAutoFollowPatternDetailsFlyout')).toBe(false); + + clickAutoFollowPatternAt(0); + + expect(exists('ccrAutoFollowPatternDetailsFlyout')).toBe(true); + }); + + test('should set the title the index that has been selected', () => { + clickAutoFollowPatternAt(0); // Open the detail panel + expect(find('autoFollowPatternDetailsFlyoutTitle').text()).toEqual(autoFollowPattern1.name); + }); + + test('should have a "settings" section', () => { + clickAutoFollowPatternAt(0); + expect(find('ccrAutoFollowPatternDetailPanelSettingsSection').find('h3').text()).toEqual('Settings'); + expect(exists('ccrAutoFollowPatternDetailPanelSettingsValues')).toBe(true); + }); + + test('should set the correct follower index settings values', () => { + clickAutoFollowPatternAt(0); + + expect(find('ccrAutoFollowPatternDetailRemoteCluster').text()).toEqual(autoFollowPattern1.remoteCluster); + expect(find('ccrAutoFollowPatternDetailLeaderIndexPatterns').text()).toEqual(autoFollowPattern1.leaderIndexPatterns.join(', ')); + expect(find('ccrAutoFollowPatternDetailPatternPrefix').text()).toEqual(testPrefix); + expect(find('ccrAutoFollowPatternDetailPatternSuffix').text()).toEqual(testSuffix); + }); + + test('should have a default value when there are no prefix or no suffix', () => { + clickAutoFollowPatternAt(1); // Does not have prefix and suffix + + expect(find('ccrAutoFollowPatternDetailPatternPrefix').text()).toEqual('No prefix'); + expect(find('ccrAutoFollowPatternDetailPatternSuffix').text()).toEqual('No suffix'); + }); + + test('should show a preview of the indices that might be generated by the auto-follow pattern', () => { + clickAutoFollowPatternAt(0); + const detailPanel = find('ccrAutoFollowPatternDetailsFlyout'); + const indicesPreview = findTestSubject(detailPanel, 'ccrAutoFollowPatternIndexPreview'); + + expect(exists('ccrAutoFollowPatternDetailPanelIndicesPreviewSection')).toBe(true); + expect(indicesPreview.length).toBe(3); + }); + + test('should have a link to view the indices in Index Management', () => { + clickAutoFollowPatternAt(0); + expect(exists('ccrAutoFollowPatternDetailsViewIndexManagementButton')).toBe(true); + expect(find('ccrAutoFollowPatternDetailsViewIndexManagementButton').text()).toBe('View your follower indices in Index Management'); + }); + + test('should have a "close", "delete" and "edit" button in the footer', () => { + clickAutoFollowPatternAt(0); + expect(exists('ccrAutoFollowPatternDetailsFlyoutCloseButton')).toBe(true); + expect(exists('ccrAutoFollowPatternDetailsDeleteActionButton')).toBe(true); + expect(exists('ccrAutoFollowPatternDetailsEditActionButton')).toBe(true); + }); + + test('should close the detail panel when clicking the "close" button', () => { + clickAutoFollowPatternAt(0); // open the detail panel + expect(exists('ccrAutoFollowPatternDetailsFlyout')).toBe(true); + + find('ccrAutoFollowPatternDetailsFlyoutCloseButton').simulate('click'); // close the detail panel + + expect(exists('ccrAutoFollowPatternDetailsFlyout')).toBe(false); + }); + + test('should open a confirmation modal when clicking the "delete" button', () => { + clickAutoFollowPatternAt(0); + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(false); + + find('ccrAutoFollowPatternDetailsDeleteActionButton').simulate('click'); + + expect(exists('ccrAutoFollowPatternDeleteConfirmationModal')).toBe(true); + }); + + test('should display the recent errors', async () => { + const message = 'bar'; + const recentAutoFollowErrors = [{ + leaderIndex: `${autoFollowPattern1.name}:my-leader-test`, + autoFollowException: { type: 'exception', reason: message } + }, { + leaderIndex: `${autoFollowPattern2.name}:my-leader-test`, + autoFollowException: { type: 'exception', reason: message } + }]; + updateHttpMockResponse('autoFollowStats', { recentAutoFollowErrors }); + + clickAutoFollowPatternAt(0); + expect(exists('ccrAutoFollowPatternDetailErrors')).toBe(false); + + // We select the other auto-follow pattern because the stats are fetched + // each time we change the auto-follow pattern selection + clickAutoFollowPatternAt(1); + await nextTick(); + component.update(); + + expect(exists('ccrAutoFollowPatternDetailErrors')).toBe(true); + expect(exists('ccrAutoFollowPatternDetailsTitleErrors')).toBe(true); + expect(find('ccrAutoFollowPatternDetailRecentError').map(error => error.text())).toEqual([message]); + }); + }); + }); +}); diff --git a/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/follower_indices_list.test.js b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/follower_indices_list.test.js new file mode 100644 index 000000000000..eb30e796cbae --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/follower_indices_list.test.js @@ -0,0 +1,343 @@ +/* + * 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 sinon from 'sinon'; + +import { initTestBed, mockAllHttpRequests, nextTick, getRandomString } from './test_helpers'; +import { FollowerIndicesList } from '../../public/app/sections/home/follower_indices_list'; +import { getFollowerIndexMock } from '../../fixtures/follower_index'; + +jest.mock('ui/chrome', () => ({ + addBasePath: () => 'api/cross_cluster_replication', + breadcrumbs: { set: () => {} }, +})); + +jest.mock('ui/index_patterns', () => { + const { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE } = require.requireActual('../../../../../src/legacy/ui/public/index_patterns/constants'); // eslint-disable-line max-len + return { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE }; +}); + +describe('', () => { + let server; + let find; + let exists; + let component; + let getMetadataFromEuiTable; + let getUserActions; + let tableCellsValues; + let updateHttpMockResponse; + + beforeEach(() => { + server = sinon.fakeServer.create(); + server.respondImmediately = true; + (updateHttpMockResponse = mockAllHttpRequests(server)); + }); + + describe('on component mount', () => { + beforeEach(async () => { + ({ exists } = initTestBed(FollowerIndicesList)); + }); + + test('should show a loading indicator on component', async () => { + expect(exists('ccrFollowerIndexLoading')).toBe(true); + }); + }); + + describe('when there are no follower indices', () => { + beforeEach(async () => { + ({ exists, component } = initTestBed(FollowerIndicesList)); + + await nextTick(); // We need to wait next tick for the mock server response to comes in + component.update(); + }); + + test('should display an empty prompt', async () => { + expect(exists('ccrFollowerIndexEmptyPrompt')).toBe(true); + }); + + test('should have a button to create a follower index', async () => { + expect(exists('ccrFollowerIndexEmptyPromptCreateButton')).toBe(true); + }); + }); + + describe('when there are follower indices', async () => { + // For deterministic tests, we need to make sure that index1 comes before index2 + // in the table list that is rendered. As the table orders alphabetically by index name + // we prefix the random name to make sure that index1 name comes before index2. + const index1 = getFollowerIndexMock({ name: `a${getRandomString()}` }); + const index2 = getFollowerIndexMock({ name: `b${getRandomString()}`, status: 'paused' }); + + const followerIndices = [index1, index2]; + + let selectFollowerIndexAt; + let openContextMenu; + let openTableRowContextMenuAt; + let clickContextMenuButtonAt; + let clickFollowerIndexAt; + + beforeEach(async () => { + updateHttpMockResponse('loadFollowerIndices', { indices: followerIndices }); + + // Mount the component + ({ + find, + exists, + component, + getMetadataFromEuiTable, + getUserActions, + } = initTestBed(FollowerIndicesList)); + + await nextTick(); // Make sure that the Http request is fulfilled + component.update(); + + ({ + selectFollowerIndexAt, + openContextMenu, + openTableRowContextMenuAt, + clickContextMenuButtonAt, + clickFollowerIndexAt, + } = getUserActions('followerIndicesList')); + + // Read the index list table + ({ tableCellsValues } = getMetadataFromEuiTable('ccrFollowerIndexListTable')); + }); + + afterEach(async () => { + // The updates are not all synchronouse + // We need to wait for all the updates to ran before unmounting our component + await nextTick(100); + }); + + test('should not display the empty prompt', () => { + expect(exists('ccrFollowerIndexEmptyPrompt')).toBe(false); + }); + + test('should have a button to create a follower index', () => { + expect(exists('ccrCreateFollowerIndexButton')).toBe(true); + }); + + test('should list the follower indices in the table', () => { + expect(tableCellsValues.length).toEqual(followerIndices.length); + expect(tableCellsValues).toEqual([ + [ '', // Empty because the first column is the checkbox to select row + index1.name, + 'Active', + index1.remoteCluster, + index1.leaderIndex, + '' // Empty because the last column is for the "actions" on the resource + ], [ '', + index2.name, + 'Paused', + index2.remoteCluster, + index2.leaderIndex, + '' ] + ]); + }); + + describe('action menu', () => { + test('should be visible when a follower index is selected', () => { + expect(exists('ccrFollowerIndexListContextMenuButton')).toBe(false); + + selectFollowerIndexAt(0); + + expect(exists('ccrFollowerIndexListContextMenuButton')).toBe(true); + }); + + test('should have a "pause", "edit" and "unfollow" action when the follower index is active', async () => { + selectFollowerIndexAt(0); + openContextMenu(); + + const contextMenu = find('followerIndexActionContextMenu'); + + expect(contextMenu.length).toBeTruthy(); + const contextMenuButtons = contextMenu.find('button'); + const buttonsLabel = contextMenuButtons.map(btn => btn.text()); + + expect(buttonsLabel).toEqual([ + 'Pause replication', + 'Edit follower index', + 'Unfollow leader index' + ]); + }); + + test('should have a "resume", "edit" and "unfollow" action when the follower index is active', async () => { + selectFollowerIndexAt(1); // Select the second follower that is "paused" + openContextMenu(); + + const contextMenu = find('followerIndexActionContextMenu'); + + const contextMenuButtons = contextMenu.find('button'); + const buttonsLabel = contextMenuButtons.map(btn => btn.text()); + expect(buttonsLabel).toEqual([ + 'Resume replication', + 'Edit follower index', + 'Unfollow leader index' + ]); + }); + + test('should open a confirmation modal when clicking on "pause replication"', () => { + expect(exists('ccrFollowerIndexPauseReplicationConfirmationModal')).toBe(false); + + selectFollowerIndexAt(0); + openContextMenu(); + clickContextMenuButtonAt(0); // first button is the "pause" action + + expect(exists('ccrFollowerIndexPauseReplicationConfirmationModal')).toBe(true); + }); + + test('should open a confirmation modal when clicking on "unfollow leader index"', () => { + expect(exists('ccrFollowerIndexUnfollowLeaderConfirmationModal')).toBe(false); + + selectFollowerIndexAt(0); + openContextMenu(); + clickContextMenuButtonAt(2); // third button is the "unfollow" action + + expect(exists('ccrFollowerIndexUnfollowLeaderConfirmationModal')).toBe(true); + }); + }); + + describe('table row action menu', () => { + test('should open a context menu when clicking on the button of each row', async () => { + expect(component.find('.euiContextMenuPanel').length).toBe(0); + + openTableRowContextMenuAt(0); + + expect(component.find('.euiContextMenuPanel').length).toBe(1); + }); + + test('should have the "pause", "edit" and "unfollow" options in the row context menu', async () => { + openTableRowContextMenuAt(0); + + const buttonLabels = component + .find('.euiContextMenuPanel') + .find('.euiContextMenuItem') + .map(button => button.text()); + + expect(buttonLabels).toEqual([ + 'Pause replication', + 'Edit follower index', + 'Unfollow leader index' + ]); + }); + + test('should have the "resume", "edit" and "unfollow" options in the row context menu', async () => { + // We open the context menu of the second row (index 1) as followerIndices[1].status is "paused" + openTableRowContextMenuAt(1); + + const buttonLabels = component + .find('.euiContextMenuPanel') + .find('.euiContextMenuItem') + .map(button => button.text()); + + expect(buttonLabels).toEqual([ + 'Resume replication', + 'Edit follower index', + 'Unfollow leader index' + ]); + }); + + test('should open a confirmation modal when clicking on "pause replication"', async () => { + expect(exists('ccrFollowerIndexPauseReplicationConfirmationModal')).toBe(false); + + openTableRowContextMenuAt(0); + find('ccrFollowerIndexListPauseActionButton').simulate('click'); + + expect(exists('ccrFollowerIndexPauseReplicationConfirmationModal')).toBe(true); + }); + + test('should open a confirmation modal when clicking on "resume"', async () => { + expect(exists('ccrFollowerIndexResumeReplicationConfirmationModal')).toBe(false); + + openTableRowContextMenuAt(1); // open the second row context menu, as it is a "paused" follower index + find('ccrFollowerIndexListResumeActionButton').simulate('click'); + + expect(exists('ccrFollowerIndexResumeReplicationConfirmationModal')).toBe(true); + }); + + test('should open a confirmation modal when clicking on "unfollow leader index"', () => { + expect(exists('ccrFollowerIndexUnfollowLeaderConfirmationModal')).toBe(false); + + openTableRowContextMenuAt(0); + find('ccrFollowerIndexListUnfollowActionButton').simulate('click'); + + expect(exists('ccrFollowerIndexUnfollowLeaderConfirmationModal')).toBe(true); + }); + }); + + describe('detail panel', () => { + test('should open a detail panel when clicking on a follower index', () => { + expect(exists('ccrFollowerIndexDetailsFlyout')).toBe(false); + + clickFollowerIndexAt(0); + + expect(exists('ccrFollowerIndexDetailsFlyout')).toBe(true); + }); + + test('should set the title the index that has been selected', () => { + clickFollowerIndexAt(0); // Open the detail panel + expect(find('followerIndexDetailsFlyoutTitle').text()).toEqual(index1.name); + }); + + test('should have a "settings" section', () => { + clickFollowerIndexAt(0); + expect(find('ccrFollowerIndexDetailPanelSettingsSection').find('h3').text()).toEqual('Settings'); + expect(exists('ccrFollowerIndexDetailPanelSettingsValues')).toBe(true); + }); + + test('should set the correct follower index settings values', () => { + const mapSettingsToFollowerIndexProp = { + 'Status': 'status', + 'RemoteCluster': 'remoteCluster', + 'LeaderIndex': 'leaderIndex', + 'MaxReadReqOpCount': 'maxReadRequestOperationCount', + 'MaxOutstandingReadReq': 'maxOutstandingReadRequests', + 'MaxReadReqSize': 'maxReadRequestSize', + 'MaxWriteReqOpCount': 'maxWriteRequestOperationCount', + 'MaxWriteReqSize': 'maxWriteRequestSize', + 'MaxOutstandingWriteReq': 'maxOutstandingWriteRequests', + 'MaxWriteBufferCount': 'maxWriteBufferCount', + 'MaxWriteBufferSize': 'maxWriteBufferSize', + 'MaxRetryDelay': 'maxRetryDelay', + 'ReadPollTimeout': 'readPollTimeout' + }; + + clickFollowerIndexAt(0); + + Object.entries(mapSettingsToFollowerIndexProp).forEach(([setting, prop]) => { + const wrapper = find(`ccrFollowerIndexDetail${setting}`); + + if (!wrapper.length) { + throw new Error(`Could not find description for setting "${setting}"`); + } + + expect(wrapper.text()).toEqual(index1[prop].toString()); + }); + }); + + test('should not have settings values for a "paused" follower index', () => { + clickFollowerIndexAt(1); // the second follower index is paused + expect(exists('ccrFollowerIndexDetailPanelSettingsValues')).toBe(false); + expect(find('ccrFollowerIndexDetailPanelSettingsSection').text()).toContain('paused follower index does not have settings'); + }); + + test('should have a section to render the follower index shards stats', () => { + clickFollowerIndexAt(0); + expect(exists('ccrFollowerIndexDetailPanelShardsStatsSection')).toBe(true); + }); + + test('should render a EuiCodeEditor for each shards stats', () => { + clickFollowerIndexAt(0); + + const codeEditors = component.find(`EuiCodeEditor`); + + expect(codeEditors.length).toBe(index1.shards.length); + codeEditors.forEach((codeEditor, i) => { + expect(JSON.parse(codeEditor.props().value)).toEqual(index1.shards[i]); + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/home.test.js b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/home.test.js new file mode 100644 index 000000000000..5d09018a2bbd --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/home.test.js @@ -0,0 +1,84 @@ +/* + * 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 sinon from 'sinon'; + +import { initTestBed, mockAllHttpRequests, nextTick } from './test_helpers'; +import { CrossClusterReplicationHome } from '../../public/app/sections/home/home'; +import { BASE_PATH } from '../../common/constants'; +import routing from '../../public/app/services/routing'; + +jest.mock('ui/chrome', () => ({ + addBasePath: () => 'api/cross_cluster_replication', + breadcrumbs: { set: () => {} }, +})); + +jest.mock('ui/index_patterns', () => { + const { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE } = require.requireActual('../../../../../src/legacy/ui/public/index_patterns/constants'); // eslint-disable-line max-len + return { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE }; +}); + +const testBedOptions = { + memoryRouter: { + initialEntries: [`${BASE_PATH}/follower_indices`], + componentRoutePath: `${BASE_PATH}/:section`, + onRouter: (router) => routing.reactRouter = router + } +}; + +describe('', () => { + let server; + let find; + let exists; + let component; + + beforeEach(() => { + server = sinon.fakeServer.create(); + server.respondImmediately = true; + mockAllHttpRequests(server); + }); + + describe('on component mount', () => { + beforeEach(async () => { + ({ exists, find, component } = initTestBed(CrossClusterReplicationHome, undefined, testBedOptions)); + }); + + test('should set the correct an app title', () => { + expect(exists('ccrAppTitle')).toBe(true); + expect(find('ccrAppTitle').text()).toEqual('Cross Cluster Replication'); + }); + + test('should have 2 tabs to switch between "Follower indices" & "Auto-follow patterns"', () => { + expect(exists('ccrFollowerIndicesTab')).toBe(true); + expect(find('ccrFollowerIndicesTab').text()).toEqual('Follower indices'); + + expect(exists('ccrAutoFollowPatternsTab')).toBe(true); + expect(find('ccrAutoFollowPatternsTab').text()).toEqual('Auto-follow patterns'); + }); + + test('should set the default selected tab to "Follower indices"', () => { + expect(component.find('.euiTab-isSelected').text()).toBe('Follower indices'); + + // Verify that the component is rendered + expect(component.find('FollowerIndicesList').length).toBe(1); + }); + }); + + describe('section change', () => { + test('should change to auto-follow pattern', async () => { + const autoFollowPatternsTab = find('ccrAutoFollowPatternsTab'); + + autoFollowPatternsTab.simulate('click'); + await nextTick(); + component.update(); + + expect(component.find('.euiTab-isSelected').text()).toBe('Auto-follow patterns'); + + // Verify that the component is rendered + expect(component.find('AutoFollowPatternList').length).toBe(1); + }); + }); +}); diff --git a/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/test_helpers.js b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/test_helpers.js new file mode 100644 index 000000000000..2bd747977c11 --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/__jest__/client_integration/test_helpers.js @@ -0,0 +1,212 @@ +/* + * 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 axios from 'axios'; + +import { registerTestBed, findTestSubject } from '../../../../test_utils'; +import { ccrStore } from '../../public/app/store'; +import { setHttpClient } from '../../public/app/services/api'; +import routing from '../../public/app/services/routing'; + +// Mock React router +const reactRouter = { + history: { + push: () => {}, + createHref: (location) => location.pathname, + location: '' + } +}; + +routing.reactRouter = reactRouter; +// Mock Angular $q +const $q = { defer: () => ({ resolve() {} }) }; +// axios has a $http like interface so using it to simulate $http +setHttpClient(axios.create(), $q); + +const initUserActions = ({ getMetadataFromEuiTable, find }) => (section) => { + const userActions = { + // Follower indices user actions + followerIndicesList() { + const { rows } = getMetadataFromEuiTable('ccrFollowerIndexListTable'); + + const selectFollowerIndexAt = (index = 0) => { + const row = rows[index]; + const checkBox = row.reactWrapper.find('input').hostNodes(); + checkBox.simulate('change', { target: { checked: true } }); + }; + + const openContextMenu = () => { + find('ccrFollowerIndexListContextMenuButton').simulate('click'); + }; + + const clickContextMenuButtonAt = (index = 0) => { + const contextMenu = find('followerIndexActionContextMenu'); + contextMenu.find('button').at(index).simulate('click'); + }; + + const openTableRowContextMenuAt = (index = 0) => { + const actionsColumnIndex = rows[0].columns.length - 1; // Actions are in the last column + const actionsTableCell = rows[index].columns[actionsColumnIndex]; + const button = actionsTableCell.reactWrapper.find('button'); + if (!button.length) { + throw new Error(`No button to open context menu were found on Follower index list table row ${index}`); + } + button.simulate('click'); + }; + + const clickFollowerIndexAt = (index = 0) => { + const followerIndexLink = findTestSubject(rows[index].reactWrapper, 'ccrFollowerIndexListFollowerIndexLink'); + followerIndexLink.simulate('click'); + }; + + return { + selectFollowerIndexAt, + openContextMenu, + clickContextMenuButtonAt, + openTableRowContextMenuAt, + clickFollowerIndexAt, + }; + }, + // Auto-follow patterns user actions + autoFollowPatternList() { + const { rows } = getMetadataFromEuiTable('ccrAutoFollowPatternListTable'); + + const selectAutoFollowPatternAt = (index = 0) => { + const row = rows[index]; + const checkBox = row.reactWrapper.find('input').hostNodes(); + checkBox.simulate('change', { target: { checked: true } }); + }; + + const clickBulkDeleteButton = () => { + find('ccrAutoFollowPatternListBulkDeleteActionButton').simulate('click'); + }; + + const clickConfirmModalDeleteAutoFollowPattern = () => { + const modal = find('ccrAutoFollowPatternDeleteConfirmationModal'); + findTestSubject(modal, 'confirmModalConfirmButton').simulate('click'); + }; + + const clickRowActionButtonAt = (index = 0, action = 'delete') => { + const indexLastColumn = rows[index].columns.length - 1; + const tableCellActions = rows[index].columns[indexLastColumn].reactWrapper; + + let button; + if (action === 'delete') { + button = findTestSubject(tableCellActions, 'ccrAutoFollowPatternListDeleteActionButton'); + } else if (action === 'edit') { + findTestSubject(tableCellActions, 'ccrAutoFollowPatternListEditActionButton'); + } + + if (!button) { + throw new Error(`Button for action "${action}" not found.`); + } + + button.simulate('click'); + }; + + const clickAutoFollowPatternAt = (index = 0) => { + const autoFollowPatternLink = findTestSubject(rows[index].reactWrapper, 'ccrAutoFollowPatternListPatternLink'); + autoFollowPatternLink.simulate('click'); + }; + + return { + selectAutoFollowPatternAt, + clickBulkDeleteButton, + clickConfirmModalDeleteAutoFollowPattern, + clickRowActionButtonAt, + clickAutoFollowPatternAt + }; + } + }; + + return userActions[section](); +}; + +export { nextTick, getRandomString, findTestSubject } from '../../../../test_utils'; + +export const initTestBed = (component, props = {}, options) => { + const testBed = registerTestBed(component, {}, ccrStore)(props, options); + const getUserActions = initUserActions(testBed); + + return { + ...testBed, + getUserActions, + }; +}; + +export const mockAllHttpRequests = server => { + const mockResponse = (defaultResponse, response) => ([ + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ ...defaultResponse, ...response }), + ]); + + const setLoadFollowerIndicesResponse = (response) => { + const defaultResponse = { indices: [] }; + + server.respondWith('GET', 'api/cross_cluster_replication/follower_indices', + mockResponse(defaultResponse, response)); + }; + + const setLoadAutoFollowPatternsResponse = (response) => { + const defaultResponse = { patterns: [] }; + + server.respondWith('GET', 'api/cross_cluster_replication/auto_follow_patterns', + mockResponse(defaultResponse, response) + ); + }; + + const setDeleteAutoFollowPatternResponse = (response) => { + const defaultResponse = { errors: [], itemsDeleted: [] }; + + server.respondWith('DELETE', /api\/cross_cluster_replication\/auto_follow_patterns/, + mockResponse(defaultResponse, response) + ); + }; + + const setAutoFollowStatsResponse = (response) => { + const defaultResponse = { + numberOfFailedFollowIndices: 0, + numberOfFailedRemoteClusterStateRequests: 0, + numberOfSuccessfulFollowIndices: 0, + recentAutoFollowErrors: [], + autoFollowedClusters: [{ + clusterName: 'new-york', + timeSinceLastCheckMillis: 13746, + lastSeenMetadataVersion: 22 + }] + }; + + server.respondWith('GET', 'api/cross_cluster_replication/stats/auto_follow', + mockResponse(defaultResponse, response) + ); + }; + + /** + * Set all http request to their default response + */ + setLoadFollowerIndicesResponse(); + setLoadAutoFollowPatternsResponse(); + setAutoFollowStatsResponse(); + + /** + * Return a method to override any of the http reques + */ + return (request, response) => { + const mapRequestToHelper = { + 'loadFollowerIndices': setLoadFollowerIndicesResponse, + 'loadAutoFollowPatterns': setLoadAutoFollowPatternsResponse, + 'deleteAutoFollowPattern': setDeleteAutoFollowPatternResponse, + 'autoFollowStats': setAutoFollowStatsResponse, + }; + + if (!mapRequestToHelper[request]) { + throw new Error(`Did not find a helper to set http response for request ${request}`); + } + + return mapRequestToHelper[request](response); + }; +}; diff --git a/x-pack/plugins/cross_cluster_replication/fixtures/auto_follow_pattern.js b/x-pack/plugins/cross_cluster_replication/fixtures/auto_follow_pattern.js index 187b91b66ea7..cfedad5c1c07 100644 --- a/x-pack/plugins/cross_cluster_replication/fixtures/auto_follow_pattern.js +++ b/x-pack/plugins/cross_cluster_replication/fixtures/auto_follow_pattern.js @@ -4,14 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -const Chance = require('chance'); // eslint-disable-line import/no-extraneous-dependencies -const chance = new Chance(); +import { getRandomString } from '../../../test_utils'; export const getAutoFollowPatternMock = ( - name = chance.string(), - remoteCluster = chance.string(), - leaderIndexPatterns = [chance.string()], - followIndexPattern = chance.string() + name = getRandomString(), + remoteCluster = getRandomString(), + leaderIndexPatterns = [getRandomString()], + followIndexPattern = getRandomString() ) => ({ name, pattern: { @@ -33,3 +32,18 @@ export const getAutoFollowPatternListMock = (total = 3) => { return list; }; + +// ----------------- +// Client test mock +// ----------------- +export const getAutoFollowPatternClientMock = ({ + name = getRandomString(), + remoteCluster = getRandomString(), + leaderIndexPatterns = [`${getRandomString()}-*`], + followIndexPattern = getRandomString() +}) => ({ + name, + remoteCluster, + leaderIndexPatterns, + followIndexPattern, +}); diff --git a/x-pack/plugins/cross_cluster_replication/fixtures/follower_index.js b/x-pack/plugins/cross_cluster_replication/fixtures/follower_index.js index ef888f8929a2..e873c1a394f4 100644 --- a/x-pack/plugins/cross_cluster_replication/fixtures/follower_index.js +++ b/x-pack/plugins/cross_cluster_replication/fixtures/follower_index.js @@ -6,6 +6,63 @@ const Chance = require('chance'); // eslint-disable-line import/no-extraneous-dependencies const chance = new Chance(); +import { getRandomString } from '../../../test_utils'; + +const serializeShard = ({ + id, + remoteCluster, + leaderIndex, + leaderGlobalCheckpoint, + leaderMaxSequenceNum, + followerGlobalCheckpoint, + followerMaxSequenceNum, + lastRequestedSequenceNum, + outstandingReadRequestsCount, + outstandingWriteRequestsCount, + writeBufferOperationsCount, + writeBufferSizeBytes, + followerMappingVersion, + followerSettingsVersion, + totalReadTimeMs, + totalReadRemoteExecTimeMs, + successfulReadRequestCount, + failedReadRequestsCount, + operationsReadCount, + bytesReadCount, + totalWriteTimeMs, + successfulWriteRequestsCount, + failedWriteRequestsCount, + operationsWrittenCount, + readExceptions, + timeSinceLastReadMs, +}) => ({ + shard_id: id, + remote_cluster: remoteCluster, + leader_index: leaderIndex, + leader_global_checkpoint: leaderGlobalCheckpoint, + leader_max_seq_no: leaderMaxSequenceNum, + follower_global_checkpoint: followerGlobalCheckpoint, + follower_max_seq_no: followerMaxSequenceNum, + last_requested_seq_no: lastRequestedSequenceNum, + outstanding_read_requests: outstandingReadRequestsCount, + outstanding_write_requests: outstandingWriteRequestsCount, + write_buffer_operation_count: writeBufferOperationsCount, + write_buffer_size_in_bytes: writeBufferSizeBytes, + follower_mapping_version: followerMappingVersion, + follower_settings_version: followerSettingsVersion, + total_read_time_millis: totalReadTimeMs, + total_read_remote_exec_time_millis: totalReadRemoteExecTimeMs, + successful_read_requests: successfulReadRequestCount, + failed_read_requests: failedReadRequestsCount, + operations_read: operationsReadCount, + bytes_read: bytesReadCount, + total_write_time_millis: totalWriteTimeMs, + successful_write_requests: successfulWriteRequestsCount, + failed_write_requests: failedWriteRequestsCount, + operations_written: operationsWrittenCount, + read_exceptions: readExceptions, + time_since_last_read_millis: timeSinceLastReadMs, +}); export const getFollowerIndexStatsMock = ( name = chance.string(), @@ -37,68 +94,10 @@ export const getFollowerIndexStatsMock = ( readExceptions: [ chance.string() ], timeSinceLastReadMs: chance.integer(), }] -) => { - const serializeShard = ({ - id, - remoteCluster, - leaderIndex, - leaderGlobalCheckpoint, - leaderMaxSequenceNum, - followerGlobalCheckpoint, - followerMaxSequenceNum, - lastRequestedSequenceNum, - outstandingReadRequestsCount, - outstandingWriteRequestsCount, - writeBufferOperationsCount, - writeBufferSizeBytes, - followerMappingVersion, - followerSettingsVersion, - totalReadTimeMs, - totalReadRemoteExecTimeMs, - successfulReadRequestCount, - failedReadRequestsCount, - operationsReadCount, - bytesReadCount, - totalWriteTimeMs, - successfulWriteRequestsCount, - failedWriteRequestsCount, - operationsWrittenCount, - readExceptions, - timeSinceLastReadMs, - }) => ({ - shard_id: id, - remote_cluster: remoteCluster, - leader_index: leaderIndex, - leader_global_checkpoint: leaderGlobalCheckpoint, - leader_max_seq_no: leaderMaxSequenceNum, - follower_global_checkpoint: followerGlobalCheckpoint, - follower_max_seq_no: followerMaxSequenceNum, - last_requested_seq_no: lastRequestedSequenceNum, - outstanding_read_requests: outstandingReadRequestsCount, - outstanding_write_requests: outstandingWriteRequestsCount, - write_buffer_operation_count: writeBufferOperationsCount, - write_buffer_size_in_bytes: writeBufferSizeBytes, - follower_mapping_version: followerMappingVersion, - follower_settings_version: followerSettingsVersion, - total_read_time_millis: totalReadTimeMs, - total_read_remote_exec_time_millis: totalReadRemoteExecTimeMs, - successful_read_requests: successfulReadRequestCount, - failed_read_requests: failedReadRequestsCount, - operations_read: operationsReadCount, - bytes_read: bytesReadCount, - total_write_time_millis: totalWriteTimeMs, - successful_write_requests: successfulWriteRequestsCount, - failed_write_requests: failedWriteRequestsCount, - operations_written: operationsWrittenCount, - read_exceptions: readExceptions, - time_since_last_read_millis: timeSinceLastReadMs, - }); - - return { - index: name, - shards: shards.map(serializeShard), - }; -}; +) => ({ + index: name, + shards: shards.map(serializeShard), +}); export const getFollowerIndexListStatsMock = (total = 3, names) => { const list = { @@ -157,3 +156,57 @@ export const getFollowerIndexListInfoMock = (total = 3) => { return list; }; + +// ----------------- +// Client test mock +// ----------------- + +export const getFollowerIndexMock = ({ + name = getRandomString(), + remoteCluster = getRandomString(), + leaderIndex = getRandomString(), + status = 'Active' +} = {}) => ({ + name, + remoteCluster, + leaderIndex, + status, + maxReadRequestOperationCount: chance.integer(), + maxOutstandingReadRequests: chance.integer(), + maxReadRequestSize: getRandomString({ length: 5 }), + maxWriteRequestOperationCount: chance.integer(), + maxWriteRequestSize: '9223372036854775807b', + maxOutstandingWriteRequests: chance.integer(), + maxWriteBufferCount: chance.integer(), + maxWriteBufferSize: getRandomString({ length: 5 }), + maxRetryDelay: getRandomString({ length: 5 }), + readPollTimeout: getRandomString({ length: 5 }), + shards: [{ + id: 0, + remoteCluster: remoteCluster, + leaderIndex: leaderIndex, + leaderGlobalCheckpoint: chance.integer(), + leaderMaxSequenceNum: chance.integer(), + followerGlobalCheckpoint: chance.integer(), + followerMaxSequenceNum: chance.integer(), + lastRequestedSequenceNum: chance.integer(), + outstandingReadRequestsCount: chance.integer(), + outstandingWriteRequestsCount: chance.integer(), + writeBufferOperationsCount: chance.integer(), + writeBufferSizeBytes: chance.integer(), + followerMappingVersion: chance.integer(), + followerSettingsVersion: chance.integer(), + totalReadTimeMs: chance.integer(), + totalReadRemoteExecTimeMs: chance.integer(), + successfulReadRequestCount: chance.integer(), + failedReadRequestsCount: chance.integer(), + operationsReadCount: chance.integer(), + bytesReadCount: chance.integer(), + totalWriteTimeMs: chance.integer(), + successfulWriteRequestsCount: chance.integer(), + failedWriteRequestsCount: chance.integer(), + operationsWrittenCount: chance.integer(), + readExceptions: [], + timeSinceLastReadMs: chance.integer(), + }] +}); diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js index e48347a17112..9c617446b28a 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js @@ -87,6 +87,7 @@ class AutoFollowPatternDeleteProviderUi extends PureComponent { ) } onMouseOver={this.onMouseOverModal} + data-test-subj="ccrAutoFollowPatternDeleteConfirmationModal" > {!isSingle && ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js index 3e41cb9bdcef..c76c13c44d51 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js @@ -36,7 +36,7 @@ export const AutoFollowPatternIndicesPreview = ({ prefix, suffix, leaderIndexPat />
    {indicesPreview.map(({ followPattern: { prefix, suffix, template } }, i) => ( -
  • +
  • {prefix}{template}{suffix}
  • ))} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_pause_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_pause_provider.js index 3beb0353b4e3..77a887c9792e 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_pause_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_pause_provider.js @@ -81,6 +81,7 @@ class FollowerIndexPauseProviderUi extends PureComponent { defaultMessage: 'Pause replication', })} onMouseOver={this.onMouseOverModal} + data-test-subj="ccrFollowerIndexPauseReplicationConfirmationModal" > {hasCustomSettings && (

    diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_resume_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_resume_provider.js index fd9a530f752d..0570040bd366 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_resume_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_resume_provider.js @@ -94,6 +94,7 @@ class FollowerIndexResumeProviderUi extends PureComponent { ) } onMouseOver={this.onMouseOverModal} + data-test-subj="ccrFollowerIndexResumeReplicationConfirmationModal" > {isSingle ? (

    diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_unfollow_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_unfollow_provider.js index 07d69cee659c..d509db1247f4 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_unfollow_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_unfollow_provider.js @@ -92,6 +92,7 @@ class FollowerIndexUnfollowProviderUi extends PureComponent { ) } onMouseOver={this.onMouseOverModal} + data-test-subj="ccrFollowerIndexUnfollowLeaderConfirmationModal" > {isSingle ? ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/section_error.js b/x-pack/plugins/cross_cluster_replication/public/app/components/section_error.js index 4e4abfa571c7..4988449802b5 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/section_error.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/section_error.js @@ -11,11 +11,12 @@ import { } from '@elastic/eui'; export function SectionError({ title, error }) { + const data = error.data ? error.data : error; const { error: errorString, cause, // wrapEsError() on the server add a "cause" array message, - } = error.data; + } = data; return ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js index 22b1a47ca929..b3551998070b 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js @@ -135,7 +135,7 @@ export class AutoFollowPatternList extends PureComponent { } renderContent(isEmpty) { - const { apiError, isAuthorized } = this.props; + const { apiError, apiStatus, isAuthorized } = this.props; if (!isAuthorized) { return ( @@ -172,6 +172,17 @@ export class AutoFollowPatternList extends PureComponent { return this.renderEmpty(); } + if (apiStatus === API_STATUS.LOADING) { + return ( + + + + ); + } + return this.renderList(); } @@ -211,6 +222,7 @@ export class AutoFollowPatternList extends PureComponent { /> } + data-test-subj="ccrAutoFollowPatternEmptyPrompt" /> ); } @@ -219,22 +231,10 @@ export class AutoFollowPatternList extends PureComponent { const { selectAutoFollowPattern, autoFollowPatterns, - apiStatus, } = this.props; const { isDetailPanelOpen } = this.state; - if (apiStatus === API_STATUS.LOADING) { - return ( - - - - ); - } - return ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js index f86b184c66bc..a5b46ff3e17f 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js @@ -261,6 +261,7 @@ export class AutoFollowPatternTable extends PureComponent { cellProps={(item, column) => ({ 'data-test-subj': `ccrAutoFollowPatternListTableCell-${column.field}` })} + data-test-subj="ccrAutoFollowPatternListTable" /> {this.renderLoading()} diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js index 2cfe54b2a0e0..ef014c75447f 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js @@ -4,12 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Component, Fragment } from 'react'; +import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; import { getIndexListUri } from '../../../../../../../../index_management/public/services/navigation'; - import { EuiButton, EuiButtonEmpty, @@ -24,7 +23,6 @@ import { EuiFlyoutHeader, EuiIcon, EuiLink, - EuiLoadingSpinner, EuiSpacer, EuiText, EuiTextColor, @@ -36,7 +34,6 @@ import { AutoFollowPatternDeleteProvider, } from '../../../../../components'; -import { API_STATUS } from '../../../../../constants'; import routing from '../../../../../services/routing'; export class DetailPanel extends Component { @@ -47,155 +44,154 @@ export class DetailPanel extends Component { closeDetailPanel: PropTypes.func.isRequired, } - renderAutoFollowPattern() { - const { - autoFollowPattern: { - followIndexPatternPrefix, - followIndexPatternSuffix, - remoteCluster, - leaderIndexPatterns, - }, - } = this.props; - - let indexManagementFilter; - if(followIndexPatternPrefix) { - indexManagementFilter = `name:${followIndexPatternPrefix}`; - } else if(followIndexPatternSuffix) { - indexManagementFilter = `name:${followIndexPatternSuffix}`; - } - const indexManagementUri = getIndexListUri(indexManagementFilter); - + renderAutoFollowPattern({ followIndexPatternPrefix, followIndexPatternSuffix, remoteCluster, leaderIndexPatterns }) { return ( - - - -

    - -

    - +
    + +

    + +

    +
    + + + + + + + + + + + + + + {remoteCluster} + + + + + + + + + + + + {leaderIndexPatterns.join(', ')} + + + - - - - - + + + + + + + + + + {followIndexPatternPrefix || ( + - - + + )} + + - - {remoteCluster} - - + + + + + + - - - + + {followIndexPatternSuffix || ( + - - - - - {leaderIndexPatterns.join(', ')} - - - - - - - - - - - - - - - - {followIndexPatternPrefix || ( - - - - )} - - - - - - - - - - - - {followIndexPatternSuffix || ( - - - - )} - - - - - - - - - - - - - - - - {this.renderAutoFollowPatternErrors()} - - + + )} + + + + +
    ); } - renderAutoFollowPatternErrors() { - const { autoFollowPattern } = this.props; + renderIndicesPreview(prefix, suffix, leaderIndexPatterns) { + return ( +
    + +
    + ); + } + renderAutoFollowPatternNotFound() { + return ( + + + + + + + + + + + + + + + + ); + } + + renderAutoFollowPatternErrors(autoFollowPattern) { if (!autoFollowPattern.errors.length) { return null; } return ( - +
    - +

      {autoFollowPattern.errors.map((error, i) => ( -
    • {error.autoFollowException.reason}
    • +
    • + {error.autoFollowException.reason} +
    • ))}
    - +

    ); } - renderContent() { - const { - apiStatus, - autoFollowPattern, - } = this.props; - - if (apiStatus === API_STATUS.LOADING) { - return ( - - - - - - - - - - - - - - - - ); - } + renderFlyoutBody() { + const { autoFollowPattern } = this.props; if (!autoFollowPattern) { - return ( - - - - - - - - - - - - - - - - ); + return this.renderAutoFollowPatternNotFound(); } - return this.renderAutoFollowPattern(); + const { + followIndexPatternPrefix, + followIndexPatternSuffix, + leaderIndexPatterns, + } = autoFollowPattern; + + let indexManagementFilter; + + if(followIndexPatternPrefix) { + indexManagementFilter = `name:${followIndexPatternPrefix}`; + } else if(followIndexPatternSuffix) { + indexManagementFilter = `name:${followIndexPatternSuffix}`; + } + + const indexManagementUri = getIndexListUri(indexManagementFilter); + + return ( + + {this.renderAutoFollowPattern(autoFollowPattern)} + + + + {this.renderIndicesPreview(followIndexPatternPrefix, followIndexPatternSuffix, leaderIndexPatterns)} + + + + + + + + + + {this.renderAutoFollowPatternErrors(autoFollowPattern)} + + + ); } - renderFooter() { + renderFlyoutFooter() { const { autoFollowPattern, closeDetailPanel, @@ -306,7 +295,6 @@ export class DetailPanel extends Component { flush="left" onClick={closeDetailPanel} data-test-subj="ccrAutoFollowPatternDetailsFlyoutCloseButton" - > - +

    {autoFollowPatternId}

    - {this.renderContent()} - {this.renderFooter()} + {this.renderFlyoutBody()} + {this.renderFlyoutFooter()} ); } diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js index c58595898c0a..10008e7a68fc 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js @@ -103,7 +103,7 @@ export class ContextMenu extends PureComponent { values={{ followerIndicesLength }} /> - + { activeFollowerIndices.length ? ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js index a9520f67cec5..2dac2bfc5140 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js @@ -69,99 +69,104 @@ export class DetailPanel extends Component { return ( - -

    - -

    -
    - - - - - - - - - - - - - - {isPaused ? ( - +
    + + + + + - - ) : ( - + + + + + {isPaused ? ( + + + + ) : ( + + + + )} + + + + + + + + + + - - )} - - - + + + + + {remoteCluster} + + + + + + + + + + + + {leaderIndex} + + + + +
    + + + +
    + +

    + +

    +
    - - - - - - - - - - {remoteCluster} - - - - - - - - - - - - {leaderIndex} - - - - {isPaused ? ( - - - - } - /> - + + } + /> ) : ( - - + @@ -173,7 +178,7 @@ export class DetailPanel extends Component { - + {maxReadRequestOperationCount} @@ -188,7 +193,7 @@ export class DetailPanel extends Component { - + {maxOutstandingReadRequests} @@ -207,7 +212,7 @@ export class DetailPanel extends Component { - + {maxReadRequestSize} @@ -222,7 +227,7 @@ export class DetailPanel extends Component { - + {maxWriteRequestOperationCount} @@ -241,7 +246,7 @@ export class DetailPanel extends Component { - + {maxWriteRequestSize} @@ -256,7 +261,7 @@ export class DetailPanel extends Component { - + {maxOutstandingWriteRequests} @@ -275,7 +280,7 @@ export class DetailPanel extends Component { - + {maxWriteBufferCount} @@ -290,7 +295,7 @@ export class DetailPanel extends Component { - + {maxWriteBufferSize} @@ -309,7 +314,7 @@ export class DetailPanel extends Component { - + {maxRetryDelay} @@ -324,16 +329,18 @@ export class DetailPanel extends Component { - + {readPollTimeout} - + )} +
    - + +
    {shards && shards.map((shard, i) => ( @@ -359,10 +366,11 @@ export class DetailPanel extends Component { editorProps={{ $blockScrolling: Infinity }} + data-test-subj={`ccrFollowerIndexDetailPanelShardsStats${i}`} /> ))} - +
    ); @@ -510,7 +518,11 @@ export class DetailPanel extends Component { > - +

    {followerIndexId}

    diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js index 0b387ad097e0..0f663bc71313 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js @@ -93,7 +93,7 @@ export class FollowerIndicesTable extends PureComponent { {(resumeFollowerIndex) => ( resumeFollowerIndex(name)} - data-test-subj="ccrFollowerIndexListPauseActionButton" + data-test-subj="ccrFollowerIndexListResumeActionButton" > ( pauseFollowerIndex(followerIndex)} - data-test-subj="ccrFollowerIndexListResumeActionButton" + data-test-subj="ccrFollowerIndexListPauseActionButton" > ({ 'data-test-subj': `ccrFollowerIndexListTableCell-${column.field}` })} + data-test-subj="ccrFollowerIndexListTable" /> {this.renderLoading()}
    diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js index 0990e814a718..16f6e89ec054 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js @@ -131,7 +131,7 @@ export class FollowerIndicesList extends PureComponent { } renderContent(isEmpty) { - const { apiError, isAuthorized } = this.props; + const { apiError, isAuthorized, apiStatus } = this.props; if (!isAuthorized) { return ( @@ -168,6 +168,10 @@ export class FollowerIndicesList extends PureComponent { return this.renderEmpty(); } + if (apiStatus === API_STATUS.LOADING) { + return this.renderLoading(); + } + return this.renderList(); } @@ -206,30 +210,30 @@ export class FollowerIndicesList extends PureComponent { /> } + data-test-subj="ccrFollowerIndexEmptyPrompt" /> ); } + renderLoading() { + return ( + + + + ); + } + renderList() { const { selectFollowerIndex, followerIndices, - apiStatus, } = this.props; const { isDetailPanelOpen } = this.state; - if (apiStatus === API_STATUS.LOADING) { - return ( - - - - ); - } - return ( diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js index 0252616ce4cd..b9e7f68e7761 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js @@ -69,7 +69,7 @@ export class CrossClusterReplicationHome extends PureComponent { return ( - +

    this.onSectionChange(tab.id)} isSelected={tab.id === this.state.activeSection} key={tab.id} - data-test-subject={tab.testSubj} + data-test-subj={tab.testSubj} > {tab.name} diff --git a/x-pack/plugins/rollup/__jest__/client_integration/job_create.test_helpers.js b/x-pack/plugins/rollup/__jest__/client_integration/job_create.test_helpers.js index 5cabb57f1568..01b0464aa0e0 100644 --- a/x-pack/plugins/rollup/__jest__/client_integration/job_create.test_helpers.js +++ b/x-pack/plugins/rollup/__jest__/client_integration/job_create.test_helpers.js @@ -103,7 +103,7 @@ export const initTestBed = () => { }; }; -export const nextTick = async () => new Promise((resolve) => setTimeout(resolve)); +export { nextTick } from '../../../../test_utils'; export const mockServerResponses = server => { const mockIndexPatternValidityResponse = (response) => { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js index 5aa47b47998b..8b220027a75f 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js @@ -53,24 +53,6 @@ describe('', () => { expect(component.find('JobTableUi').length).toBeTruthy(); }); - describe('route query params change', () => { - it('should call the "openDetailPanel()" prop each time the "job" query params changes', () => { - const openDetailPanel = jest.fn(); - const jobId = 'foo'; - const { setProps } = initTestBed({ openDetailPanel }); - - expect(openDetailPanel.mock.calls.length).toBe(0); - - setProps({ - history: { location: { search: `?job=${jobId}` } }, - openDetailPanel, - }); - - expect(openDetailPanel.mock.calls.length).toBe(1); - expect(openDetailPanel.mock.calls[0][0]).toEqual(jobId); - }); - }); - describe('when there is an API error', () => { const { exists, find } = initTestBed({ jobLoadError: { diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index fc13958a3891..2e521829aaf8 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -3650,7 +3650,6 @@ "xpack.crossClusterReplication.autoFollowPatternDetailPanel.deleteButtonLabel": "删除", "xpack.crossClusterReplication.autoFollowPatternDetailPanel.editButtonLabel": "编辑", "xpack.crossClusterReplication.autoFollowPatternDetailPanel.leaderPatternsLabel": "Leader 模式", - "xpack.crossClusterReplication.autoFollowPatternDetailPanel.loadingLabel": "正在加载自动跟随模式……", "xpack.crossClusterReplication.autoFollowPatternDetailPanel.notFoundLabel": "未找到自动跟随模式", "xpack.crossClusterReplication.autoFollowPatternDetailPanel.prefixEmptyValue": "无前缀", "xpack.crossClusterReplication.autoFollowPatternDetailPanel.prefixLabel": "前缀", diff --git a/x-pack/test_utils/index.js b/x-pack/test_utils/index.js index 47e0c732ab13..7eca11c3f559 100644 --- a/x-pack/test_utils/index.js +++ b/x-pack/test_utils/index.js @@ -5,4 +5,5 @@ */ export { registerTestBed } from './testbed'; -export { getRandomString } from './lib'; +export { getRandomString, nextTick } from './lib'; +export { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/x-pack/test_utils/lib/index.js b/x-pack/test_utils/lib/index.js index e78e37715735..49c8ada6806b 100644 --- a/x-pack/test_utils/lib/index.js +++ b/x-pack/test_utils/lib/index.js @@ -6,3 +6,4 @@ export { getRandomString } from './strings'; +export { nextTick } from './utils'; diff --git a/x-pack/test_utils/lib/strings.js b/x-pack/test_utils/lib/strings.js index 1c88ecf1a636..f4ea808062ed 100644 --- a/x-pack/test_utils/lib/strings.js +++ b/x-pack/test_utils/lib/strings.js @@ -9,4 +9,4 @@ import Chance from 'chance'; const chance = new Chance(); const CHARS_POOL = 'abcdefghijklmnopqrstuvwxyz'; -export const getRandomString = () => `${chance.string({ pool: CHARS_POOL })}-${Date.now()}`; +export const getRandomString = (options = {}) => `${chance.string({ pool: CHARS_POOL, ...options })}-${Date.now()}`; diff --git a/x-pack/test_utils/lib/utils.js b/x-pack/test_utils/lib/utils.js new file mode 100644 index 000000000000..85ab84d96cba --- /dev/null +++ b/x-pack/test_utils/lib/utils.js @@ -0,0 +1,8 @@ +/* + * 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. + */ + + +export const nextTick = (time = 0) => new Promise((resolve) => setTimeout(resolve, time)); diff --git a/x-pack/test_utils/testbed/testbed.js b/x-pack/test_utils/testbed/testbed.js index 03477d46ab46..30bd82c710d8 100644 --- a/x-pack/test_utils/testbed/testbed.js +++ b/x-pack/test_utils/testbed/testbed.js @@ -4,20 +4,75 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { Component } from 'react'; +import { MemoryRouter, Route } from 'react-router-dom'; +import PropTypes from 'prop-types'; import { Provider } from 'react-redux'; import { mountWithIntl } from '../enzyme_helpers'; -import { findTestSubject as findTestSubjectHelper } from '@elastic/eui/lib/test'; +import { findTestSubject as findTestSubjectHelper } from '../index'; const registerTestSubjExists = component => (testSubject, count = 1) => findTestSubjectHelper(component, testSubject).length === count; -export const registerTestBed = (Component, defaultProps, store = {}) => (props) => { +const defaultOptions = { + memoryRouter: { + wrapRoute: true, + }, +}; + +const withRoute = (WrappedComponent, componentRoutePath = '/', onRouter = () => {}) => { + return class extends Component { + static contextTypes = { + router: PropTypes.object + }; + + componentDidMount() { + const { router } = this.context; + onRouter(router); + } + + render() { + return ( + } + /> + ); + } + }; +}; + + +/** + * Register a testBed for a React component to be tested inside a Redux provider + * + * @param {React.SFC} Component A react component to test + * @param {object} defaultProps Props to initialize the component with + * @param {object} store The Redux store to initialize the Redux Provider with + * + * @returns {object} with the following properties: + * + * - component The component wrapped by the Redux provider + * - exists() Method to check if a test subject exists in the mounted component + * - find() Method to find a test subject in the mounted componenet + * - setProp() Method to update the props on the wrapped component + * - getFormErrorsMessages() Method that will find all the "".euiFormErrorText" from eui and return their text + * - getMetadataFromEuiTable() Method that will extract the table rows and column + their values from an Eui tablle component + * - form.setInput() Method to update a form input value + * - form.selectCheckBox() Method to select a form checkbox + */ +export const registerTestBed = (Component, defaultProps, store = {}) => (props, options = defaultOptions) => { + const Comp = options.memoryRouter.wrapRoute === false + ? Component + : withRoute(Component, options.memoryRouter.componentRoutePath, options.memoryRouter.onRouter); + const component = mountWithIntl( - + + + ); @@ -63,7 +118,13 @@ export const registerTestBed = (Component, defaultProps, store = {}) => (props) * @param {ReactWrapper} table enzyme react wrapper of the EuiBasicTable */ const getMetadataFromEuiTable = (tableTestSubject) => { - const rows = find(tableTestSubject) + const table = find(tableTestSubject); + + if (!table.length) { + throw new Error(`Eui Table "${tableTestSubject}" not found.`); + } + + const rows = table .find('tr') .slice(1) // we remove the first row as it is the table header .map(row => ({ From 961f7919d312dfe43b25c15d2f22a8a2e8e6a74f Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Tue, 26 Mar 2019 12:05:39 +0100 Subject: [PATCH 10/25] Force user to re-authenticate if token refresh fails with `400` status code. (#33774) --- .../security/server/lib/__tests__/errors.js | 46 ---------- .../authentication/__tests__/authenticator.js | 32 ++++++- .../authentication_result.test.ts | 92 +++++++++++++++++++ .../authentication/authentication_result.ts | 15 +++ .../lib/authentication/authenticator.js | 25 ++--- .../providers/__tests__/token.js | 53 +++++++++++ .../lib/authentication/providers/token.js | 29 +++++- x-pack/plugins/security/server/lib/errors.js | 11 --- .../security/server/lib/errors.test.ts | 68 ++++++++++++++ x-pack/plugins/security/server/lib/errors.ts | 19 ++++ 10 files changed, 312 insertions(+), 78 deletions(-) delete mode 100644 x-pack/plugins/security/server/lib/__tests__/errors.js delete mode 100644 x-pack/plugins/security/server/lib/errors.js create mode 100644 x-pack/plugins/security/server/lib/errors.test.ts create mode 100644 x-pack/plugins/security/server/lib/errors.ts diff --git a/x-pack/plugins/security/server/lib/__tests__/errors.js b/x-pack/plugins/security/server/lib/__tests__/errors.js deleted file mode 100644 index 2cf7b6957a2b..000000000000 --- a/x-pack/plugins/security/server/lib/__tests__/errors.js +++ /dev/null @@ -1,46 +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 * as errors from '../errors'; - -describe('lib/errors', function () { - describe('#wrapError', () => { - it('returns given object', () => { - const err = new Error(); - const returned = errors.wrapError(err); - expect(returned).to.equal(err); - }); - it('error becomes boom error', () => { - const err = new Error(); - errors.wrapError(err); - expect(err.isBoom).to.equal(true); - }); - it('defaults output.statusCode to 500', () => { - const err = new Error(); - errors.wrapError(err); - expect(err.output.statusCode).to.equal(500); - }); - it('sets output.statusCode to .status if given', () => { - const err = new Error(); - err.status = 400; - errors.wrapError(err); - expect(err.output.statusCode).to.equal(400); - }); - it('defaults message to "Internal Server Error"', () => { - const err = new Error(); - errors.wrapError(err); - expect(err.message).to.equal('Internal Server Error'); - }); - it('sets custom message if a 400 level error', () => { - const err = new Error('wat'); - err.status = 499; - errors.wrapError(err); - expect(err.output.payload.message).to.equal('wat'); - }); - }); -}); diff --git a/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js b/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js index 44916c6a7bb8..cf391b4bfdfc 100644 --- a/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js +++ b/x-pack/plugins/security/server/lib/authentication/__tests__/authenticator.js @@ -28,11 +28,10 @@ describe('Authenticator', () => { session = sinon.createStubInstance(Session); config = { get: sinon.stub() }; - cluster = { callWithRequest: sinon.stub() }; // Cluster is returned by `getClient` function that is wrapped into `once` making cluster // a static singleton, so we should use sandbox to set/reset its behavior between tests. - cluster = sinon.stub({ callWithRequest() {} }); + cluster = sinon.stub({ callWithRequest() {}, callWithInternalUser() {} }); sandbox.stub(ClientShield, 'getClient').returns(cluster); server.config.returns(config); @@ -357,6 +356,35 @@ describe('Authenticator', () => { sinon.assert.calledWithExactly(session.clear, notSystemAPIRequest); }); + it('clears session if provider requested it via setting state to `null`.', async () => { + // Use `token` provider for this test as it's the only one that does what we want. + config.get.withArgs('xpack.security.authProviders').returns(['token']); + await initAuthenticator(server); + authenticate = server.expose.withArgs('authenticate').lastCall.args[1]; + + const request = requestFixture({ headers: { xCustomHeader: 'xxx' } }); + + session.get.withArgs(request).resolves({ + state: { accessToken: 'access-xxx', refreshToken: 'refresh-xxx' }, + provider: 'token' + }); + + session.clear.resolves(); + + cluster.callWithRequest + .withArgs(request).rejects({ body: { error: { reason: 'token expired' } } }); + + cluster.callWithInternalUser.withArgs('shield.getAccessToken').rejects( + Boom.badRequest('refresh token expired') + ); + + const authenticationResult = await authenticate(request); + expect(authenticationResult.redirected()).to.be(true); + + sinon.assert.calledOnce(session.clear); + sinon.assert.calledWithExactly(session.clear, request); + }); + it('does not clear session if provider failed to authenticate request with non-401 reason with active session.', async () => { const systemAPIRequest = requestFixture({ headers: { xCustomHeader: 'xxx' } }); diff --git a/x-pack/plugins/security/server/lib/authentication/authentication_result.test.ts b/x-pack/plugins/security/server/lib/authentication/authentication_result.test.ts index d67136e21a5c..870e843a829b 100644 --- a/x-pack/plugins/security/server/lib/authentication/authentication_result.test.ts +++ b/x-pack/plugins/security/server/lib/authentication/authentication_result.test.ts @@ -123,4 +123,96 @@ describe('AuthenticationResult', () => { expect(authenticationResult.error).toBeUndefined(); }); }); + + describe('shouldUpdateState', () => { + it('always `false` for `failed`', () => { + expect(AuthenticationResult.failed(new Error('error')).shouldUpdateState()).toBe(false); + }); + + it('always `false` for `notHandled`', () => { + expect(AuthenticationResult.notHandled().shouldUpdateState()).toBe(false); + }); + + it('depends on `state` for `redirected`.', () => { + const mockURL = 'some-url'; + expect(AuthenticationResult.redirectTo(mockURL, 'string').shouldUpdateState()).toBe(true); + expect(AuthenticationResult.redirectTo(mockURL, 0).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.redirectTo(mockURL, true).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.redirectTo(mockURL, false).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.redirectTo(mockURL, { prop: 'object' }).shouldUpdateState()).toBe( + true + ); + expect(AuthenticationResult.redirectTo(mockURL, { prop: 'object' }).shouldUpdateState()).toBe( + true + ); + + expect(AuthenticationResult.redirectTo(mockURL).shouldUpdateState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, undefined).shouldUpdateState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, null).shouldUpdateState()).toBe(false); + }); + + it('depends on `state` for `succeeded`.', () => { + const mockUser = { username: 'u' }; + expect(AuthenticationResult.succeeded(mockUser, 'string').shouldUpdateState()).toBe(true); + expect(AuthenticationResult.succeeded(mockUser, 0).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.succeeded(mockUser, true).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.succeeded(mockUser, false).shouldUpdateState()).toBe(true); + expect(AuthenticationResult.succeeded(mockUser, { prop: 'object' }).shouldUpdateState()).toBe( + true + ); + expect(AuthenticationResult.succeeded(mockUser, { prop: 'object' }).shouldUpdateState()).toBe( + true + ); + + expect(AuthenticationResult.succeeded(mockUser).shouldUpdateState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, undefined).shouldUpdateState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, null).shouldUpdateState()).toBe(false); + }); + }); + + describe('shouldClearState', () => { + it('always `false` for `failed`', () => { + expect(AuthenticationResult.failed(new Error('error')).shouldClearState()).toBe(false); + }); + + it('always `false` for `notHandled`', () => { + expect(AuthenticationResult.notHandled().shouldClearState()).toBe(false); + }); + + it('depends on `state` for `redirected`.', () => { + const mockURL = 'some-url'; + expect(AuthenticationResult.redirectTo(mockURL, null).shouldClearState()).toBe(true); + + expect(AuthenticationResult.redirectTo(mockURL).shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, undefined).shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, 'string').shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, 0).shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, true).shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, false).shouldClearState()).toBe(false); + expect(AuthenticationResult.redirectTo(mockURL, { prop: 'object' }).shouldClearState()).toBe( + false + ); + expect(AuthenticationResult.redirectTo(mockURL, { prop: 'object' }).shouldClearState()).toBe( + false + ); + }); + + it('depends on `state` for `succeeded`.', () => { + const mockUser = { username: 'u' }; + expect(AuthenticationResult.succeeded(mockUser, null).shouldClearState()).toBe(true); + + expect(AuthenticationResult.succeeded(mockUser).shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, undefined).shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, 'string').shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, 0).shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, true).shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, false).shouldClearState()).toBe(false); + expect(AuthenticationResult.succeeded(mockUser, { prop: 'object' }).shouldClearState()).toBe( + false + ); + expect(AuthenticationResult.succeeded(mockUser, { prop: 'object' }).shouldClearState()).toBe( + false + ); + }); + }); }); diff --git a/x-pack/plugins/security/server/lib/authentication/authentication_result.ts b/x-pack/plugins/security/server/lib/authentication/authentication_result.ts index 19df30ef84ae..b6a0d3ba1c21 100644 --- a/x-pack/plugins/security/server/lib/authentication/authentication_result.ts +++ b/x-pack/plugins/security/server/lib/authentication/authentication_result.ts @@ -160,4 +160,19 @@ export class AuthenticationResult { public redirected() { return this.status === AuthenticationResultStatus.Redirected; } + + /** + * Checks whether authentication result implies state update. + */ + public shouldUpdateState() { + // State shouldn't be updated in case it wasn't set or was specifically set to `null`. + return this.options.state != null; + } + + /** + * Checks whether authentication result implies state clearing. + */ + public shouldClearState() { + return this.options.state === null; + } } diff --git a/x-pack/plugins/security/server/lib/authentication/authenticator.js b/x-pack/plugins/security/server/lib/authentication/authenticator.js index 2cf2d0e1e0f8..f6dacb308e62 100644 --- a/x-pack/plugins/security/server/lib/authentication/authenticator.js +++ b/x-pack/plugins/security/server/lib/authentication/authenticator.js @@ -6,6 +6,7 @@ import { getClient } from '../../../../../server/lib/get_client_shield'; import { AuthScopeService } from '../auth_scope_service'; +import { getErrorStatusCode } from '../errors'; import { BasicAuthenticationProvider } from './providers/basic'; import { SAMLAuthenticationProvider } from './providers/saml'; import { TokenAuthenticationProvider } from './providers/token'; @@ -49,15 +50,6 @@ function getProviderOptions(server) { }; } -/** - * Extracts error code from Boom and Elasticsearch "native" errors. - * @param {Error} error Error instance to extract status code from. - * @returns {number} - */ -function getErrorStatusCode(error) { - return error.isBoom ? error.output.statusCode : error.statusCode; -} - /** * Authenticator is responsible for authentication of the request using chain of * authentication providers. The chain is essentially a prioritized list of configured @@ -149,21 +141,24 @@ class Authenticator { ownsSession ? existingSession.state : null ); - if (ownsSession || authenticationResult.state) { + if (ownsSession || authenticationResult.shouldUpdateState()) { // If authentication succeeds or requires redirect we should automatically extend existing user session, // unless authentication has been triggered by a system API request. In case provider explicitly returns new // state we should store it in the session regardless of whether it's a system API request or not. const sessionCanBeUpdated = (authenticationResult.succeeded() || authenticationResult.redirected()) - && (authenticationResult.state || !isSystemApiRequest); + && (authenticationResult.shouldUpdateState() || !isSystemApiRequest); - // If provider owned the session, but failed to authenticate anyway, that likely means - // that session is not valid and we should clear it. - if (authenticationResult.failed() && getErrorStatusCode(authenticationResult.error) === 401) { + // If provider owned the session, but failed to authenticate anyway, that likely means that + // session is not valid and we should clear it. Also provider can specifically ask to clear + // session by setting it to `null` even if authentication attempt didn't fail. + if (authenticationResult.shouldClearState() || ( + authenticationResult.failed() && getErrorStatusCode(authenticationResult.error) === 401) + ) { await this._session.clear(request); } else if (sessionCanBeUpdated) { await this._session.set( request, - authenticationResult.state + authenticationResult.shouldUpdateState() ? { state: authenticationResult.state, provider: providerType } : existingSession ); diff --git a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js index ebc33d6b7f59..b13fc1ce8934 100644 --- a/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js +++ b/x-pack/plugins/security/server/lib/authentication/providers/__tests__/token.js @@ -6,6 +6,7 @@ import expect from '@kbn/expect'; import sinon from 'sinon'; +import { errors } from 'elasticsearch'; import { requestFixture } from '../../../__tests__/__fixtures__/request'; import { LoginAttempt } from '../../login_attempt'; import { TokenAuthenticationProvider } from '../token'; @@ -327,6 +328,58 @@ describe('TokenAuthenticationProvider', () => { expect(authenticationResult.error).to.be.eql(authenticationError); }); + it('redirects non-AJAX requests to /login and clears session if token refresh fails with 400 error', async () => { + const request = requestFixture({ path: '/some-path' }); + + callWithRequest + .withArgs(sinon.match({ headers: { authorization: 'Bearer foo' } }), 'shield.authenticate') + .rejects({ body: { error: { reason: 'token expired' } } }); + + callWithInternalUser + .withArgs('shield.getAccessToken', { body: { grant_type: 'refresh_token', refresh_token: 'bar' } }) + .rejects(new errors.BadRequest('failed to refresh token')); + + const accessToken = 'foo'; + const refreshToken = 'bar'; + const authenticationResult = await provider.authenticate(request, { accessToken, refreshToken }); + + sinon.assert.calledOnce(callWithRequest); + sinon.assert.calledOnce(callWithInternalUser); + + expect(request.headers).to.not.have.property('authorization'); + expect(authenticationResult.redirected()).to.be(true); + expect(authenticationResult.redirectURL).to.be('/base-path/login?next=%2Fsome-path'); + expect(authenticationResult.user).to.be.eql(undefined); + expect(authenticationResult.state).to.be.eql(null); + expect(authenticationResult.error).to.be.eql(undefined); + }); + + it('does not redirect AJAX requests if token refresh fails with 400 error', async () => { + const request = requestFixture({ headers: { 'kbn-xsrf': 'xsrf' }, path: '/some-path' }); + + callWithRequest + .withArgs(sinon.match({ headers: { authorization: 'Bearer foo' } }), 'shield.authenticate') + .rejects({ body: { error: { reason: 'token expired' } } }); + + const authenticationError = new errors.BadRequest('failed to refresh token'); + callWithInternalUser + .withArgs('shield.getAccessToken', { body: { grant_type: 'refresh_token', refresh_token: 'bar' } }) + .rejects(authenticationError); + + const accessToken = 'foo'; + const refreshToken = 'bar'; + const authenticationResult = await provider.authenticate(request, { accessToken, refreshToken }); + + sinon.assert.calledOnce(callWithRequest); + sinon.assert.calledOnce(callWithInternalUser); + + expect(request.headers).to.not.have.property('authorization'); + expect(authenticationResult.failed()).to.be(true); + expect(authenticationResult.error).to.be(authenticationError); + expect(authenticationResult.user).to.be.eql(undefined); + expect(authenticationResult.state).to.be.eql(undefined); + }); + it('fails if new access token is rejected after successful refresh', async () => { const request = requestFixture(); diff --git a/x-pack/plugins/security/server/lib/authentication/providers/token.js b/x-pack/plugins/security/server/lib/authentication/providers/token.js index 74056bce742c..96d3c304c344 100644 --- a/x-pack/plugins/security/server/lib/authentication/providers/token.js +++ b/x-pack/plugins/security/server/lib/authentication/providers/token.js @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { getErrorStatusCode } from '../../errors'; import { canRedirectRequest } from '../../can_redirect_request'; import { AuthenticationResult } from '../authentication_result'; import { DeauthenticationResult } from '../deauthentication_result'; @@ -91,10 +92,7 @@ export class TokenAuthenticationProvider { // finally, if authentication still can not be handled for this // request/state combination, redirect to the login page if appropriate if (authenticationResult.notHandled() && canRedirectRequest(request)) { - const nextURL = encodeURIComponent(`${request.getBasePath()}${request.url.path}`); - authenticationResult = AuthenticationResult.redirectTo( - `${this._options.basePath}/login?next=${nextURL}` - ); + authenticationResult = AuthenticationResult.redirectTo(this._getLoginPageURL(request)); } return authenticationResult; @@ -356,7 +354,30 @@ export class TokenAuthenticationProvider { // it's called with this request once again down the line (e.g. in the next authentication provider). delete request.headers.authorization; + // If refresh fails with `400` then refresh token is no longer valid and we should clear session + // and redirect user to the login page to re-authenticate. + if (getErrorStatusCode(err) === 400 && canRedirectRequest(request)) { + this._options.log( + ['debug', 'security', 'token'], + 'Clearing session since both access and refresh tokens are expired.' + ); + + // Set state to `null` to let `Authenticator` know that we want to clear current session. + return AuthenticationResult.redirectTo(this._getLoginPageURL(request), null); + } + return AuthenticationResult.failed(err); } } + + /** + * Constructs login page URL using current url path as `next` query string parameter. + * @param {Hapi.Request} request HapiJS request instance. + * @returns {string} + * @private + */ + _getLoginPageURL(request) { + const nextURL = encodeURIComponent(`${request.getBasePath()}${request.url.path}`); + return `${this._options.basePath}/login?next=${nextURL}`; + } } diff --git a/x-pack/plugins/security/server/lib/errors.js b/x-pack/plugins/security/server/lib/errors.js deleted file mode 100644 index 0f8a0f0d8c0a..000000000000 --- a/x-pack/plugins/security/server/lib/errors.js +++ /dev/null @@ -1,11 +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 { boomify } from 'boom'; - -export function wrapError(error) { - return boomify(error, { statusCode: error.status }); -} diff --git a/x-pack/plugins/security/server/lib/errors.test.ts b/x-pack/plugins/security/server/lib/errors.test.ts new file mode 100644 index 000000000000..7c4668b245b0 --- /dev/null +++ b/x-pack/plugins/security/server/lib/errors.test.ts @@ -0,0 +1,68 @@ +/* + * 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 Boom from 'boom'; +import { errors as esErrors } from 'elasticsearch'; +import * as errors from './errors'; + +describe('lib/errors', () => { + describe('#wrapError', () => { + it('returns given object', () => { + const err = new Error(); + const returned = errors.wrapError(err); + expect(returned).toEqual(err); + }); + + it('error becomes boom error', () => { + const err = new Error(); + errors.wrapError(err); + expect(err).toHaveProperty('isBoom', true); + }); + + it('defaults output.statusCode to 500', () => { + const err = new Error(); + errors.wrapError(err); + expect(err).toHaveProperty('output.statusCode', 500); + }); + + it('sets output.statusCode to .status if given', () => { + const err: any = new Error(); + err.status = 400; + errors.wrapError(err); + expect(err).toHaveProperty('output.statusCode', 400); + }); + + it('defaults message to "Internal Server Error"', () => { + const err = new Error(); + errors.wrapError(err); + expect(err.message).toBe('Internal Server Error'); + }); + + it('sets custom message if a 400 level error', () => { + const err: any = new Error('wat'); + err.status = 499; + errors.wrapError(err); + expect(err).toHaveProperty('output.payload.message', 'wat'); + }); + }); + + describe('#getErrorStatusCode', () => { + it('extracts status code from Boom error', () => { + expect(errors.getErrorStatusCode(Boom.badRequest())).toBe(400); + expect(errors.getErrorStatusCode(Boom.unauthorized())).toBe(401); + }); + + it('extracts status code from Elasticsearch client error', () => { + expect(errors.getErrorStatusCode(new esErrors.BadRequest())).toBe(400); + expect(errors.getErrorStatusCode(new esErrors.AuthenticationException())).toBe(401); + }); + + it('extracts status code from `status` property', () => { + expect(errors.getErrorStatusCode({ statusText: 'Bad Request', status: 400 })).toBe(400); + expect(errors.getErrorStatusCode({ statusText: 'Unauthorized', status: 401 })).toBe(401); + }); + }); +}); diff --git a/x-pack/plugins/security/server/lib/errors.ts b/x-pack/plugins/security/server/lib/errors.ts new file mode 100644 index 000000000000..e0c291899169 --- /dev/null +++ b/x-pack/plugins/security/server/lib/errors.ts @@ -0,0 +1,19 @@ +/* + * 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 Boom from 'boom'; + +export function wrapError(error: any) { + return Boom.boomify(error, { statusCode: getErrorStatusCode(error) }); +} + +/** + * Extracts error code from Boom and Elasticsearch "native" errors. + * @param error Error instance to extract status code from. + */ +export function getErrorStatusCode(error: any): number { + return Boom.isBoom(error) ? error.output.statusCode : error.statusCode || error.status; +} From 2f9ad0a814aa7d69da29f3bbf362ca019d792049 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Tue, 26 Mar 2019 06:27:20 -0700 Subject: [PATCH 11/25] Improve performance of the Logstash Pipeline Viewer (#33793) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #27513. _This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._ Summary of changes, taken from #31293: ## Before this PR The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline. Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser. ## With this PR This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer. ## Gains, by the numbers Based on a simple, 1-input, 1-filter, and 1-output pipeline. * Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets. * Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size. * Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size. * Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size. --- .../models/graph/__tests__/plugin_vertex.js | 38 +- .../models/graph/plugin_vertex.js | 36 +- .../pipeline_viewer.test.js.snap | 30 +- .../views/__test__/pipeline_viewer.test.js | 30 +- .../pipeline_viewer/views/pipeline_viewer.js | 36 +- .../public/views/logstash/pipeline/index.js | 33 +- .../lib/logstash/__tests__/get_pipeline.js | 344 ++++-------------- .../server/lib/logstash/get_pipeline.js | 90 +---- .../logstash/get_pipeline_state_document.js | 5 +- .../get_pipeline_stats_aggregation.js | 86 ++--- .../lib/logstash/get_pipeline_versions.js | 3 +- .../lib/logstash/get_pipeline_vertex.js | 121 ++++++ .../get_pipeline_vertex_stats_aggregation.js | 189 ++++++++++ .../server/routes/api/v1/logstash/pipeline.js | 40 +- 14 files changed, 547 insertions(+), 534 deletions(-) create mode 100644 x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js create mode 100644 x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js index 8d9ccc17c282..5e158c5fa97a 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/__tests__/plugin_vertex.js @@ -25,30 +25,10 @@ describe('PluginVertex', () => { vertexJson = { config_name: 'some-name', stats: { - millis_per_event: { - data: [ - [ 1516667383000, 10 ], - [ 1516667386000, 50 ] - ] - }, - percent_of_total_processor_duration: { - data: [ - [ 1516667383000, 0.25 ], - [ 1516667386000, 0.3 ] - ] - }, - events_in_per_millisecond: { - data: [ - [ 1516667383000, 0.01 ], - [ 1516667386000, 0.02 ] - ] - }, - events_out_per_millisecond: { - data: [ - [ 1516667383000, 0.01 ], - [ 1516667386000, 0.03 ] - ] - } + millis_per_event: 50, + percent_of_total_processor_duration: 0.3, + events_in_per_millisecond: 0.01, + events_out_per_millisecond: 0.01 } }; }); @@ -80,7 +60,7 @@ describe('PluginVertex', () => { it('should have the correct events-per-second stat', () => { const pluginVertex = new PluginVertex(graph, vertexJson); - expect(pluginVertex.latestEventsPerSecond).to.be(20); + expect(pluginVertex.latestEventsPerSecond).to.be(10); }); describe('isTimeConsuming', () => { @@ -91,13 +71,13 @@ describe('PluginVertex', () => { }); it('should have a false isTimeConsuming result when the plugin consumes an average amount of execution time', () => { - vertexJson.stats.percent_of_total_processor_duration.data[1][1] = percentExecution; + vertexJson.stats.percent_of_total_processor_duration = percentExecution; const pluginVertex = new PluginVertex(graph, vertexJson); expect(pluginVertex.isTimeConsuming()).to.be(false); }); it('should have a true isTimeConsuming result when the plugin consumes a large amount of execution time', () => { - vertexJson.stats.percent_of_total_processor_duration.data[1][1] = 0.1 + + vertexJson.stats.percent_of_total_processor_duration = 0.1 + (percentExecution * (TIME_CONSUMING_PROCESSOR_THRESHOLD_COEFFICIENT)); const pluginVertex = new PluginVertex(graph, vertexJson); expect(pluginVertex.isTimeConsuming()).to.be(true); @@ -111,13 +91,13 @@ describe('PluginVertex', () => { }); it('should have a true isSlow result when the plugin\'s seconds per event is 2 standard deviations above the mean', () => { - vertexJson.stats.millis_per_event.data[1][1] = 999999999999999999; + vertexJson.stats.millis_per_event = 999999999999999999; const pluginVertex = new PluginVertex(graph, vertexJson); expect(pluginVertex.isSlow()).to.be(true); }); it('should have a false isSlow result when the plugin\'s seconds per event is 2 standard deviations above the mean', () => { - vertexJson.stats.millis_per_event.data[1][1] = 1; + vertexJson.stats.millis_per_event = 1; const pluginVertex = new PluginVertex(graph, vertexJson); expect(pluginVertex.isSlow()).to.be(false); }); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/plugin_vertex.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/plugin_vertex.js index 0c74318982bd..23f316a9351c 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/plugin_vertex.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/graph/plugin_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { last, get, omit } from 'lodash'; +import { get } from 'lodash'; import { Vertex } from './vertex'; export const TIME_CONSUMING_PROCESSOR_THRESHOLD_COEFFICIENT = 2; @@ -44,28 +44,36 @@ export class PluginVertex extends Vertex { } get latestMillisPerEvent() { - const latestMillisPerEventBucket = last(get(this.stats, 'millis_per_event.data', [])) || []; - return latestMillisPerEventBucket[1]; + return get(this.stats, 'millis_per_event'); } get percentOfTotalProcessorTime() { - const latestPercentOfTotalProcessorDurationBucket = last(get(this.stats, 'percent_of_total_processor_duration.data', [])) || []; - return latestPercentOfTotalProcessorDurationBucket[1]; + return get(this.stats, 'percent_of_total_processor_duration'); + } + + get eventsPerMillisecond() { + return this.isInput + ? this.stats.events_out_per_millisecond + : this.stats.events_in_per_millisecond; } get eventsPerSecond() { - const eventsPerMillisecond = this.isInput - ? this.stats.events_out_per_millisecond - : this.stats.events_in_per_millisecond; - return { - ...omit(eventsPerMillisecond, 'data'), - data: get(eventsPerMillisecond, 'data', []).map(([x, y]) => [x, y * 1000]) - }; + if (!this.eventsPerMillisecond.hasOwnProperty('data')) { + return this.eventsPerMillisecond * 1000; + } + + const eps = { ...this.eventsPerMillisecond }; // Clone the object so we don't modify the original one + eps.data = this.eventsPerMillisecond.data.map(([timestamp, value]) => [ timestamp, value * 1000]); + return eps; } get latestEventsPerSecond() { - const latestBucket = last(get(this.eventsPerSecond, 'data', [])) || []; - return latestBucket[1]; + if (!this.eventsPerSecond.hasOwnProperty('data')) { + return this.eventsPerSecond; + } + + const numTimeseriesBuckets = this.eventsPerSecond.data.length; + return this.eventsPerSecond.data[numTimeseriesBuckets - 1][1]; } isTimeConsuming() { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/pipeline_viewer.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/pipeline_viewer.test.js.snap index fb22a53cf25b..aaa012c7a534 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/pipeline_viewer.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/pipeline_viewer.test.js.snap @@ -14,7 +14,6 @@ exports[`PipelineViewer component passes expected props 1`] = ` verticalPosition="center" > @@ -90,11 +87,6 @@ exports[`PipelineViewer component renders DetailDrawer when selected vertex is n verticalPosition="center" > { let pipeline; @@ -44,7 +43,7 @@ describe('PipelineViewer component', () => { }, }; - component = ; + component = ; }); it('passes expected props', () => { @@ -53,33 +52,12 @@ describe('PipelineViewer component', () => { expect(renderedComponent).toMatchSnapshot(); }); - it('changes selected vertex', () => { - const vertex = { id: 'stdin' }; - - const instance = shallowWithIntl(component).instance(); - instance.onShowVertexDetails(vertex); - - expect(get(instance, 'state.detailDrawer.vertex')).toBe(vertex); - }); - - it('toggles selected vertex on second pass', () => { - const vertex = { id: 'stdin' }; - - const instance = shallowWithIntl(component).instance(); - instance.onShowVertexDetails(vertex); - instance.onShowVertexDetails(vertex); - - expect(get(instance, 'state.detailDrawer.vertex')).toBeNull(); - }); - it('renders DetailDrawer when selected vertex is not null', () => { const vertex = { id: 'stdin' }; + component = ; - const wrapper = shallowWithIntl(component); - const instance = wrapper.instance(); - instance.onShowVertexDetails(vertex); - wrapper.update(); + const renderedComponent = shallowWithIntl(component); - expect(wrapper).toMatchSnapshot(); + expect(renderedComponent).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js index ddebfc74fb53..64970a846f0b 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js @@ -27,36 +27,15 @@ class PipelineViewerUi extends React.Component { }; } - onShowVertexDetails = (vertex) => { - if (vertex === this.state.detailDrawer.vertex) { - this.onHideVertexDetails(); - } - else { - this.setState({ - detailDrawer: { - vertex - } - }); - } - } - - onHideVertexDetails = () => { - this.setState({ - detailDrawer: { - vertex: null - } - }); - } - renderDetailDrawer = () => { - if (!this.state.detailDrawer.vertex) { + if (!this.props.detailVertex) { return null; } return ( this.props.setDetailVertexId(undefined)} timeseriesTooltipXValueFormatter={this.props.timeseriesTooltipXValueFormatter} /> ); @@ -79,8 +58,7 @@ class PipelineViewerUi extends React.Component { iconType="logstashInput" headingText={intl.formatMessage({ id: 'xpack.monitoring.logstash.pipelineViewer.inputsTitle', defaultMessage: 'Inputs' })} elements={inputs} - onShowVertexDetails={this.onShowVertexDetails} - detailVertex={this.state.detailDrawer.vertex} + onShowVertexDetails={this.props.setDetailVertexId} /> @@ -89,16 +67,14 @@ class PipelineViewerUi extends React.Component { iconType="logstashFilter" headingText={intl.formatMessage({ id: 'xpack.monitoring.logstash.pipelineViewer.filtersTitle', defaultMessage: 'Filters' })} elements={filters} - onShowVertexDetails={this.onShowVertexDetails} - detailVertex={this.state.detailDrawer.vertex} + onShowVertexDetails={this.props.setDetailVertexId} /> { this.renderDetailDrawer() } diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js index 671cdd3a1b60..9ff09d731c48 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js @@ -20,6 +20,7 @@ import { List } from 'plugins/monitoring/components/logstash/pipeline_viewer/mod import { PipelineState } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/pipeline_state'; import { PipelineViewer } from 'plugins/monitoring/components/logstash/pipeline_viewer'; import { Pipeline } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/pipeline'; +import { vertexFactory } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/graph/vertex_factory'; import { MonitoringViewBaseController } from '../../base_controller'; import { I18nContext } from 'ui/i18n'; import { @@ -28,6 +29,9 @@ import { EuiPageContent, } from '@elastic/eui'; +let previousPipelineHash = undefined; +let detailVertexId = undefined; + function getPageData($injector) { const $route = $injector.get('$route'); const $http = $injector.get('$http'); @@ -38,11 +42,20 @@ function getPageData($injector) { const { ccs, cluster_uuid: clusterUuid } = globalState; const pipelineId = $route.current.params.id; const pipelineHash = $route.current.params.hash || ''; + + // Pipeline version was changed, so clear out detailVertexId since that vertex won't + // exist in the updated pipeline version + if (pipelineHash !== previousPipelineHash) { + previousPipelineHash = pipelineHash; + detailVertexId = undefined; + } + const url = pipelineHash ? `../api/monitoring/v1/clusters/${clusterUuid}/logstash/pipeline/${pipelineId}/${pipelineHash}` : `../api/monitoring/v1/clusters/${clusterUuid}/logstash/pipeline/${pipelineId}`; return $http.post(url, { - ccs + ccs, + detailVertexId }) .then(response => response.data) .then(data => { @@ -107,11 +120,22 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', { const timeseriesTooltipXValueFormatter = xValue => moment(xValue).format(dateFormat); + const setDetailVertexId = vertex => { + if (!vertex) { + detailVertexId = undefined; + } else { + detailVertexId = vertex.id; + } + + return this.updateData(); + }; + $scope.$watch(() => this.data, data => { if (!data || !data.pipeline) { return; } this.pipelineState = new PipelineState(data.pipeline); + this.detailVertex = data.vertex ? vertexFactory(null, data.vertex) : null; this.renderReact( @@ -122,6 +146,8 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', { Pipeline.fromPipelineGraph(this.pipelineState.config.graph) )} timeseriesTooltipXValueFormatter={timeseriesTooltipXValueFormatter} + setDetailVertexId={setDetailVertexId} + detailVertex={this.detailVertex} /> @@ -129,6 +155,11 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', { ); }); + + $scope.$on('$destroy', () => { + previousPipelineHash = undefined; + detailVertexId = undefined; + }); } } }); diff --git a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js index f0e81eb63ddd..71732b6a2d7f 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/__tests__/get_pipeline.js @@ -37,13 +37,8 @@ describe('get_pipeline', () => { it('returns correct stats', () => { const result = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); expect(result).to.eql({ - events_in: 10000, - events_out: 9000, - duration_in_millis: 18000, events_out_per_millisecond: 0.01, millis_per_event: 2, - queue_push_duration_in_millis: 100000, - queue_push_duration_in_millis_per_event: 11.11111111111111 }); }); @@ -57,9 +52,6 @@ describe('get_pipeline', () => { it('returns correct stats', () => { const result = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); expect(result).to.eql({ - events_in: 10000, - events_out: 9000, - duration_in_millis: 18000, events_in_per_millisecond: 0.011111111111111112, events_out_per_millisecond: 0.01, millis_per_event: 1.8, @@ -78,9 +70,6 @@ describe('get_pipeline', () => { it('returns correct stats', () => { const result = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); expect(result).to.eql({ - events_in: 10000, - events_out: 9000, - duration_in_millis: 18000, events_in_per_millisecond: 0.011111111111111112, events_out_per_millisecond: 0.01, millis_per_event: 1.8, @@ -93,7 +82,6 @@ describe('get_pipeline', () => { describe('_enrichStateWithStatsAggregation function', () => { let stateDocument; let statsAggregation; - let version; let timeseriesInterval; beforeEach(() => { @@ -160,278 +148,96 @@ describe('get_pipeline', () => { }; statsAggregation = { - timeseriesStats: [ - { - key: { time_bucket: 1516131120000 }, - pipelines: { - scoped: { - vertices: { - vertex_id: { - buckets: [ - { - key: 'mystdout', - events_in_total: { value: 1000 }, - events_out_total: { value: 1000 }, - duration_in_millis_total: { value: 15 }, - queue_push_duration_in_millis_total: { value: 0 } - }, - { - key: 'mystdin', - events_in_total: { value: 0 }, - events_out_total: { value: 1000 }, - duration_in_millis_total: { value: 0 }, - queue_push_duration_in_millis_total: { value: 13547 } - } - ] - } - }, - total_processor_duration_stats: { - count: 276, - min: 0, - max: 15904756, - avg: 6591773.384057971, - sum: 1819329454 - } - } - } - }, - { - key: { time_bucket: 1516131180000 }, - pipelines: { - scoped: { - vertices: { - vertex_id: { - buckets: [ - { - key: 'mystdout', - events_in_total: { value: 2000 }, - events_out_total: { value: 2000 }, - duration_in_millis_total: { value: 20 }, - queue_push_duration_in_millis_total: { value: 0 } - }, - { - key: 'mystdin', - events_in_total: { value: 0 }, - events_out_total: { value: 2000 }, - duration_in_millis_total: { value: 0 }, - queue_push_duration_in_millis_total: { value: 25073 } - } - ] - } - }, - total_processor_duration_stats: { - count: 276, - min: 0, - max: 15953756, - avg: 6591773.384057971, - sum: 1819329454 + aggregations: { + pipelines: { + scoped: { + vertices: { + vertex_id: { + buckets: [ + { + key: 'mystdout', + events_in_total: { value: 1000 }, + events_out_total: { value: 1000 }, + duration_in_millis_total: { value: 15 }, + }, + { + key: 'mystdin', + events_in_total: { value: 0 }, + events_out_total: { value: 1000 }, + duration_in_millis_total: { value: 0 }, + } + ] } + }, + total_processor_duration_stats: { + count: 276, + min: 0, + max: 15904756, + avg: 6591773.384057971, + sum: 1819329454 } } } - ] + } }; - version = { - hash: 'eada8baceee81726f6be9d0a071beefad3d9a2fd1b5f5d916011dca9fa66d081', - firstSeen: 1516131138639, - lastSeen: 1516135440463 - }; - - timeseriesInterval = 30; }); it('enriches the state document correctly with stats', () => { - const enrichedStateDocument = _enrichStateWithStatsAggregation(stateDocument, statsAggregation, version, timeseriesInterval); + const enrichedStateDocument = _enrichStateWithStatsAggregation(stateDocument, statsAggregation, timeseriesInterval); expect(enrichedStateDocument).to.eql({ - pipeline: { - batch_size: 125, - ephemeral_id: '2c53e689-62e8-4ef3-bc57-ea968531a848', + batch_size: 125, + ephemeral_id: '2c53e689-62e8-4ef3-bc57-ea968531a848', + hash: 'eada8baceee81726f6be9d0a071beefad3d9a2fd1b5f5d916011dca9fa66d081', + id: 'main', + representation: { + type: 'lir', + version: '0.0.0', hash: 'eada8baceee81726f6be9d0a071beefad3d9a2fd1b5f5d916011dca9fa66d081', - id: 'main', - representation: { - type: 'lir', - version: '0.0.0', - hash: 'eada8baceee81726f6be9d0a071beefad3d9a2fd1b5f5d916011dca9fa66d081', - graph: { - vertices: [ - { - config_name: 'stdin', - id: 'mystdin', - type: 'plugin', - plugin_type: 'input', - stats: { - duration_in_millis: { - data: [ - [ 1516131120000, 0 ], - [ 1516131180000, 0 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_in: { - data: [ - [ 1516131120000, 0 ], - [ 1516131180000, 0 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_out: { - data: [ - [ 1516131120000, 1000 ], - [ 1516131180000, 2000 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_out_per_millisecond: { - data: [ - [ 1516131120000, 0.03333333333333333 ], - [ 1516131180000, 0.06666666666666667 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - millis_per_event: { - data: [ - [ 1516131120000, 0 ], - [ 1516131180000, 0 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - queue_push_duration_in_millis: { - data: [ - [ 1516131120000, 13547 ], - [ 1516131180000, 25073 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - queue_push_duration_in_millis_per_event: { - data: [ - [ 1516131120000, 13.547 ], - [ 1516131180000, 12.5365 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - } - } - }, - { - config_name: 'stdout', - id: 'mystdout', - type: 'plugin', - plugin_type: 'output', - stats: { - duration_in_millis: { - data: [ - [ 1516131120000, 15 ], - [ 1516131180000, 20 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_in: { - data: [ - [ 1516131120000, 1000 ], - [ 1516131180000, 2000 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_out: { - data: [ - [ 1516131120000, 1000 ], - [ 1516131180000, 2000 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_in_per_millisecond: { - data: [ - [1516131120000, 0.03333333333333333], - [1516131180000, 0.06666666666666667] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - events_out_per_millisecond: { - data: [ - [ 1516131120000, 0.03333333333333333 ], - [ 1516131180000, 0.06666666666666667 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - millis_per_event: { - data: [ - [ 1516131120000, 0.015 ], - [ 1516131180000, 0.01 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - }, - percent_of_total_processor_duration: { - data: [ - [ 1516131120000, 0.0000009431141225932671 ], - [ 1516131180000, 0.0000012536232846986 ] - ], - timeRange: { - min: 1516131138639, - max: 1516135440463 - } - } - } + graph: { + vertices: [ + { + config_name: 'stdin', + id: 'mystdin', + type: 'plugin', + plugin_type: 'input', + stats: { + events_out_per_millisecond: 0.03333333333333333, + millis_per_event: 0 } - ], - edges: [ - { - id: 'c56369ba2e160c8add43e8f105ca17c374b27f4b4627ea4566f066b0ead0bcc7', - from: 'mystdin', - to: '__QUEUE__', - type: 'plain' - }, - { - id: '8a5222282b023399a14195011f2a14aa54a4d97810cd9e0a63c5cd98856bb70f', - from: '__QUEUE__', - to: 'mystdout', - type: 'plain' + }, + { + config_name: 'stdout', + id: 'mystdout', + type: 'plugin', + plugin_type: 'output', + stats: { + events_in_per_millisecond: 0.03333333333333333, + events_out_per_millisecond: 0.03333333333333333, + millis_per_event: 0.015, + percent_of_total_processor_duration: 0.0000009431141225932671 } - ] - }, - plugins: [] + } + ], + edges: [ + { + id: 'c56369ba2e160c8add43e8f105ca17c374b27f4b4627ea4566f066b0ead0bcc7', + from: 'mystdin', + to: '__QUEUE__', + type: 'plain' + }, + { + id: '8a5222282b023399a14195011f2a14aa54a4d97810cd9e0a63c5cd98856bb70f', + from: '__QUEUE__', + to: 'mystdout', + type: 'plain' + } + ] }, - workers: 1 - } + plugins: [] + }, + workers: 1 }); }); }); diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js index 63f0f2389033..8461f880e37f 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js @@ -9,7 +9,6 @@ import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { getPipelineStateDocument } from './get_pipeline_state_document'; import { getPipelineStatsAggregation } from './get_pipeline_stats_aggregation'; -import { getPipelineVersions } from './get_pipeline_versions'; import { calculateTimeseriesInterval } from '../calculate_timeseries_interval'; export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds) { @@ -24,7 +23,6 @@ export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationI const durationInMillis = vertexStatsBucket.duration_in_millis_total.value; - const inputStats = {}; const processorStats = {}; const eventsProcessedStats = { events_out_per_millisecond: eventsOutTotal / timeseriesIntervalInMillis @@ -34,8 +32,6 @@ export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationI if (isInput) { eventsTotal = eventsOutTotal; - inputStats.queue_push_duration_in_millis = vertexStatsBucket.queue_push_duration_in_millis_total.value; - inputStats.queue_push_duration_in_millis_per_event = inputStats.queue_push_duration_in_millis / eventsTotal; } if (isProcessor) { @@ -45,11 +41,7 @@ export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationI } return { - events_in: eventsInTotal, - events_out: eventsOutTotal, - duration_in_millis: durationInMillis, millis_per_event: durationInMillis / eventsTotal, - ...inputStats, ...processorStats, ...eventsProcessedStats }; @@ -57,15 +49,15 @@ export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationI /** * The UI needs a list of all vertices for the requested pipeline version, with each vertex in the list having its timeseries metrics associated with it. The - * stateDocument object provides the list of vertices while the statsAggregation object provides timeseries metrics. This function stitches the two together - * and returns the modified stateDocument object. + * stateDocument object provides the list of vertices while the statsAggregation object provides the latest metrics for each of these vertices. + * This function stitches the two together and returns the modified stateDocument object. * * @param {Object} stateDocument * @param {Object} statsAggregation * @param {Object} First and last seen timestamps for pipeline version we're getting data for * @param {Integer} timeseriesIntervalInSeconds The size of each timeseries bucket, in seconds */ -export function _enrichStateWithStatsAggregation(stateDocument, statsAggregation, { firstSeen, lastSeen }, timeseriesIntervalInSeconds) { +export function _enrichStateWithStatsAggregation(stateDocument, statsAggregation, timeseriesIntervalInSeconds) { const logstashState = stateDocument.logstash_state; const vertices = logstashState.pipeline.representation.graph.vertices; @@ -75,67 +67,27 @@ export function _enrichStateWithStatsAggregation(stateDocument, statsAggregation vertex.stats = {}; }); - // The statsAggregation object buckets by time first, then by vertex ID. However, the logstashState object (which is part of the - // stateDocument object) buckets by vertex ID first. The UI desires the latter structure so it can look up stats by vertex. So we - // transpose statsAggregation to bucket by vertex ID first, then by time. This then allows us to stitch the per-vertex timeseries stats - // from the transposed statsAggregation object onto the logstashState object. - const timeseriesBuckets = statsAggregation.timeseriesStats; - timeseriesBuckets.forEach(timeseriesBucket => { - // each bucket calculates stats for total pipeline CPU time for the associated timeseries - const totalDurationStats = timeseriesBucket.pipelines.scoped.total_processor_duration_stats; - const totalProcessorsDurationInMillis = totalDurationStats.max - totalDurationStats.min; + const totalDurationStats = statsAggregation.aggregations.pipelines.scoped.total_processor_duration_stats; + const totalProcessorsDurationInMillis = totalDurationStats.max - totalDurationStats.min; - // Each timeseriesBucket contains a list of vertices and their stats for a single timeseries interval - const timestamp = timeseriesBucket.key.time_bucket; - const vertexStatsByIdBuckets = get(timeseriesBucket, 'pipelines.scoped.vertices.vertex_id.buckets', []); + const verticesWithStatsBuckets = statsAggregation.aggregations.pipelines.scoped.vertices.vertex_id.buckets; + verticesWithStatsBuckets.forEach(vertexStatsBucket => { + // Each vertexStats bucket contains a list of stats for a single vertex within a single timeseries interval + const vertexId = vertexStatsBucket.key; + const vertex = verticesById[vertexId]; - vertexStatsByIdBuckets.forEach(vertexStatsBucket => { - // Each vertexStats bucket contains a list of stats for a single vertex within a single timeseries interval - const vertexId = vertexStatsBucket.key; - const vertex = verticesById[vertexId]; - - if (vertex !== undefined) { - // We extract this vertex's stats from vertexStatsBucket - const vertexStats = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); - - // For each stat (metric), we add it to the stats property of the vertex object in logstashState - const metrics = Object.keys(vertexStats); - metrics.forEach(metric => { - // Create metric object if it doesn't already exist - if (!vertex.stats.hasOwnProperty(metric)) { - vertex.stats[metric] = { - timeRange: { - min: firstSeen, - max: lastSeen - }, - data: [] - }; - } - - vertex.stats[metric].data.push([ timestamp, vertexStats[metric]]); - }); - } - }); + if (vertex !== undefined) { + // We extract this vertex's stats from vertexStatsBucket + vertex.stats = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); + } }); - return stateDocument.logstash_state; + return stateDocument.logstash_state.pipeline; } -export async function getPipeline(req, config, lsIndexPattern, clusterUuid, pipelineId, pipelineHash) { +export async function getPipeline(req, config, lsIndexPattern, clusterUuid, pipelineId, version) { checkParam(lsIndexPattern, 'lsIndexPattern in getPipeline'); - const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); - const versions = await getPipelineVersions(callWithRequest, req, config, lsIndexPattern, clusterUuid, pipelineId); - - let version; - if (pipelineHash) { - // Find version corresponding to given hash - version = versions.find(({ hash }) => hash === pipelineHash); - } else { - // Go with latest version - version = versions[0]; - } - const options = { clusterUuid, pipelineId, @@ -147,17 +99,13 @@ export async function getPipeline(req, config, lsIndexPattern, clusterUuid, pipe const timeseriesInterval = calculateTimeseriesInterval(version.firstSeen, version.lastSeen, minIntervalSeconds); const [ stateDocument, statsAggregation ] = await Promise.all([ - getPipelineStateDocument(callWithRequest, req, lsIndexPattern, options), - getPipelineStatsAggregation(callWithRequest, req, lsIndexPattern, timeseriesInterval, options) + getPipelineStateDocument(req, lsIndexPattern, options), + getPipelineStatsAggregation(req, lsIndexPattern, timeseriesInterval, options), ]); if (stateDocument === null) { return boom.notFound(`Pipeline [${pipelineId} @ ${version.hash}] not found in the selected time range for cluster [${clusterUuid}].`); } - const result = { - ..._enrichStateWithStatsAggregation(stateDocument, statsAggregation, version, timeseriesInterval), - versions - }; - return result; + return _enrichStateWithStatsAggregation(stateDocument, statsAggregation, timeseriesInterval); } diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_state_document.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_state_document.js index ccccb84ceb9a..eb88342eee06 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_state_document.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_state_document.js @@ -8,8 +8,10 @@ import { createQuery } from '../create_query'; import { LogstashMetric } from '../metrics'; import { get } from 'lodash'; -export async function getPipelineStateDocument(callWithRequest, req, logstashIndexPattern, +export async function getPipelineStateDocument(req, logstashIndexPattern, { clusterUuid, pipelineId, version }) { + + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); const filters = [ { term: { 'logstash_state.pipeline.id': pipelineId } }, { term: { 'logstash_state.pipeline.hash': version.hash } } @@ -32,6 +34,7 @@ export async function getPipelineStateDocument(callWithRequest, req, logstashInd size: 1, ignoreUnavailable: true, body: { + _source: { excludes: 'logstash_state.pipeline.representation.plugins' }, sort: { timestamp: { order: 'desc' } }, query, terminate_after: 1 // Safe to do because all these documents are functionally identical diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js index 49ca02e204ae..e59299f0bd67 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { get, last } from 'lodash'; import { createQuery } from '../create_query'; import { LogstashMetric } from '../metrics'; @@ -62,7 +61,6 @@ function nestedVertices(maxBucketSize) { ...scalarCounterAggregation('events_in', fieldPath, ephemeralIdField, maxBucketSize), ...scalarCounterAggregation('events_out', fieldPath, ephemeralIdField, maxBucketSize), ...scalarCounterAggregation('duration_in_millis', fieldPath, ephemeralIdField, maxBucketSize), - ...scalarCounterAggregation('queue_push_duration_in_millis', fieldPath, ephemeralIdField, maxBucketSize) } } } @@ -90,25 +88,21 @@ function createScopedAgg(pipelineId, pipelineHash, agg) { }; } -function createTimeseriesAggs(pipelineId, pipelineHash, maxBucketSize, timeseriesInterval, lastTimeBucket) { - return { - by_time: { - composite: { - sources: [ - { - time_bucket: { - date_histogram: { - field: 'logstash_stats.timestamp', - interval: timeseriesInterval + 's' - } - } - } - ], - after: { - time_bucket: lastTimeBucket - } - }, - aggs: createScopedAgg(pipelineId, pipelineHash, { +function fetchPipelineLatestStats(query, logstashIndexPattern, pipelineId, version, maxBucketSize, callWithRequest, req) { + const params = { + index: logstashIndexPattern, + size: 0, + ignoreUnavailable: true, + filterPath: [ + 'aggregations.pipelines.scoped.vertices.vertex_id.buckets.key', + 'aggregations.pipelines.scoped.vertices.vertex_id.buckets.events_in_total', + 'aggregations.pipelines.scoped.vertices.vertex_id.buckets.events_out_total', + 'aggregations.pipelines.scoped.vertices.vertex_id.buckets.duration_in_millis_total', + 'aggregations.pipelines.scoped.total_processor_duration_stats' + ], + body: { + query: query, + aggs: createScopedAgg(pipelineId, version.hash, { vertices: nestedVertices(maxBucketSize), total_processor_duration_stats: { stats: { @@ -118,34 +112,13 @@ function createTimeseriesAggs(pipelineId, pipelineHash, maxBucketSize, timeserie }) } }; -} - -function fetchPipelineTimeseriesStats(query, logstashIndexPattern, pipelineId, version, - maxBucketSize, timeseriesInterval, callWithRequest, req, lastTimeBucket = 0) { - const params = { - index: logstashIndexPattern, - size: 0, - ignoreUnavailable: true, - filterPath: [ - 'aggregations.by_time.buckets.key.time_bucket', - 'aggregations.by_time.buckets.pipelines.scoped.vertices.vertex_id.buckets.key', - 'aggregations.by_time.buckets.pipelines.scoped.vertices.vertex_id.buckets.events_in_total', - 'aggregations.by_time.buckets.pipelines.scoped.vertices.vertex_id.buckets.events_out_total', - 'aggregations.by_time.buckets.pipelines.scoped.vertices.vertex_id.buckets.duration_in_millis_total', - 'aggregations.by_time.buckets.pipelines.scoped.vertices.vertex_id.buckets.queue_push_duration_in_millis_total', - 'aggregations.by_time.buckets.pipelines.scoped.total_processor_duration_stats' - ], - body: { - query: query, - aggs: createTimeseriesAggs(pipelineId, version.hash, maxBucketSize, timeseriesInterval, lastTimeBucket) - } - }; return callWithRequest(req, 'search', params); } -export async function getPipelineStatsAggregation(callWithRequest, req, logstashIndexPattern, timeseriesInterval, +export function getPipelineStatsAggregation(req, logstashIndexPattern, timeseriesInterval, { clusterUuid, start, end, pipelineId, version }) { + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); const filters = [ { nested: { @@ -162,6 +135,9 @@ export async function getPipelineStatsAggregation(callWithRequest, req, logstash } ]; + start = version.lastSeen - (timeseriesInterval * 1000); + end = version.lastSeen; + const query = createQuery({ type: 'logstash_stats', start, @@ -173,24 +149,6 @@ export async function getPipelineStatsAggregation(callWithRequest, req, logstash const config = req.server.config(); - const timeBuckets = []; - let paginatedTimeBuckets; - do { - const lastTimeBucket = get(last(paginatedTimeBuckets), 'key.time_bucket', 0); - const paginatedResponse = await fetchPipelineTimeseriesStats(query, logstashIndexPattern, pipelineId, version, - config.get('xpack.monitoring.max_bucket_size'), timeseriesInterval, callWithRequest, req, lastTimeBucket); - - paginatedTimeBuckets = get(paginatedResponse, 'aggregations.by_time.buckets', []); - timeBuckets.push(...paginatedTimeBuckets); - } while (paginatedTimeBuckets.length > 0); - - // Drop the last bucket if it is partial (spoiler alert: this will be the case most of the time) - const lastTimeBucket = last(timeBuckets); - if (version.lastSeen - lastTimeBucket.key.time_bucket < timeseriesInterval * 1000) { - timeBuckets.pop(); - } - - return { - timeseriesStats: timeBuckets - }; + return fetchPipelineLatestStats(query, logstashIndexPattern, pipelineId, version, + config.get('xpack.monitoring.max_bucket_size'), callWithRequest, req); } diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js index b66aad3dcfcf..39b3df6220f0 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js @@ -10,8 +10,9 @@ import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; function fetchPipelineVersions(...args) { - const [ callWithRequest, req, config, logstashIndexPattern, clusterUuid, pipelineId ] = args; + const [ req, config, logstashIndexPattern, clusterUuid, pipelineId ] = args; checkParam(logstashIndexPattern, 'logstashIndexPattern in getPipelineVersions'); + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); const filters = [ { diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js new file mode 100644 index 000000000000..f0d3fc4008b3 --- /dev/null +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js @@ -0,0 +1,121 @@ +/* + * 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 boom from 'boom'; +import { get } from 'lodash'; +import { checkParam } from '../error_missing_required'; +import { getPipelineStateDocument } from './get_pipeline_state_document'; +import { getPipelineVertexStatsAggregation } from './get_pipeline_vertex_stats_aggregation'; +import { calculateTimeseriesInterval } from '../calculate_timeseries_interval'; + +export function _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds) { + + const isInput = vertex.plugin_type === 'input'; + const isProcessor = vertex.plugin_type === 'filter' || vertex.plugin_type === 'output'; + + const timeseriesIntervalInMillis = timeseriesIntervalInSeconds * 1000; + + const eventsInTotal = vertexStatsBucket.events_in_total.value; + const eventsOutTotal = get(vertexStatsBucket, 'events_out_total.value', null); + + const durationInMillis = vertexStatsBucket.duration_in_millis_total.value; + + const inputStats = {}; + const processorStats = {}; + const eventsProcessedStats = { + events_out_per_millisecond: eventsOutTotal / timeseriesIntervalInMillis + }; + + let eventsTotal; + + if (isInput) { + eventsTotal = eventsOutTotal; + inputStats.queue_push_duration_in_millis = vertexStatsBucket.queue_push_duration_in_millis_total.value; + inputStats.queue_push_duration_in_millis_per_event = inputStats.queue_push_duration_in_millis / eventsTotal; + } + + if (isProcessor) { + eventsTotal = eventsInTotal; + processorStats.percent_of_total_processor_duration = durationInMillis / totalProcessorsDurationInMillis; + eventsProcessedStats.events_in_per_millisecond = eventsInTotal / timeseriesIntervalInMillis; + } + + return { + events_in: eventsInTotal, + events_out: eventsOutTotal, + duration_in_millis: durationInMillis, + millis_per_event: durationInMillis / eventsTotal, + ...inputStats, + ...processorStats, + ...eventsProcessedStats + }; +} + +/** + * The UI needs a list of all vertices for the requested pipeline version, with each vertex in the list having its timeseries metrics associated with it. The + * stateDocument object provides the list of vertices while the statsAggregation object provides the timeseries metrics for each of these vertices. + * This function stitches the two together and returns the modified stateDocument object. + * + * @param {Object} stateDocument + * @param {Object} vertexStatsAggregation + * @param {Object} First and last seen timestamps for pipeline version we're getting data for + * @param {Integer} timeseriesIntervalInSeconds The size of each timeseries bucket, in seconds + */ +export function _enrichVertexStateWithStatsAggregation(stateDocument, vertexStatsAggregation, vertexId, timeseriesIntervalInSeconds) { + const logstashState = stateDocument.logstash_state; + const vertices = logstashState.pipeline.representation.graph.vertices; + + // First, filter out the vertex we care about + const vertex = vertices.find(v => v.id === vertexId); + vertex.stats = {}; + + // Next, iterate over timeseries metrics and attach them to vertex + const timeSeriesBuckets = vertexStatsAggregation.aggregations.timeseries.buckets; + timeSeriesBuckets.forEach(timeSeriesBucket => { + // each bucket calculates stats for total pipeline CPU time for the associated timeseries + const totalDurationStats = timeSeriesBucket.pipelines.scoped.total_processor_duration_stats; + const totalProcessorsDurationInMillis = totalDurationStats.max - totalDurationStats.min; + + const timestamp = timeSeriesBucket.key; + + const vertexStatsBucket = timeSeriesBucket.pipelines.scoped.vertices.vertex_id; + const vertexStats = _vertexStats(vertex, vertexStatsBucket, totalProcessorsDurationInMillis, timeseriesIntervalInSeconds); + Object.keys(vertexStats).forEach(stat => { + if (!vertex.stats.hasOwnProperty(stat)) { + vertex.stats[stat] = { data: [] }; + } + vertex.stats[stat].data.push([ timestamp, vertexStats[stat] ]); + }); + }); + + return vertex; +} + +export async function getPipelineVertex(req, config, lsIndexPattern, clusterUuid, pipelineId, version, vertexId) { + checkParam(lsIndexPattern, 'lsIndexPattern in getPipeline'); + + const options = { + clusterUuid, + pipelineId, + version, + vertexId + }; + + // Determine metrics' timeseries interval based on version's timespan + const minIntervalSeconds = config.get('xpack.monitoring.min_interval_seconds'); + const timeseriesInterval = calculateTimeseriesInterval(version.firstSeen, version.lastSeen, minIntervalSeconds); + + const [ stateDocument, statsAggregation ] = await Promise.all([ + getPipelineStateDocument(req, lsIndexPattern, options), + getPipelineVertexStatsAggregation(req, lsIndexPattern, timeseriesInterval, options), + ]); + + if (stateDocument === null) { + return boom.notFound(`Pipeline [${pipelineId} @ ${version.hash}] not found in the selected time range for cluster [${clusterUuid}].`); + } + + return _enrichVertexStateWithStatsAggregation(stateDocument, statsAggregation, vertexId, timeseriesInterval); +} diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js new file mode 100644 index 000000000000..5c80165e74bf --- /dev/null +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js @@ -0,0 +1,189 @@ +/* + * 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 { createQuery } from '../create_query'; +import { LogstashMetric } from '../metrics'; + +function scalarCounterAggregation(field, fieldPath, ephemeralIdField, maxBucketSize) { + const fullPath = `${fieldPath}.${field}`; + + const byEphemeralIdName = `${field}_temp_by_ephemeral_id`; + const sumName = `${field}_total`; + + const aggs = {}; + + aggs[byEphemeralIdName] = { + terms: { + field: ephemeralIdField, + size: maxBucketSize, + }, + aggs: { + stats: { + stats: { field: fullPath } + }, + difference: { + bucket_script: { + script: 'params.max - params.min', + buckets_path: { + min: 'stats.min', + max: 'stats.max' + } + } + } + } + }; + + aggs[sumName] = { + sum_bucket: { + buckets_path: `${byEphemeralIdName}>difference` + } + }; + + return aggs; +} + + +function createAggsObjectFromAggsList(aggsList) { + return aggsList.reduce((aggsSoFar, agg) => ({ ...aggsSoFar, ...agg }), {}); +} + +function createNestedVertexAgg(vertexId, maxBucketSize) { + const fieldPath = 'logstash_stats.pipelines.vertices'; + const ephemeralIdField = 'logstash_stats.pipelines.vertices.pipeline_ephemeral_id'; + + return { + vertices: { + nested: { path: 'logstash_stats.pipelines.vertices' }, + aggs: { + vertex_id: { + filter: { + term: { + 'logstash_stats.pipelines.vertices.id': vertexId + } + }, + aggs: { + ...scalarCounterAggregation('events_in', fieldPath, ephemeralIdField, maxBucketSize), + ...scalarCounterAggregation('events_out', fieldPath, ephemeralIdField, maxBucketSize), + ...scalarCounterAggregation('duration_in_millis', fieldPath, ephemeralIdField, maxBucketSize), + ...scalarCounterAggregation('queue_push_duration_in_millis', fieldPath, ephemeralIdField, maxBucketSize) + } + } + } + } + }; +} + +function createTotalProcessorDurationStatsAgg() { + return { + total_processor_duration_stats: { + stats: { + field: 'logstash_stats.pipelines.events.duration_in_millis' + } + } + }; +} + +function createScopedAgg(pipelineId, pipelineHash, ...aggsList) { + return { + pipelines: { + nested: { path: 'logstash_stats.pipelines' }, + aggs: { + scoped: { + filter: { + bool: { + filter: [ + { term: { 'logstash_stats.pipelines.id': pipelineId } }, + { term: { 'logstash_stats.pipelines.hash': pipelineHash } } + ] + } + }, + aggs: createAggsObjectFromAggsList(aggsList) + } + } + } + }; +} + +function createTimeSeriesAgg(timeSeriesIntervalInSeconds, ...aggsList) { + return { + timeseries: { + date_histogram: { + field: 'timestamp', + interval: timeSeriesIntervalInSeconds + 's' + }, + aggs: createAggsObjectFromAggsList(aggsList) + } + }; +} + +function fetchPipelineVertexTimeSeriesStats(query, logstashIndexPattern, pipelineId, version, vertexId, + timeSeriesIntervalInSeconds, maxBucketSize, callWithRequest, req) { + const aggs = { + ...createTimeSeriesAgg(timeSeriesIntervalInSeconds, + createScopedAgg(pipelineId, version.hash, + createNestedVertexAgg(vertexId, maxBucketSize), + createTotalProcessorDurationStatsAgg() + ) + ) + }; + + const params = { + index: logstashIndexPattern, + size: 0, + ignoreUnavailable: true, + filterPath: [ + 'aggregations.timeseries.buckets.key', + 'aggregations.timeseries.buckets.pipelines.scoped.vertices.vertex_id.events_in_total', + 'aggregations.timeseries.buckets.pipelines.scoped.vertices.vertex_id.events_out_total', + 'aggregations.timeseries.buckets.pipelines.scoped.vertices.vertex_id.duration_in_millis_total', + 'aggregations.timeseries.buckets.pipelines.scoped.vertices.vertex_id.queue_push_duration_in_millis_total', + 'aggregations.timeseries.buckets.pipelines.scoped.total_processor_duration_stats' + ], + body: { + query: query, + aggs + } + }; + + return callWithRequest(req, 'search', params); +} + +export function getPipelineVertexStatsAggregation(req, logstashIndexPattern, timeSeriesIntervalInSeconds, + { clusterUuid, start, end, pipelineId, version, vertexId }) { + const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); + const filters = [ + { + nested: { + path: 'logstash_stats.pipelines', + query: { + bool: { + must: [ + { term: { 'logstash_stats.pipelines.hash': version.hash } }, + { term: { 'logstash_stats.pipelines.id': pipelineId } }, + ] + } + } + } + } + ]; + + start = version.firstSeen; + end = version.lastSeen; + + const query = createQuery({ + type: 'logstash_stats', + start, + end, + metric: LogstashMetric.getMetricFields(), + clusterUuid, + filters + }); + + const config = req.server.config(); + + return fetchPipelineVertexTimeSeriesStats(query, logstashIndexPattern, pipelineId, version, vertexId, + timeSeriesIntervalInSeconds, config.get('xpack.monitoring.max_bucket_size'), callWithRequest, req); +} diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/logstash/pipeline.js b/x-pack/plugins/monitoring/server/routes/api/v1/logstash/pipeline.js index 433c48f02b3e..fdd9342cf9ea 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/logstash/pipeline.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/logstash/pipeline.js @@ -6,10 +6,18 @@ import Joi from 'joi'; import { handleError } from '../../../../lib/errors'; +import { getPipelineVersions } from '../../../../lib/logstash/get_pipeline_versions'; import { getPipeline } from '../../../../lib/logstash/get_pipeline'; +import { getPipelineVertex } from '../../../../lib/logstash/get_pipeline_vertex'; import { prefixIndexPattern } from '../../../../lib/ccs_utils'; import { INDEX_PATTERN_LOGSTASH } from '../../../../../common/constants'; +function getPipelineVersion(versions, pipelineHash) { + return pipelineHash + ? versions.find(({ hash }) => hash === pipelineHash) + : versions[0]; +} + /* * Logstash Pipeline route. */ @@ -34,22 +42,46 @@ export function logstashPipelineRoute(server) { pipelineHash: Joi.string().optional() }), payload: Joi.object({ - ccs: Joi.string().optional() + ccs: Joi.string().optional(), + detailVertexId: Joi.string().optional() }) } }, - handler: (req) => { + handler: async (req) => { const config = server.config(); const ccs = req.payload.ccs; const clusterUuid = req.params.clusterUuid; + const detailVertexId = req.payload.detailVertexId; const lsIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_LOGSTASH, ccs); const pipelineId = req.params.pipelineId; // Optional params default to empty string, set to null to be more explicit. const pipelineHash = req.params.pipelineHash || null; - return getPipeline(req, config, lsIndexPattern, clusterUuid, pipelineId, pipelineHash) - .catch(err => handleError(err, req)); + // Figure out which version of the pipeline we want to show + let versions; + try { + versions = await getPipelineVersions(req, config, lsIndexPattern, clusterUuid, pipelineId); + } catch (err) { + return handleError(err, req); + } + const version = getPipelineVersion(versions, pipelineHash); + + const promises = [ getPipeline(req, config, lsIndexPattern, clusterUuid, pipelineId, version) ]; + if (detailVertexId) { + promises.push(getPipelineVertex(req, config, lsIndexPattern, clusterUuid, pipelineId, version, detailVertexId)); + } + + try { + const [ pipeline, vertex ] = await Promise.all(promises); + return { + versions, + pipeline, + vertex + }; + } catch (err) { + return handleError(err, req); + } } }); } From e247609e8b525e0b6ea200b6e65ecb5e00be6ab9 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 26 Mar 2019 10:00:53 -0600 Subject: [PATCH 12/25] [Maps] split settings into layer and source panels (#33788) * [Maps] split settings into layer and source panels * fix SCSS import --- .../__snapshots__/view.test.js.snap | 7 +-- .../public/components/layer_panel/_index.scss | 2 +- .../__snapshots__/layer_errors.test.js.snap | 22 ++++++++ .../layer_panel/layer_errors/index.js | 18 ++++++ .../layer_panel/layer_errors/layer_errors.js | 37 +++++++++++++ .../layer_errors/layer_errors.test.js | 39 +++++++++++++ .../_layer_settings.scss} | 0 .../index.js | 8 +-- .../layer_settings.js} | 42 ++------------ .../source_settings.test.js.snap | 39 +++++++++++++ .../layer_panel/source_settings/index.js | 25 +++++++++ .../source_settings/source_settings.js | 55 +++++++++++++++++++ .../source_settings/source_settings.test.js | 42 ++++++++++++++ .../public/components/layer_panel/view.js | 15 ++++- .../components/layer_panel/view.test.js | 20 +++++-- 15 files changed, 317 insertions(+), 54 deletions(-) create mode 100644 x-pack/plugins/maps/public/components/layer_panel/layer_errors/__snapshots__/layer_errors.test.js.snap create mode 100644 x-pack/plugins/maps/public/components/layer_panel/layer_errors/index.js create mode 100644 x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.js create mode 100644 x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.test.js rename x-pack/plugins/maps/public/components/layer_panel/{settings_panel/_settings_panel.scss => layer_settings/_layer_settings.scss} (100%) rename x-pack/plugins/maps/public/components/layer_panel/{settings_panel => layer_settings}/index.js (79%) rename x-pack/plugins/maps/public/components/layer_panel/{settings_panel/settings_panel.js => layer_settings/layer_settings.js} (78%) create mode 100644 x-pack/plugins/maps/public/components/layer_panel/source_settings/__snapshots__/source_settings.test.js.snap create mode 100644 x-pack/plugins/maps/public/components/layer_panel/source_settings/index.js create mode 100644 x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.js create mode 100644 x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.test.js diff --git a/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap b/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap index 1774258d9983..d260aebd67d5 100644 --- a/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap +++ b/x-pack/plugins/maps/public/components/layer_panel/__snapshots__/view.test.js.snap @@ -82,10 +82,9 @@ exports[`LayerPanel is rendered 1`] = ` - - + + + + +

    + simulated layer error +

    +
    + + +`; + +exports[`should render nothing when layer has no errors 1`] = `""`; diff --git a/x-pack/plugins/maps/public/components/layer_panel/layer_errors/index.js b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/index.js new file mode 100644 index 000000000000..21ff81e32f60 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/index.js @@ -0,0 +1,18 @@ +/* + * 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 { connect } from 'react-redux'; +import { LayerErrors } from './layer_errors'; +import { getSelectedLayer } from '../../../selectors/map_selectors'; + +function mapStateToProps(state = {}) { + return { + layer: getSelectedLayer(state) + }; +} + +const connectedLayerErrors = connect(mapStateToProps, null)(LayerErrors); +export { connectedLayerErrors as LayerErrors }; diff --git a/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.js b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.js new file mode 100644 index 000000000000..755a1ed39ff8 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.js @@ -0,0 +1,37 @@ +/* + * 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, { Fragment } from 'react'; +import { i18n } from '@kbn/i18n'; +import { + EuiCallOut, + EuiSpacer, +} from '@elastic/eui'; + +export function LayerErrors({ layer }) { + + if (!layer.hasErrors()) { + return null; + } + + return ( + + +

    + {layer.getErrors()} +

    +
    + +
    + ); +} diff --git a/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.test.js b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.test.js new file mode 100644 index 000000000000..fd2b8540bee1 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/layer_errors/layer_errors.test.js @@ -0,0 +1,39 @@ +/* + * 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 { LayerErrors } from './layer_errors'; + +test('Should render errors when layer has errors', () => { + const mockLayer = { + hasErrors: () => { return true; }, + getErrors: () => { return 'simulated layer error'; } + }; + const component = shallow( + + ); + + expect(component) + .toMatchSnapshot(); +}); + +test('should render nothing when layer has no errors', () => { + const mockLayer = { + hasErrors: () => { return false; }, + }; + const component = shallow( + + ); + + expect(component) + .toMatchSnapshot(); +}); diff --git a/x-pack/plugins/maps/public/components/layer_panel/settings_panel/_settings_panel.scss b/x-pack/plugins/maps/public/components/layer_panel/layer_settings/_layer_settings.scss similarity index 100% rename from x-pack/plugins/maps/public/components/layer_panel/settings_panel/_settings_panel.scss rename to x-pack/plugins/maps/public/components/layer_panel/layer_settings/_layer_settings.scss diff --git a/x-pack/plugins/maps/public/components/layer_panel/settings_panel/index.js b/x-pack/plugins/maps/public/components/layer_panel/layer_settings/index.js similarity index 79% rename from x-pack/plugins/maps/public/components/layer_panel/settings_panel/index.js rename to x-pack/plugins/maps/public/components/layer_panel/layer_settings/index.js index b82e2e0e62a2..e0a127515521 100644 --- a/x-pack/plugins/maps/public/components/layer_panel/settings_panel/index.js +++ b/x-pack/plugins/maps/public/components/layer_panel/layer_settings/index.js @@ -5,14 +5,13 @@ */ import { connect } from 'react-redux'; -import { SettingsPanel } from './settings_panel'; +import { LayerSettings } from './layer_settings'; import { getSelectedLayer } from '../../../selectors/map_selectors'; import { updateLayerLabel, updateLayerMaxZoom, updateLayerMinZoom, updateLayerAlpha, - updateSourceProp, } from '../../../actions/store_actions'; function mapStateToProps(state = {}) { @@ -33,9 +32,8 @@ function mapDispatchToProps(dispatch) { updateMinZoom: (id, minZoom) => dispatch(updateLayerMinZoom(id, minZoom)), updateMaxZoom: (id, maxZoom) => dispatch(updateLayerMaxZoom(id, maxZoom)), updateAlpha: (id, alpha) => dispatch(updateLayerAlpha(id, alpha)), - updateSourceProp: (id, propName, value) => dispatch(updateSourceProp(id, propName, value)), }; } -const connectedSettingsPanel = connect(mapStateToProps, mapDispatchToProps)(SettingsPanel); -export { connectedSettingsPanel as SettingsPanel }; +const connectedLayerSettings = connect(mapStateToProps, mapDispatchToProps)(LayerSettings); +export { connectedLayerSettings as LayerSettings }; diff --git a/x-pack/plugins/maps/public/components/layer_panel/settings_panel/settings_panel.js b/x-pack/plugins/maps/public/components/layer_panel/layer_settings/layer_settings.js similarity index 78% rename from x-pack/plugins/maps/public/components/layer_panel/settings_panel/settings_panel.js rename to x-pack/plugins/maps/public/components/layer_panel/layer_settings/layer_settings.js index 61563f4375af..0a01498986e9 100644 --- a/x-pack/plugins/maps/public/components/layer_panel/settings_panel/settings_panel.js +++ b/x-pack/plugins/maps/public/components/layer_panel/layer_settings/layer_settings.js @@ -14,7 +14,6 @@ import { EuiFormRow, EuiFieldText, EuiSpacer, - EuiCallOut } from '@elastic/eui'; import { ValidatedRange } from '../../../shared/components/validated_range'; @@ -25,7 +24,7 @@ import { ValidatedDualRange } from 'ui/validated_range'; const MIN_ZOOM = 0; const MAX_ZOOM = 24; -export function SettingsPanel(props) { +export function LayerSettings(props) { const onLabelChange = (event) => { const label = event.target.value; @@ -41,34 +40,6 @@ export function SettingsPanel(props) { props.updateAlpha(props.layerId, alpha); }; - const onSourceChange = ({ propName, value }) => { - props.updateSourceProp(props.layerId, propName, value); - }; - - const renderLayerErrors = () => { - if (!props.layer.hasErrors()) { - return null; - } - - return ( - - -

    - {props.layer.getErrors()} -

    -
    - -
    - ); - }; - const renderZoomSliders = () => { return ( - - {renderLayerErrors()} -
    @@ -170,9 +138,9 @@ export function SettingsPanel(props) { {renderZoomSliders()} {renderAlphaSlider()} - - {props.layer.renderSourceSettingsEditor({ onChange: onSourceChange })}
    + + ); } diff --git a/x-pack/plugins/maps/public/components/layer_panel/source_settings/__snapshots__/source_settings.test.js.snap b/x-pack/plugins/maps/public/components/layer_panel/source_settings/__snapshots__/source_settings.test.js.snap new file mode 100644 index 000000000000..48af4ec7286c --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/source_settings/__snapshots__/source_settings.test.js.snap @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Should render source settings editor 1`] = ` + + + + + +
    + +
    +
    +
    +
    + +
    + mockSourceEditor +
    +
    + +
    +`; + +exports[`should render nothing when source has no editor 1`] = `""`; diff --git a/x-pack/plugins/maps/public/components/layer_panel/source_settings/index.js b/x-pack/plugins/maps/public/components/layer_panel/source_settings/index.js new file mode 100644 index 000000000000..04885c5b5c48 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/source_settings/index.js @@ -0,0 +1,25 @@ +/* + * 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 { connect } from 'react-redux'; +import { SourceSettings } from './source_settings'; +import { getSelectedLayer } from '../../../selectors/map_selectors'; +import { updateSourceProp } from '../../../actions/store_actions'; + +function mapStateToProps(state = {}) { + return { + layer: getSelectedLayer(state) + }; +} + +function mapDispatchToProps(dispatch) { + return { + updateSourceProp: (id, propName, value) => dispatch(updateSourceProp(id, propName, value)), + }; +} + +const connectedSourceSettings = connect(mapStateToProps, mapDispatchToProps)(SourceSettings); +export { connectedSourceSettings as SourceSettings }; diff --git a/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.js b/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.js new file mode 100644 index 000000000000..6a1a75327427 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.js @@ -0,0 +1,55 @@ +/* + * 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, { Fragment } from 'react'; + +import { + EuiFlexGroup, + EuiFlexItem, + EuiTitle, + EuiPanel, + EuiSpacer, +} from '@elastic/eui'; + +import { FormattedMessage } from '@kbn/i18n/react'; + +export function SourceSettings({ layer, updateSourceProp }) { + + const onSourceChange = ({ propName, value }) => { + updateSourceProp(layer.getId(), propName, value); + }; + + const sourceSettingsEditor = layer.renderSourceSettingsEditor({ onChange: onSourceChange }); + + if (!sourceSettingsEditor) { + return null; + } + + return ( + + + + + +
    + +
    +
    +
    +
    + + + + {sourceSettingsEditor} +
    + + +
    + ); +} diff --git a/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.test.js b/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.test.js new file mode 100644 index 000000000000..090d30054ba8 --- /dev/null +++ b/x-pack/plugins/maps/public/components/layer_panel/source_settings/source_settings.test.js @@ -0,0 +1,42 @@ +/* + * 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 { SourceSettings } from './source_settings'; + +test('Should render source settings editor', () => { + const mockLayer = { + renderSourceSettingsEditor: () => { + return (
    mockSourceEditor
    ); + }, + }; + const component = shallow( + + ); + + expect(component) + .toMatchSnapshot(); +}); + +test('should render nothing when source has no editor', () => { + const mockLayer = { + renderSourceSettingsEditor: () => { + return null; + }, + }; + const component = shallow( + + ); + + expect(component) + .toMatchSnapshot(); +}); diff --git a/x-pack/plugins/maps/public/components/layer_panel/view.js b/x-pack/plugins/maps/public/components/layer_panel/view.js index 36e4ac6f484f..20a5a2669484 100644 --- a/x-pack/plugins/maps/public/components/layer_panel/view.js +++ b/x-pack/plugins/maps/public/components/layer_panel/view.js @@ -9,7 +9,9 @@ import React, { Fragment } from 'react'; import { StyleTabs } from './style_tabs'; import { JoinEditor } from './join_editor'; import { FlyoutFooter } from './flyout_footer'; -import { SettingsPanel } from './settings_panel'; +import { LayerErrors } from './layer_errors'; +import { LayerSettings } from './layer_settings'; +import { SourceSettings } from './source_settings'; import { EuiButtonIcon, EuiFlexItem, @@ -175,10 +177,17 @@ export class LayerPanel extends React.Component { - - + + + + + + + {this._renderJoinSection()} + + diff --git a/x-pack/plugins/maps/public/components/layer_panel/view.test.js b/x-pack/plugins/maps/public/components/layer_panel/view.test.js index 200345bf92b7..6a5208ce13c0 100644 --- a/x-pack/plugins/maps/public/components/layer_panel/view.test.js +++ b/x-pack/plugins/maps/public/components/layer_panel/view.test.js @@ -22,9 +22,21 @@ jest.mock('./flyout_footer', () => ({ } })); -jest.mock('./settings_panel', () => ({ - SettingsPanel: () => { - return (
    mockSettingsPanel
    ); +jest.mock('./layer_errors', () => ({ + LayerErrors: () => { + return (
    mockLayerErrors
    ); + } +})); + +jest.mock('./layer_settings', () => ({ + LayerSettings: () => { + return (
    mockLayerSettings
    ); + } +})); + +jest.mock('./source_settings', () => ({ + SourceSettings: () => { + return (
    mockSourceSettings
    ); } })); @@ -42,7 +54,7 @@ const mockLayer = { ]; }, isJoinable: () => { return true; }, - getLayerTypeIconName: () => { return 'vector'; } + getLayerTypeIconName: () => { return 'vector'; }, }; const defaultProps = { From 369f0f2922ffb3cb5243dffebe8e4e209ac579e3 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Mar 2019 11:20:41 -0500 Subject: [PATCH 13/25] [env] exit if starting as root (#21563) * [env] exit if starting as root * fix windows * s/--allow-root --- src/setup_node_env/index.js | 1 + src/setup_node_env/root/force.js | 25 ++++++++++++++++ src/setup_node_env/root/force.test.js | 39 +++++++++++++++++++++++++ src/setup_node_env/root/index.js | 28 ++++++++++++++++++ src/setup_node_env/root/is_root.js | 22 ++++++++++++++ src/setup_node_env/root/is_root.test.js | 32 ++++++++++++++++++++ 6 files changed, 147 insertions(+) create mode 100644 src/setup_node_env/root/force.js create mode 100644 src/setup_node_env/root/force.test.js create mode 100644 src/setup_node_env/root/index.js create mode 100644 src/setup_node_env/root/is_root.js create mode 100644 src/setup_node_env/root/is_root.test.js diff --git a/src/setup_node_env/index.js b/src/setup_node_env/index.js index 6592fa9fd242..a3fe8d938ba2 100644 --- a/src/setup_node_env/index.js +++ b/src/setup_node_env/index.js @@ -17,5 +17,6 @@ * under the License. */ +require('./root'); require('./node_version_validator'); require('./babel_register'); diff --git a/src/setup_node_env/root/force.js b/src/setup_node_env/root/force.js new file mode 100644 index 000000000000..5c5370aec6b1 --- /dev/null +++ b/src/setup_node_env/root/force.js @@ -0,0 +1,25 @@ +/* + * 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. + */ + +module.exports = function (argv) { + var rootIndex = argv.indexOf('--allow-root'); + var force = rootIndex >= 0; + if (force) argv.splice(rootIndex, 1); + return force; +}; diff --git a/src/setup_node_env/root/force.test.js b/src/setup_node_env/root/force.test.js new file mode 100644 index 000000000000..df013349e57e --- /dev/null +++ b/src/setup_node_env/root/force.test.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +var forceRoot = require('./force'); + +describe('forceRoot', function () { + + it('with flag', function () { + expect(forceRoot(['--allow-root'])).toBeTruthy(); + }); + + it('without flag', function () { + expect(forceRoot(['--foo'])).toBeFalsy(); + + }); + + test('remove argument', function () { + var args = ['--allow-root', 'foo']; + forceRoot(args); + expect(args.includes('--allow-root')).toBeFalsy(); + }); + +}); diff --git a/src/setup_node_env/root/index.js b/src/setup_node_env/root/index.js new file mode 100644 index 000000000000..5a402dfcb4ee --- /dev/null +++ b/src/setup_node_env/root/index.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +var force = require('./force')(process.argv); + +var uid = process.getuid && process.getuid(); +var isRoot = require('./is_root')(uid); + +if(isRoot && !force) { + console.error('Kibana should not be run as root. Use --allow-root to continue.'); + process.exit(1); +} diff --git a/src/setup_node_env/root/is_root.js b/src/setup_node_env/root/is_root.js new file mode 100644 index 000000000000..e2eaaf6af515 --- /dev/null +++ b/src/setup_node_env/root/is_root.js @@ -0,0 +1,22 @@ +/* + * 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. + */ + +module.exports = function (uid) { + return uid === 0; +}; diff --git a/src/setup_node_env/root/is_root.test.js b/src/setup_node_env/root/is_root.test.js new file mode 100644 index 000000000000..a976299cd5d5 --- /dev/null +++ b/src/setup_node_env/root/is_root.test.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +var isRoot = require('./is_root'); + + +describe('isRoot', function () { + + test('0 is root', function () { + expect(isRoot(0)).toBeTruthy(); + }); + + test('not 0 is not root', function () { + expect(isRoot(5)).toBeFalsy(); + }); +}); From f5010cc8e6122eb89a507e34e0d89c28febe7728 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Tue, 26 Mar 2019 12:31:10 -0400 Subject: [PATCH 14/25] Typescript sample panel action (#33602) * Typescript sample panel action * Update EUI version to match main cabana version * update yarn.lock * add back typings include * use correct relative path --- package.json | 3 +-- src/dev/typescript/projects.ts | 3 +++ .../embeddable/context_menu_actions/index.ts | 1 + .../{index.js => index.ts} | 16 +++++++----- .../kbn_tp_sample_panel_action/package.json | 13 ++++++++-- ...anel_action.js => sample_panel_action.tsx} | 10 ++++--- ...ple_panel_link.js => sample_panel_link.ts} | 10 +++---- .../kbn_tp_sample_panel_action/tsconfig.json | 14 ++++++++++ test/scripts/jenkins_ci_group.sh | 6 ++++- test/tsconfig.json | 6 ++++- yarn.lock | 26 +++++++++++++++++++ 11 files changed, 87 insertions(+), 21 deletions(-) rename test/plugin_functional/plugins/kbn_tp_sample_panel_action/{index.js => index.ts} (75%) rename test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/{sample_panel_action.js => sample_panel_action.tsx} (93%) rename test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/{sample_panel_link.js => sample_panel_link.ts} (90%) create mode 100644 test/plugin_functional/plugins/kbn_tp_sample_panel_action/tsconfig.json diff --git a/package.json b/package.json index 30bd3f9d5289..43f6c6704c60 100644 --- a/package.json +++ b/package.json @@ -90,8 +90,7 @@ "**/@types/*/**", "**/grunt-*", "**/grunt-*/**", - "x-pack/typescript", - "kbn_tp_*/**" + "x-pack/typescript" ] }, "dependencies": { diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index 540441ab6b8d..7ef3419751be 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -35,6 +35,9 @@ export const PROJECTS = [ ...glob .sync('packages/*/tsconfig.json', { cwd: REPO_ROOT }) .map(path => new Project(resolve(REPO_ROOT, path))), + ...glob + .sync('test/plugin_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) + .map(path => new Project(resolve(REPO_ROOT, path))), ]; export function filterProjectsByFlag(projectFlag?: string) { diff --git a/src/legacy/ui/public/embeddable/context_menu_actions/index.ts b/src/legacy/ui/public/embeddable/context_menu_actions/index.ts index 152fdee9f7ff..d43f1d16aefd 100644 --- a/src/legacy/ui/public/embeddable/context_menu_actions/index.ts +++ b/src/legacy/ui/public/embeddable/context_menu_actions/index.ts @@ -21,3 +21,4 @@ export { ContextMenuPanel } from './context_menu_panel'; export { ContextMenuAction } from './context_menu_action'; export { ContextMenuActionsRegistryProvider } from './context_menu_actions_registry'; export { buildEuiContextMenuPanels } from './build_eui_context_menu_panels'; +export { PanelActionAPI } from './types'; diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.js b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.ts similarity index 75% rename from test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.js rename to test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.ts index c4aaaa857cec..dd069010e074 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.js +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/index.ts @@ -17,8 +17,15 @@ * under the License. */ -function samplePanelAction(kibana) { +import { resolve } from 'path'; + +// TODO: use something better once https://github.com/elastic/kibana/issues/26555 is +// figured out. +type KibanaPlugin = any; + +function samplePanelAction(kibana: KibanaPlugin) { return new kibana.Plugin({ + publicDir: resolve(__dirname, './public'), uiExports: { contextMenuActions: [ 'plugins/kbn_tp_sample_panel_action/sample_panel_action', @@ -28,9 +35,6 @@ function samplePanelAction(kibana) { }); } -module.exports = function (kibana) { - return [ - samplePanelAction(kibana), - ]; +module.exports = (kibana: KibanaPlugin) => { + return [samplePanelAction(kibana)]; }; - diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index ae68ac4f5c54..462f5448d7cf 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -1,13 +1,22 @@ { "name": "kbn_tp_sample_panel_action", "version": "1.0.0", + "main":"target/test/plugin_functional/plugins/kbn_tp_sample_panel_action", "kibana": { "version": "kibana", "templateVersion": "1.0.0" }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "9.4.0", + "@elastic/eui": "9.4.2", "react": "^16.8.0" + }, + "scripts": { + "kbn": "node ../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "@kbn/plugin-helpers" : "9.0.2", + "typescript": "^3.3.3333" } -} +} \ No newline at end of file diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.js b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx similarity index 93% rename from test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.js rename to test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx index 1310ff027e35..41c867b5526d 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.js +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_action.tsx @@ -23,6 +23,7 @@ import { openFlyout } from 'ui/flyout'; import { ContextMenuAction, ContextMenuActionsRegistryProvider, + PanelActionAPI, } from 'ui/embeddable'; class SamplePanelAction extends ContextMenuAction { @@ -33,7 +34,10 @@ class SamplePanelAction extends ContextMenuAction { parentPanelId: 'mainMenu', }); } - onClick({ embeddable }) { + public onClick = ({ embeddable }: PanelActionAPI) => { + if (!embeddable) { + return; + } openFlyout( @@ -47,9 +51,9 @@ class SamplePanelAction extends ContextMenuAction { , { 'data-test-subj': 'samplePanelActionFlyout', - }, + } ); - } + }; } ContextMenuActionsRegistryProvider.register(() => new SamplePanelAction()); diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.js b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts similarity index 90% rename from test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.js rename to test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts index 0b99b7eadb3c..7092c783125d 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.js +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/public/sample_panel_link.ts @@ -16,10 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { - ContextMenuAction, - ContextMenuActionsRegistryProvider, -} from 'ui/embeddable'; +import { ContextMenuAction, ContextMenuActionsRegistryProvider } from 'ui/embeddable'; class SamplePanelLink extends ContextMenuAction { constructor() { @@ -29,9 +26,10 @@ class SamplePanelLink extends ContextMenuAction { parentPanelId: 'mainMenu', }); } - getHref() { + + public getHref = () => { return 'https://example.com/kibana/test'; - } + }; } ContextMenuActionsRegistryProvider.register(() => new SamplePanelLink()); diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/tsconfig.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/tsconfig.json new file mode 100644 index 000000000000..aba7203377af --- /dev/null +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "../../../../typings/**/*", + ], + "exclude": [] +} \ No newline at end of file diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index c9eec36cdc74..a4bc597316dc 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -22,6 +22,10 @@ export TEST_BROWSER_HEADLESS=1 "$(FORCE_COLOR=0 yarn bin)/grunt" "run:functionalTests_ciGroup${CI_GROUP}"; if [ "$CI_GROUP" == "1" ]; then - "$(FORCE_COLOR=0 yarn bin)/grunt" run:pluginFunctionalTestsRelease; + # build kbn_tp_sample_panel_action + cd test/plugin_functional/plugins/kbn_tp_sample_panel_action; + yarn build; + cd -; + "$(FORCE_COLOR=0 yarn bin)/grunt" run:pluginFunctionalTestsRelease --from=source; "$(FORCE_COLOR=0 yarn bin)/grunt" run:interpreterFunctionalTestsRelease; fi diff --git a/test/tsconfig.json b/test/tsconfig.json index 5df729fbde21..d620d28f3d1d 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -7,6 +7,10 @@ ] }, "include": [ - "**/*.ts" + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "plugin_functional/plugins/**/*" ] } diff --git a/yarn.lock b/yarn.lock index 1bd209686838..e15a2219367b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -822,6 +822,32 @@ tabbable "^1.1.0" uuid "^3.1.0" +"@elastic/eui@9.4.2": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-9.4.2.tgz#530ec18f9b1cb3972824a707cc0cb3005c6c5028" + integrity sha512-2fH+WiYYq1tPn5mEvg5NR5b9TjVYY0cM26HPERMRMZyAenGFQtjhansO8qFlTl/MAYz5GsQ7ejgdtzu095opdw== + dependencies: + "@types/lodash" "^4.14.116" + "@types/numeral" "^0.0.25" + classnames "^2.2.5" + core-js "^2.5.1" + highlight.js "^9.12.0" + html "^1.0.0" + keymirror "^0.1.1" + lodash "^4.17.11" + numeral "^2.0.6" + prop-types "^15.6.0" + react-ace "^5.5.0" + react-color "^2.13.8" + react-focus-lock "^1.17.7" + react-input-autosize "^2.2.1" + react-is "~16.3.0" + react-virtualized "^9.18.5" + react-vis "1.10.2" + resize-observer-polyfill "^1.5.0" + tabbable "^1.1.0" + uuid "^3.1.0" + "@elastic/eui@9.5.0": version "9.5.0" resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-9.5.0.tgz#233b4722b0cd2506793472ec1c6b97640a365229" From 57c7572367d658d2ee3707ba6925ac05aac3fdb4 Mon Sep 17 00:00:00 2001 From: Philipp B Date: Tue, 26 Mar 2019 19:40:58 +0300 Subject: [PATCH 15/25] Home page "recent links" should communicate saved object type #21896 (#33694) * adds object type for screen order * adds object type for pointer hovering * Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx Co-Authored-By: rockfield --- .../header_global_nav/components/header.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx index d8426805f57b..d8aec7997fdb 100644 --- a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx +++ b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx @@ -54,6 +54,7 @@ import { HeaderBreadcrumbs } from './header_breadcrumbs'; import { HeaderHelpMenu } from './header_help_menu'; import { HeaderNavControls } from './header_nav_controls'; +import { i18n } from '@kbn/i18n'; import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import chrome, { NavLink } from 'ui/chrome'; import { HelpExtension } from 'ui/chrome'; @@ -88,10 +89,23 @@ function extendRecentlyAccessedHistoryItem( const href = relativeToAbsolute(chrome.addBasePath(recentlyAccessed.link)); const navLink = navLinks.find(nl => href.startsWith(nl.subUrlBase)); + let titleAndAriaLabel = recentlyAccessed.label; + if (navLink) { + const objectTypeForAriaAppendix = navLink.title; + titleAndAriaLabel = i18n.translate('common.ui.recentLinks.linkItem.screenReaderLabel', { + defaultMessage: '{recentlyAccessedItemLinklabel}, type: {pageType}', + values: { + recentlyAccessedItemLinklabel: recentlyAccessed.label, + pageType: objectTypeForAriaAppendix, + }, + }); + } + return { ...recentlyAccessed, href, euiIconType: navLink ? navLink.euiIconType : undefined, + title: titleAndAriaLabel, }; } @@ -248,9 +262,8 @@ class HeaderUI extends Component { }), listItems: recentlyAccessed.map(item => ({ label: truncateRecentItemLabel(item.label), - // TODO: Add what type of app/saved object to title attr - title: `${item.label}`, - 'aria-label': item.label, + title: item.title, + 'aria-label': item.title, href: item.href, iconType: item.euiIconType, })), From 5ad1ee5edb1bfced716ad5223bddd07b9771056a Mon Sep 17 00:00:00 2001 From: Lukas Olson Date: Tue, 26 Mar 2019 12:18:01 -0700 Subject: [PATCH 16/25] Update advanced setting description. Closes #30753 --- src/legacy/core_plugins/kibana/ui_setting_defaults.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/legacy/core_plugins/kibana/ui_setting_defaults.js b/src/legacy/core_plugins/kibana/ui_setting_defaults.js index de8fdd9dabdb..55cdc3e38e7f 100644 --- a/src/legacy/core_plugins/kibana/ui_setting_defaults.js +++ b/src/legacy/core_plugins/kibana/ui_setting_defaults.js @@ -323,8 +323,8 @@ export function getUiSettingDefaults() { description: i18n.translate('kbn.advancedSettings.courier.ignoreFilterText', { defaultMessage: 'This configuration enhances support for dashboards containing visualizations accessing dissimilar indexes. ' + - 'When set to false, all filters are applied to all visualizations. ' + - 'When set to true, filter(s) will be ignored for a visualization ' + + 'When disabled, all filters are applied to all visualizations. ' + + 'When enabled, filter(s) will be ignored for a visualization ' + `when the visualization's index does not contain the filtering field.`, }), category: ['search'], From e24cef3f78129a4f6271f62790d75315fd7314fa Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Mar 2019 14:45:35 -0500 Subject: [PATCH 17/25] Docs/gettingstarted (#32145) (#32218) * Docs/gettingstarted (#32145) * [docs/getting started] remove types * update urls * one primary shard * Update docs/getting-started/tutorial-load-dataset.asciidoc Co-Authored-By: jbudz * dedupe * Update tutorial-load-dataset.asciidoc --- .../tutorial-load-dataset.asciidoc | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/docs/getting-started/tutorial-load-dataset.asciidoc b/docs/getting-started/tutorial-load-dataset.asciidoc index d23d50baed66..c7c12199633a 100644 --- a/docs/getting-started/tutorial-load-dataset.asciidoc +++ b/docs/getting-started/tutorial-load-dataset.asciidoc @@ -3,12 +3,16 @@ This tutorial requires three data sets: -* The complete works of William Shakespeare, suitably parsed into fields. Download - https://download.elastic.co/demos/kibana/gettingstarted/shakespeare_6.0.json[`shakespeare.json`]. -* A set of fictitious accounts with randomly generated data. Download - https://download.elastic.co/demos/kibana/gettingstarted/accounts.zip[`accounts.zip`]. -* A set of randomly generated log files. Download - https://download.elastic.co/demos/kibana/gettingstarted/logs.jsonl.gz[`logs.jsonl.gz`]. +* The complete works of William Shakespeare, suitably parsed into fields +* A set of fictitious accounts with randomly generated data +* A set of randomly generated log files + +Create a new working directory where you want to download the files. From that directory, run the following commands: + +[source,shell] +curl -O https://download.elastic.co/demos/kibana/gettingstarted/8.x/shakespeare.json +curl -O https://download.elastic.co/demos/kibana/gettingstarted/8.x/accounts.zip +curl -O https://download.elastic.co/demos/kibana/gettingstarted/8.x/logs.jsonl.gz Two of the data sets are compressed. To extract the files, use these commands: @@ -73,16 +77,14 @@ In Kibana *Dev Tools > Console*, set up a mapping for the Shakespeare data set: [source,js] PUT /shakespeare { - "mappings": { - "doc": { - "properties": { + "mappings": { + "properties": { "speaker": {"type": "keyword"}, "play_name": {"type": "keyword"}, "line_id": {"type": "integer"}, "speech_number": {"type": "integer"} - } + } } - } } //CONSOLE @@ -100,13 +102,11 @@ as geographic locations by applying the `geo_point` type. PUT /logstash-2015.05.18 { "mappings": { - "log": { - "properties": { - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - } + "properties": { + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" } } } @@ -120,13 +120,11 @@ PUT /logstash-2015.05.18 PUT /logstash-2015.05.19 { "mappings": { - "log": { - "properties": { - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - } + "properties": { + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" } } } @@ -140,13 +138,11 @@ PUT /logstash-2015.05.19 PUT /logstash-2015.05.20 { "mappings": { - "log": { - "properties": { - "geo": { - "properties": { - "coordinates": { - "type": "geo_point" - } + "properties": { + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" } } } @@ -165,13 +161,13 @@ API to load the data sets: [source,shell] curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json -curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json +curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/_bulk?pretty' --data-binary @shakespeare.json curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @logs.jsonl Or for Windows users, in Powershell: [source,shell] Invoke-RestMethod "http://localhost:9200/bank/account/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "accounts.json" -Invoke-RestMethod "http://localhost:9200/shakespeare/doc/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "shakespeare_6.0.json" +Invoke-RestMethod "http://localhost:9200/shakespeare/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "shakespeare.json" Invoke-RestMethod "http://localhost:9200/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "logs.jsonl" These commands might take some time to execute, depending on the available computing resources. @@ -187,8 +183,8 @@ Your output should look similar to this: [source,shell] health status index pri rep docs.count docs.deleted store.size pri.store.size -yellow open bank 5 1 1000 0 418.2kb 418.2kb -yellow open shakespeare 5 1 111396 0 17.6mb 17.6mb -yellow open logstash-2015.05.18 5 1 4631 0 15.6mb 15.6mb -yellow open logstash-2015.05.19 5 1 4624 0 15.7mb 15.7mb -yellow open logstash-2015.05.20 5 1 4750 0 16.4mb 16.4mb +yellow open bank 1 1 1000 0 418.2kb 418.2kb +yellow open shakespeare 1 1 111396 0 17.6mb 17.6mb +yellow open logstash-2015.05.18 1 1 4631 0 15.6mb 15.6mb +yellow open logstash-2015.05.19 1 1 4624 0 15.7mb 15.7mb +yellow open logstash-2015.05.20 1 1 4750 0 16.4mb 16.4mb From 4a1e7a86fb6b2be4a7ec28fc4ac7d58283f87697 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Tue, 26 Mar 2019 16:17:02 -0400 Subject: [PATCH 18/25] [ML] Anomaly explorer add/remove filter via Top influencers list (#33626) * Add filter icons in Top influencers list * move entity component to own dir * upadte function name to applyFilter * add fix for IE overflow in anomalies table * update path to entityCell in test * Remove IE11 specific style * Update entityCell design for table+InfluencerList * Add entityCell component tests * remove injectI18n dep --- .../anomalies_table/_anomalies_table.scss | 19 --- .../anomalies_table/anomalies_table.test.js | 2 +- .../anomalies_table_columns.js | 3 +- .../anomalies_table/anomaly_details.js | 2 +- .../components/anomalies_table/entity_cell.js | 73 ---------- .../public/components/entity_cell/_index.scss | 1 + .../components/entity_cell/entity_cell.js | 129 ++++++++++++++++++ .../components/entity_cell/entity_cell.scss | 26 ++++ .../entity_cell/entity_cell.test.js | 36 +++++ .../ml/public/components/entity_cell/index.js | 7 + .../influencers_list/_influencers_list.scss | 8 +- .../influencers_list/influencers_list.js | 20 ++- x-pack/plugins/ml/public/explorer/explorer.js | 9 +- x-pack/plugins/ml/public/index.scss | 1 + 14 files changed, 229 insertions(+), 107 deletions(-) delete mode 100644 x-pack/plugins/ml/public/components/anomalies_table/entity_cell.js create mode 100644 x-pack/plugins/ml/public/components/entity_cell/_index.scss create mode 100644 x-pack/plugins/ml/public/components/entity_cell/entity_cell.js create mode 100644 x-pack/plugins/ml/public/components/entity_cell/entity_cell.scss create mode 100644 x-pack/plugins/ml/public/components/entity_cell/entity_cell.test.js create mode 100644 x-pack/plugins/ml/public/components/entity_cell/index.js diff --git a/x-pack/plugins/ml/public/components/anomalies_table/_anomalies_table.scss b/x-pack/plugins/ml/public/components/anomalies_table/_anomalies_table.scss index 24aac271706c..e95eabdf510a 100644 --- a/x-pack/plugins/ml/public/components/anomalies_table/_anomalies_table.scss +++ b/x-pack/plugins/ml/public/components/anomalies_table/_anomalies_table.scss @@ -51,20 +51,6 @@ font-size: inherit; } - .filter-button { - opacity: 0.3; - min-width: 14px; - - .euiIcon { - width: 14px; - height: 14px; - } - } - - .filter-button:hover { - opacity: 1; - } - .detector-rules-icon { margin-left: $euiSizeXS; opacity: 0.5; @@ -126,11 +112,6 @@ line-height: 1.5rem; } - .filter-button { - -webkit-transform: translateY(-1px); - transform: translateY(-1px); - } - } } diff --git a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table.test.js b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table.test.js index 2c4ba5f954ac..75e9eb0c7055 100644 --- a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table.test.js +++ b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table.test.js @@ -24,7 +24,7 @@ jest.mock('../../services/field_format_service', () => ({ jest.mock('./links_menu', () => () =>
    mocked link component
    ); jest.mock('./description_cell', () => () =>
    mocked description component
    ); jest.mock('./detector_cell', () => () =>
    mocked detector component
    ); -jest.mock('./entity_cell', () => () =>
    mocked entity component
    ); +jest.mock('../entity_cell', () => () =>
    mocked entity component
    ); jest.mock('./influencers_cell', () => () =>
    mocked influencer component
    ); const columnData = { diff --git a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_columns.js b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_columns.js index ce2f7cbf49f5..fcd6a7c5828d 100644 --- a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_columns.js +++ b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_columns.js @@ -26,7 +26,7 @@ import { import { DescriptionCell } from './description_cell'; import { DetectorCell } from './detector_cell'; -import { EntityCell } from './entity_cell'; +import { EntityCell } from '../entity_cell'; import { InfluencersCell } from './influencers_cell'; import { LinksMenu } from './links_menu'; import { checkPermission } from '../../privilege/check_privilege'; @@ -137,6 +137,7 @@ export function getColumns( entityName={item.entityName} entityValue={entityValue} filter={filter} + wrapText={true} /> ), textOnly: true, diff --git a/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js b/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js index bff8ba485bb8..b1eada31fbf5 100644 --- a/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js +++ b/x-pack/plugins/ml/public/components/anomalies_table/anomaly_details.js @@ -29,7 +29,7 @@ import { } from '@elastic/eui'; import { formatHumanReadableDateTimeSeconds } from '../../util/date_utils'; -import { EntityCell } from './entity_cell'; +import { EntityCell } from '../entity_cell'; import { getMultiBucketImpactLabel, getSeverity, diff --git a/x-pack/plugins/ml/public/components/anomalies_table/entity_cell.js b/x-pack/plugins/ml/public/components/anomalies_table/entity_cell.js deleted file mode 100644 index e35d83cae40c..000000000000 --- a/x-pack/plugins/ml/public/components/anomalies_table/entity_cell.js +++ /dev/null @@ -1,73 +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 PropTypes from 'prop-types'; -import React from 'react'; - -import { - EuiButtonIcon, - EuiToolTip -} from '@elastic/eui'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; - -/* - * Component for rendering an entity in the anomalies table, displaying the value - * of the entity, such as a partitioning or influencer field value, and optionally links for - * adding or removing a filter on this entity. - */ -export const EntityCell = injectI18n(function EntityCell({ entityName, entityValue, filter, intl }) { - const valueText = (entityName !== 'mlcategory') ? entityValue : `mlcategory ${entityValue}`; - return ( - - {valueText} - {filter !== undefined && entityName !== undefined && entityValue !== undefined && - - } - > - filter(entityName, entityValue, '+')} - iconType="plusInCircle" - aria-label={intl.formatMessage({ - id: 'xpack.ml.anomaliesTable.entityCell.addFilterAriaLabel', - defaultMessage: 'Add filter' - })} - /> - - } - > - filter(entityName, entityValue, '-')} - iconType="minusInCircle" - aria-label={intl.formatMessage({ - id: 'xpack.ml.anomaliesTable.entityCell.removeFilterAriaLabel', - defaultMessage: 'Remove filter' - })} - /> - - - } - - ); -}); - -EntityCell.WrappedComponent.propTypes = { - entityName: PropTypes.string, - entityValue: PropTypes.any, - filter: PropTypes.func -}; diff --git a/x-pack/plugins/ml/public/components/entity_cell/_index.scss b/x-pack/plugins/ml/public/components/entity_cell/_index.scss new file mode 100644 index 000000000000..04497c63a464 --- /dev/null +++ b/x-pack/plugins/ml/public/components/entity_cell/_index.scss @@ -0,0 +1 @@ +@import 'entity_cell'; diff --git a/x-pack/plugins/ml/public/components/entity_cell/entity_cell.js b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.js new file mode 100644 index 000000000000..779af5219841 --- /dev/null +++ b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.js @@ -0,0 +1,129 @@ +/* + * 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 PropTypes from 'prop-types'; +import React from 'react'; + +import { + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiToolTip +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; + + +function getAddFilter({ entityName, entityValue, filter }) { + return ( + } + > + filter(entityName, entityValue, '+')} + iconType="plusInCircle" + aria-label={i18n.translate('xpack.ml.anomaliesTable.entityCell.addFilterAriaLabel', { + defaultMessage: 'Add filter' + })} + /> + + ); +} + +function getRemoveFilter({ entityName, entityValue, filter }) { + return ( + } + > + filter(entityName, entityValue, '-')} + iconType="minusInCircle" + aria-label={i18n.translate('xpack.ml.anomaliesTable.entityCell.removeFilterAriaLabel', { + defaultMessage: 'Remove filter' + })} + /> + + ); +} + +/* + * Component for rendering an entity in the anomalies table, displaying the value + * of the entity, such as a partitioning or influencer field value, and optionally links for + * adding or removing a filter on this entity. + */ +export const EntityCell = function EntityCell({ + entityName, + entityValue, + filter, + wrapText = false +}) { + const valueText = (entityName !== 'mlcategory') ? entityValue : `mlcategory ${entityValue}`; + const textStyle = { maxWidth: '100%' }; + const textWrapperClass = (wrapText ? 'field-value-long' : 'field-value-short'); + const shouldDisplayIcons = (filter !== undefined && entityName !== undefined && entityValue !== undefined); + + if (wrapText === true) { + return ( +
    + {valueText} + {shouldDisplayIcons && + + {getAddFilter({ entityName, entityValue, filter })} + {getRemoveFilter({ entityName, entityValue, filter })} + + } +
    + ); + } else { + return ( + + + + {valueText} + + + {shouldDisplayIcons && + + + + {getAddFilter({ entityName, entityValue, filter })} + + + {getRemoveFilter({ entityName, entityValue, filter })} + + + + } + + ); + } +}; + +EntityCell.propTypes = { + entityName: PropTypes.string, + entityValue: PropTypes.any, + filter: PropTypes.func, + wrapText: PropTypes.bool +}; diff --git a/x-pack/plugins/ml/public/components/entity_cell/entity_cell.scss b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.scss new file mode 100644 index 000000000000..94446ae9816a --- /dev/null +++ b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.scss @@ -0,0 +1,26 @@ +.field-value-short { + @include euiTextTruncate; + display: inline-block; + vertical-align: bottom; +} + +.field-value-long { + overflow-wrap: break-word; + // Known issue: IE11 text overflow within a flex container +} + +.filter-button { + opacity: 0.3; + min-width: 14px; + -webkit-transform: translateY(-1px); + transform: translateY(-1px); + + .euiIcon { + width: $euiFontSizeXS; + height: $euiFontSizeXS; + } +} + +.filter-button:hover { + opacity: 1; +} diff --git a/x-pack/plugins/ml/public/components/entity_cell/entity_cell.test.js b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.test.js new file mode 100644 index 000000000000..fd5c3dc6fa42 --- /dev/null +++ b/x-pack/plugins/ml/public/components/entity_cell/entity_cell.test.js @@ -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 { mountWithIntl } from 'test_utils/enzyme_helpers'; +import { EntityCell } from './entity_cell'; + + +const defaultProps = { + entityName: 'Test Name', + entityValue: 'Test Value', + filter: () => {}, + wrapText: false +}; + +describe('EntityCell', () => { + + test('Icons are displayed when filter, entityName, and entityValue are defined', () => { + const wrapper = mountWithIntl(); + const icons = wrapper.find('EuiButtonIcon'); + + expect(icons.length).toBe(2); + }); + + test('Icons are not displayed when filter, entityName, or entityValue are undefined', () => { + const propsUndefinedFilter = { ...defaultProps, filter: undefined }; + const wrapper = mountWithIntl(); + const icons = wrapper.find('EuiButtonIcon'); + + expect(icons.length).toBe(0); + }); + +}); diff --git a/x-pack/plugins/ml/public/components/entity_cell/index.js b/x-pack/plugins/ml/public/components/entity_cell/index.js new file mode 100644 index 000000000000..f66a9f7025d6 --- /dev/null +++ b/x-pack/plugins/ml/public/components/entity_cell/index.js @@ -0,0 +1,7 @@ +/* + * 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. + */ + +export { EntityCell } from './entity_cell'; diff --git a/x-pack/plugins/ml/public/components/influencers_list/_influencers_list.scss b/x-pack/plugins/ml/public/components/influencers_list/_influencers_list.scss index b632b98b75b7..efaff421cdf6 100644 --- a/x-pack/plugins/ml/public/components/influencers_list/_influencers_list.scss +++ b/x-pack/plugins/ml/public/components/influencers_list/_influencers_list.scss @@ -4,11 +4,11 @@ .field-label { font-size: $euiFontSizeXS; text-align: left; + max-height: $euiFontSizeS; + max-width: calc(100% - 102px); // SASSTODO: Calc proper value .field-value { @include euiTextTruncate; - - max-width: calc(100% - 34px); // SASSTODO: Calc proper value display: inline-block; vertical-align: bottom; } @@ -29,7 +29,7 @@ .progress-bar { height: $euiSizeXS / 2; - margin-top: $euiSizeS; + margin-top: $euiSizeM; text-align: right; line-height: 18px; // SASSTODO: Calc porper value display: inline-block; @@ -93,7 +93,7 @@ line-height: 14px; border-radius: $euiBorderRadius; padding: $euiSizeXS / 2; - margin-top: 1px; + margin-top: 3px; display: inline-block; border: $euiBorderThin; } diff --git a/x-pack/plugins/ml/public/components/influencers_list/influencers_list.js b/x-pack/plugins/ml/public/components/influencers_list/influencers_list.js index b7c1ae85e54e..7794d3fd2349 100644 --- a/x-pack/plugins/ml/public/components/influencers_list/influencers_list.js +++ b/x-pack/plugins/ml/public/components/influencers_list/influencers_list.js @@ -24,6 +24,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { abbreviateWholeNumber } from 'plugins/ml/formatters/abbreviate_whole_number'; import { getSeverity } from 'plugins/ml/../common/util/anomaly_utils'; +import { EntityCell } from '../entity_cell'; function getTooltipContent(maxScoreLabel, totalScoreLabel) { @@ -47,7 +48,7 @@ function getTooltipContent(maxScoreLabel, totalScoreLabel) { ); } -function Influencer({ influencerFieldName, valueData }) { +function Influencer({ influencerFieldName, influencerFilter, valueData }) { const maxScorePrecise = valueData.maxAnomalyScore; const maxScore = parseInt(maxScorePrecise); const maxScoreLabel = (maxScore !== 0) ? maxScore : '< 1'; @@ -67,7 +68,11 @@ function Influencer({ influencerFieldName, valueData }) {
    {(influencerFieldName !== 'mlcategory') ? ( -
    {valueData.influencerFieldValue}
    + ) : (
    mlcategory {valueData.influencerFieldValue}
    )} @@ -102,14 +107,16 @@ function Influencer({ influencerFieldName, valueData }) { } Influencer.propTypes = { influencerFieldName: PropTypes.string.isRequired, + influencerFilter: PropTypes.func, valueData: PropTypes.object.isRequired }; -function InfluencersByName({ influencerFieldName, fieldValues }) { +function InfluencersByName({ influencerFieldName, influencerFilter, fieldValues }) { const influencerValues = fieldValues.map(valueData => ( )); @@ -126,10 +133,11 @@ function InfluencersByName({ influencerFieldName, fieldValues }) { } InfluencersByName.propTypes = { influencerFieldName: PropTypes.string.isRequired, + influencerFilter: PropTypes.func, fieldValues: PropTypes.array.isRequired }; -export function InfluencersList({ influencers }) { +export function InfluencersList({ influencers, influencerFilter }) { if (influencers === undefined || Object.keys(influencers).length === 0) { return ( @@ -153,6 +161,7 @@ export function InfluencersList({ influencers }) { )); @@ -164,5 +173,6 @@ export function InfluencersList({ influencers }) { ); } InfluencersList.propTypes = { - influencers: PropTypes.object + influencers: PropTypes.object, + influencerFilter: PropTypes.func, }; diff --git a/x-pack/plugins/ml/public/explorer/explorer.js b/x-pack/plugins/ml/public/explorer/explorer.js index d3a178709fb8..444cdf5acc72 100644 --- a/x-pack/plugins/ml/public/explorer/explorer.js +++ b/x-pack/plugins/ml/public/explorer/explorer.js @@ -926,7 +926,7 @@ export const Explorer = injectI18n(injectObservablesAsProps( } } - applyFilterFromTable = (fieldName, fieldValue, action) => { + applyFilter = (fieldName, fieldValue, action) => { let newQueryString = ''; const { queryString } = this.state; const operator = 'and '; @@ -1107,7 +1107,10 @@ export const Explorer = injectI18n(injectObservablesAsProps( defaultMessage="Top Influencers" /> - +
    )} @@ -1292,7 +1295,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
    diff --git a/x-pack/plugins/ml/public/index.scss b/x-pack/plugins/ml/public/index.scss index c31c1c2804c9..5d2c4628b635 100644 --- a/x-pack/plugins/ml/public/index.scss +++ b/x-pack/plugins/ml/public/index.scss @@ -31,6 +31,7 @@ @import 'components/controls/index'; @import 'components/data_recognizer/index'; @import 'components/documentation_help_link/index'; + @import 'components/entity_cell/index'; @import 'components/field_data_card/index'; // SASSTODO: This file needs to be rewritten @import 'components/field_title_bar/index'; @import 'components/field_type_icon/index'; From 20bdf7d4a9846f8be5f9e6426d97372e974651ac Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 20:44:03 +0000 Subject: [PATCH 19/25] Migration to Babel7 and @babel/preset-typescript (#33093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(NA): first changes on every package.json order to support new babel 7. chore(NA): build for kbn-pm with babel 7. * chore(NA): patch babel register to load typescrit * chore(NA): first working version with babel 7 replacing typescript compiler. * fix(NA): common preset declaration in order to make it work with babel-loader. * chore(na): organizing babel preset env package json. * chore(NA): mocha tests enabled. * fix(NA): typo on importing * test(NA): majority of x-pack tests ported to use babel-jest * fix(NA): report info button test with babel-jest. * fix(NA): polling service tests. * test(na): fix server plugins plugin tests. * test(NA): batch of test fixs for jest tests under babel-jest hoisting. * chore(NA): add babel plugin to hoist mock prefixed vars on jest tests. * chore(NA): update yarn.lock file. * chore(NA): tests passing. * chore(NA): remove wrong dep * chore(NA): fix tsconfig * chore(NA): skip babel for ts-jest. * chore(NA): selectively apply the plugin to strip off namespace from ts files. * chore(NA): remove not needed changes from ts tests * chore(NA): removed ts-jest dependency. chore(NA): migrate ts tests on x-pack to use babel-jest with the new pattern. * chore(NA): migrate kibana default distribution typescript tests to run with babel-jest and the new test mock pattern. * chore(NA): merge and solve conflicts with master. * chore(NA): fix problems reported by eslint * chore(NA): fix license ovveride for babel-plugin-mock-imports * chore(NA): update jest integration tests for kbn pm * chore(NA): update babel jest integration tests for kbn pm. * test(NA): update jest integration snapshot for kbn pm. * chore(NA): apply changes according to the pull request reviews. * chore(NA): apply changes according to the pull request reviews. * refact(NA): migrate jest tests to the new pattern. * fix(NA): babel 7 polyfill in the tests bundle. * chore(NA): restore needed step in order to compile x-pack with typescript. * chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7 * Revert "chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7" This reverts commit 2707d538f5126c582a00580a8489361592c80d70. * fix(NA): import paths for tabConfigConst * chore(NA): fix transpiling error on browser tests * chore(NA): simplify kbn babel preset package. * chore(NA): migrate build to use babel transpiler for typescript excluding xpack. * fix(NA): introduced error on test quick task. * fix(NA): fix preset for client side code on build. * fix(NA): build with babel * fix(NA): negated patterns in the end. * fix(NA): kbn_tp_sample_panel_action creation. * fix(NA): babel typescript transform plugin workaround when exporting interface name. * refact(NA): remove not needed type cast to any on jest test. * docs(NA): add developement documentation about jest mocks test pattern. * chore(NA): missing unmerged path. * chore(NA): fix jest tests for template. * [CCR] Client integration tests (table lists) (#33525) * Force user to re-authenticate if token refresh fails with `400` status code. (#33774) * Improve performance of the Logstash Pipeline Viewer (#33793) Resolves #27513. _This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._ Summary of changes, taken from #31293: ## Before this PR The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline. Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser. ## With this PR This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer. ## Gains, by the numbers Based on a simple, 1-input, 1-filter, and 1-output pipeline. * Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets. * Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size. * Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size. * Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size. * [Maps] split settings into layer and source panels (#33788) * [Maps] split settings into layer and source panels * fix SCSS import * [env] exit if starting as root (#21563) * [env] exit if starting as root * fix windows * s/--allow-root * Typescript sample panel action (#33602) * Typescript sample panel action * Update EUI version to match main cabana version * update yarn.lock * add back typings include * use correct relative path * Home page "recent links" should communicate saved object type #21896 (#33694) * adds object type for screen order * adds object type for pointer hovering * Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx Co-Authored-By: rockfield --- docs/development/core-development.asciidoc | 2 + .../core/development-unit-tests.asciidoc | 80 + package.json | 39 +- packages/elastic-datemath/.babelrc | 23 +- packages/elastic-datemath/package.json | 6 +- packages/eslint-config-kibana/package.json | 16 +- packages/kbn-babel-code-parser/package.json | 2 +- packages/kbn-babel-preset/common_preset.js | 25 +- packages/kbn-babel-preset/common_preset_7.js | 39 - packages/kbn-babel-preset/node_preset.js | 57 +- packages/kbn-babel-preset/node_preset_7.js | 50 - packages/kbn-babel-preset/package.json | 14 +- packages/kbn-babel-preset/webpack_preset.js | 35 +- packages/kbn-dev-utils/package.json | 2 +- .../kbn-eslint-plugin-eslint/package.json | 4 +- packages/kbn-i18n/tsconfig.json | 40 +- packages/kbn-interpreter/.babelrc | 3 +- packages/kbn-interpreter/package.json | 11 +- .../tasks/build/server_code_transformer.js | 2 +- .../build/server_code_transformer.test.js | 9 +- .../template/package_template.json | 16 +- packages/kbn-plugin-helpers/lib/utils.js | 2 +- packages/kbn-pm/.babelrc | 10 +- packages/kbn-pm/dist/index.js | 3584 ++++++++--------- packages/kbn-pm/package.json | 11 +- .../__fixtures__/packages/bar/package.json | 7 +- .../__fixtures__/packages/foo/package.json | 7 +- .../build_production_projects.test.ts.snap | 14 +- packages/kbn-pm/tsconfig.json | 2 +- packages/kbn-pm/webpack.config.js | 9 - packages/kbn-test/babel.config.js | 2 +- packages/kbn-test/package.json | 4 +- .../kbn-ui-framework/doc_site/src/index.js | 2 +- packages/kbn-ui-framework/package.json | 12 +- src/core/public/core_system.test.mocks.ts | 92 + src/core/public/core_system.test.ts | 87 +- .../fatal_errors_screen.test.tsx.snap | 3 +- .../fatal_errors_service.test.mocks.ts | 25 + .../fatal_errors/fatal_errors_service.test.ts | 7 +- .../toasts/toasts_service.test.mocks.ts | 25 + .../toasts/toasts_service.test.tsx | 7 +- .../ui_settings_service.test.mocks.ts | 57 + .../ui_settings/ui_settings_service.test.ts | 39 +- src/core/server/config/config_service.mock.ts | 1 + .../config/config_service.test.mocks.ts | 21 + src/core/server/config/config_service.test.ts | 3 +- src/core/server/config/env.test.mocks.ts | 33 + src/core/server/config/env.test.ts | 15 +- .../config/raw_config_service.test.mocks.ts | 24 + .../server/config/raw_config_service.test.ts | 6 +- .../cluster_client.test.mocks.ts | 35 + .../elasticsearch/cluster_client.test.ts | 21 +- ...elasticsearch_client_config.test.mocks.ts} | 4 +- .../elasticsearch_client_config.test.ts | 7 +- .../elasticsearch_service.mock.ts | 1 + .../elasticsearch_service.test.mocks.ts | 21 + .../elasticsearch_service.test.ts | 3 +- src/core/server/http/http_service.mock.ts | 1 + .../server/http/http_service.test.mocks.ts | 24 + src/core/server/http/http_service.test.ts | 6 +- src/core/server/index.test.mocks.ts | 40 + .../__snapshots__/legacy_service.test.ts.snap | 2 + .../logging/appenders/appenders.test.mocks.ts | 29 + .../logging/appenders/appenders.test.ts | 11 +- .../file/file_appender.test.mocks.ts | 32 + .../appenders/file/file_appender.test.ts | 14 +- .../discovery/plugin_discovery.test.mocks.ts | 30 + .../discovery/plugin_discovery.test.ts | 12 +- .../plugin_manifest_parser.test.mocks.ts | 22 + .../discovery/plugin_manifest_parser.test.ts | 4 +- src/core/server/plugins/plugin.test.ts | 6 +- .../plugins/plugins_service.test.mocks.ts | 26 + .../server/plugins/plugins_service.test.ts | 8 +- .../plugins/plugins_system.test.mocks.ts | 23 + .../server/plugins/plugins_system.test.ts | 8 +- src/core/server/root/index.test.mocks.ts | 33 + src/core/server/root/index.test.ts | 15 +- src/core/server/server.test.ts | 26 +- src/dev/build/build_distributables.js | 6 +- src/dev/build/tasks/copy_source_task.js | 3 +- src/dev/build/tasks/index.js | 2 +- src/dev/build/tasks/transpile_babel_task.js | 70 +- ...t_task.js => typecheck_typescript_task.js} | 30 +- .../i18n/integrate_locale_files.test.mocks.ts | 27 + src/dev/i18n/integrate_locale_files.test.ts | 9 +- src/dev/jest/babel_transform.js | 2 +- src/dev/jest/config.js | 8 +- src/dev/jest/setup/babel_polyfill.js | 2 +- src/dev/jest/ts_transform.ts | 74 - src/dev/license_checker/config.js | 2 +- src/dev/mocha/run_mocha_cli.js | 2 +- .../data/__snapshots__/data_view.test.js.snap | 2 + .../interpreter/common/types/register.js | 2 +- .../__snapshots__/new_vis_modal.test.tsx.snap | 29 +- .../wizard/new_vis_modal.test.mocks.ts | 26 + .../visualize/wizard/new_vis_modal.test.tsx | 8 +- .../tests_bundle/tests_entry_template.js | 2 +- .../__snapshots__/help_flyout.test.js.snap | 4 +- .../language_switcher.test.tsx.snap | 8 +- .../components/query_bar.test.mocks.ts | 70 + .../query_bar/components/query_bar.test.tsx | 57 +- .../suggestions_component.test.tsx.snap | 8 +- .../url_panel_content.test.js.snap | 16 +- .../utils/subscribe_with_scope.test.mocks.ts | 23 + .../public/utils/subscribe_with_scope.test.ts | 6 +- .../editors/default/agg_param_editor_props.ts | 8 +- .../embedded_visualize_handler.test.mocks.ts | 67 + .../loader/embedded_visualize_handler.test.ts | 50 +- .../loader/pipeline_helpers/utilities.ts | 2 +- .../ui/ui_bundles/app_entry_template.js | 2 +- src/optimize/base_optimizer.js | 52 +- src/optimize/watch/watch_cache.ts | 11 +- src/setup_node_env/babel_register/index.js | 10 - src/setup_node_env/babel_register/polyfill.js | 8 +- src/setup_node_env/babel_register/register.js | 11 +- x-pack/dev-tools/jest/create_jest_config.js | 3 +- x-pack/package.json | 20 +- .../DiscoverLinks.integration.test.tsx | 2 - .../__test__/tabConfig.test.tsx | 59 +- .../shared/PropertiesTable/tabConfig.ts | 117 +- .../shared/PropertiesTable/tabConfigConst.ts | 119 + .../canvas/.storybook/webpack.config.js | 2 +- .../public/components/workpad_page/index.js | 1 + .../lib/aeroelastic/layout_functions.js | 1 + .../plugins/canvas/tasks/helpers/babelhook.js | 2 +- .../scripts/generate_types_from_graphql.js | 1 - .../__snapshots__/form_label.test.js.snap | 4 +- .../__snapshots__/suggestions.test.js.snap | 4 +- x-pack/plugins/monitoring/README.md | 2 +- .../collection_enabled.test.js.snap | 4 +- .../collection_interval.test.js.snap | 8 +- .../report_info_button.test.mocks.ts | 8 + .../components/report_info_button.test.tsx | 3 +- .../public/components/report_listing.tsx | 4 +- .../components/reporting_panel_content.tsx | 13 +- x-pack/plugins/searchprofiler/README.md | 2 +- .../privilege_callout_warning.test.tsx.snap | 8 +- .../space_aware_privilege_form.test.tsx.snap | 7 +- .../lib/authorization/privileges.test.js | 2 +- .../__snapshots__/space_avatar.test.tsx.snap | 4 +- .../advanced_settings_title.test.tsx.snap | 2 +- .../space_identifier.test.tsx.snap | 3 +- .../spaces_grid_pages.test.tsx.snap | 14 +- .../nav_control_popover.test.tsx.snap | 4 +- .../__snapshots__/checkup_tab.test.tsx.snap | 4 +- .../checklist_step.test.tsx.snap | 8 +- .../__snapshots__/warning_step.test.tsx.snap | 8 +- .../reindex/flyout/progress.test.tsx | 4 +- .../reindex/polling_service.test.mocks.ts | 24 + .../reindex/polling_service.test.ts | 20 +- .../server/lib/reindexing/worker.ts | 2 +- .../__snapshots__/snapshot.test.tsx.snap | 2 +- .../__snapshots__/empty_state.test.tsx.snap | 32 +- .../uptime/scripts/infer_graphql_types.js | 1 - .../server/lib/file_integrity.test.mocks.ts | 28 + .../server/lib/file_integrity.test.ts | 23 +- x-pack/tasks/build.js | 2 +- .../plugins/task_manager/package.json | 10 +- .../common/services/es.js | 3 +- x-pack/test_utils/jest/config.js | 8 +- yarn.lock | 1517 ++----- 161 files changed, 3722 insertions(+), 4166 deletions(-) create mode 100644 docs/development/core/development-unit-tests.asciidoc delete mode 100644 packages/kbn-babel-preset/common_preset_7.js delete mode 100644 packages/kbn-babel-preset/node_preset_7.js create mode 100644 src/core/public/core_system.test.mocks.ts create mode 100644 src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts create mode 100644 src/core/public/notifications/toasts/toasts_service.test.mocks.ts create mode 100644 src/core/public/ui_settings/ui_settings_service.test.mocks.ts create mode 100644 src/core/server/config/config_service.test.mocks.ts create mode 100644 src/core/server/config/env.test.mocks.ts create mode 100644 src/core/server/config/raw_config_service.test.mocks.ts create mode 100644 src/core/server/elasticsearch/cluster_client.test.mocks.ts rename src/{dev/jest/ts_transform.js => core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts} (88%) create mode 100644 src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts create mode 100644 src/core/server/http/http_service.test.mocks.ts create mode 100644 src/core/server/index.test.mocks.ts create mode 100644 src/core/server/logging/appenders/appenders.test.mocks.ts create mode 100644 src/core/server/logging/appenders/file/file_appender.test.mocks.ts create mode 100644 src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts create mode 100644 src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts create mode 100644 src/core/server/plugins/plugins_service.test.mocks.ts create mode 100644 src/core/server/plugins/plugins_system.test.mocks.ts create mode 100644 src/core/server/root/index.test.mocks.ts rename src/dev/build/tasks/{transpile_typescript_task.js => typecheck_typescript_task.js} (85%) create mode 100644 src/dev/i18n/integrate_locale_files.test.mocks.ts delete mode 100644 src/dev/jest/ts_transform.ts create mode 100644 src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts create mode 100644 src/legacy/ui/public/query_bar/components/query_bar.test.mocks.ts create mode 100644 src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts create mode 100644 src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts create mode 100644 x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts create mode 100644 x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts create mode 100644 x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.mocks.ts create mode 100644 x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts diff --git a/docs/development/core-development.asciidoc b/docs/development/core-development.asciidoc index 45f52c16ee33..ed04a6f12eae 100644 --- a/docs/development/core-development.asciidoc +++ b/docs/development/core-development.asciidoc @@ -15,4 +15,6 @@ include::core/development-modules.asciidoc[] include::core/development-elasticsearch.asciidoc[] +include::core/development-unit-tests.asciidoc[] + include::core/development-functional-tests.asciidoc[] diff --git a/docs/development/core/development-unit-tests.asciidoc b/docs/development/core/development-unit-tests.asciidoc new file mode 100644 index 000000000000..852d1fef6b32 --- /dev/null +++ b/docs/development/core/development-unit-tests.asciidoc @@ -0,0 +1,80 @@ +[[development-unit-tests]] +=== Unit Testing + +We use unit tests to make sure that individual software units of Kibana perform as they were designed to. + +[float] +==== Current Frameworks + +Kibana is migrating unit testing from `Mocha` to `Jest`. Legacy unit tests still exist in `Mocha` but all new unit tests should be written in `Jest`. + +[float] +==== Mocha (legacy) + +Mocha tests are contained in `__tests__` directories. + +===== Running Mocha Unit Tests + +["source","shell"] +----------- +yarn test:mocha +----------- + +==== Jest +Jest tests are stored in the same directory as source code files with the `.test.{js,ts,tsx}` suffix. + +===== Running Jest Unit Tests + +["source","shell"] +----------- +yarn test:jest +----------- + +===== Writing Jest Unit Tests + +In order to write those tests there are two main things you need to be aware of. +The first one is the different between `jest.mock` and `jest.doMock` +and the second one our `jest mocks file pattern`. As we are running `js` and `ts` +test files with `babel-jest` both techniques are needed +specially for the tests implemented on Typescript in order to benefit from the +auto-inference types feature. + + +====== Jest.mock vs Jest.doMock + +Both methods are essentially the same on their roots however the `jest.mock` +calls will get hoisted to the top of the file and can only reference variables +prefixed with `mock`. On the other hand, `jest.doMock` won't be hoisted and can +reference pretty much any variable we want, however we have to assure those referenced +variables are instantiated at the time we need them which lead us to the next +section where we'll talk about our jest mock files pattern. + +====== Jest Mock Files Pattern + +Specially on typescript it is pretty common to have in unit tests +`jest.doMock` calls which reference for example imported types. Any error +will thrown from doing that however the test will fail. The reason behind that +is because despite the `jest.doMock` isn't being hoisted by `babel-jest` the +import with the types we are referencing will be hoisted to the top and at the +time we'll call the function that variable would not be defined. + +In order to prevent that we develop a protocol that should be followed: + +- Each module could provide a standard mock in `mymodule.mock.ts` in case +there are other tests that could benefit from using definitions here. +This file would not have any `jest.mock` calls, just dummy objects. + +- Each test defines its mocks in `mymodule.test.mocks.ts`. This file +could import relevant mocks from the generalised module's mocks +file `(*.mock.ts)` and call `jest.mock` for each of them. If there is +any relevant dummy mock objects to generalise (and to be used by +other tests), the dummy objects could be defined directly on this file. + +- Each test would import its mocks from the test mocks +file mymodule.test.mocks.ts. `mymodule.test.ts` has an import +like: `import * as Mocks from './mymodule.test.mocks'`, +`import { mockX } from './mymodule.test.mocks'` +or just `import './mymodule.test.mocks'` if there isn't anything +exported to be used. + + diff --git a/package.json b/package.json index 43f6c6704c60..3d3a64a56e67 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,9 @@ ] }, "dependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", + "@babel/register": "^7.0.0", "@elastic/datemath": "5.0.2", "@elastic/eui": "9.5.0", "@elastic/filesaver": "1.1.2", @@ -123,10 +126,7 @@ "angular-sanitize": "1.6.5", "angular-sortable-view": "0.0.15", "autoprefixer": "^9.1.0", - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-polyfill": "6.26.0", - "babel-register": "6.26.0", + "babel-loader": "8.0.5", "bluebird": "3.5.3", "boom": "^7.2.0", "brace": "0.11.1", @@ -263,7 +263,7 @@ "@octokit/rest": "^15.10.0", "@types/angular": "1.6.50", "@types/angular-mocks": "^1.7.0", - "@types/babel-core": "^6.25.5", + "@types/babel__core": "^7.1.0", "@types/bluebird": "^3.1.1", "@types/boom": "^7.2.0", "@types/chance": "^1.0.0", @@ -275,7 +275,7 @@ "@types/delete-empty": "^2.0.0", "@types/elasticsearch": "^5.0.30", "@types/enzyme": "^3.1.12", - "@types/eslint": "^4.16.2", + "@types/eslint": "^4.16.6", "@types/execa": "^0.9.0", "@types/fetch-mock": "7.2.1", "@types/getopts": "^2.0.0", @@ -320,8 +320,8 @@ "@types/zen-observable": "^0.8.0", "angular-mocks": "1.4.7", "archiver": "^3.0.0", - "babel-eslint": "^9.0.0", - "babel-jest": "^23.6.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.1.0", "backport": "4.4.1", "chai": "3.5.0", "chance": "1.0.10", @@ -335,17 +335,17 @@ "enzyme-adapter-react-16": "^1.9.0", "enzyme-adapter-utils": "^1.10.0", "enzyme-to-json": "^3.3.4", - "eslint": "^5.6.0", - "eslint-config-prettier": "^3.1.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.26.2", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-mocha": "^5.2.0", + "eslint": "^5.15.1", + "eslint-config-prettier": "^4.1.0", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^2.6.2", - "eslint-plugin-react": "^7.11.1", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-react": "^7.12.4", "faker": "1.1.0", "fetch-mock": "7.3.0", "geckodriver": "1.12.2", @@ -356,7 +356,7 @@ "grunt-karma": "2.0.0", "grunt-peg": "^2.0.1", "grunt-run": "0.7.0", - "gulp-babel": "^7.0.1", + "gulp-babel": "^8.0.0", "gulp-sourcemaps": "2.6.4", "has-ansi": "^3.0.0", "image-diff": "1.6.0", @@ -402,9 +402,6 @@ "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", "tree-kill": "^1.1.0", - "ts-jest": "^23.1.4", - "ts-loader": "^5.2.2", - "ts-node": "^7.0.1", "tslint": "^5.11.0", "tslint-config-prettier": "^1.15.0", "tslint-microsoft-contrib": "^6.0.0", diff --git a/packages/elastic-datemath/.babelrc b/packages/elastic-datemath/.babelrc index e39c0afafdd9..26138d48b71b 100644 --- a/packages/elastic-datemath/.babelrc +++ b/packages/elastic-datemath/.babelrc @@ -1,13 +1,16 @@ { - "presets": [["env", { - "targets": { - "node": "current", - "browsers": [ - "last 2 versions", - "> 5%", - "Safari 7", - ] + "presets": [ + ["@babel/preset-env", { + "targets": { + "node": "current", + "browsers": [ + "last 2 versions", + "> 5%", + "Safari 7" + ] + } } - }]], + ] + ], "plugins": ["add-module-exports"] -} \ No newline at end of file +} diff --git a/packages/elastic-datemath/package.json b/packages/elastic-datemath/package.json index 3b626077f5ea..77c545709a3c 100644 --- a/packages/elastic-datemath/package.json +++ b/packages/elastic-datemath/package.json @@ -11,9 +11,9 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-preset-env": "^1.7.0", + "@babel/cli": "^7.2.3", + "@babel/preset-env": "^7.3.4", + "babel-plugin-add-module-exports": "^1.0.0", "moment": "^2.13.0" }, "dependencies": { diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index d2e639eebbbe..c4a5a99e4c97 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,15 +15,15 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "babel-eslint": "^9.0.0", - "eslint": "^5.6.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.22.1", - "eslint-plugin-mocha": "^5.2.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.14.1", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.12.4" } } diff --git a/packages/kbn-babel-code-parser/package.json b/packages/kbn-babel-code-parser/package.json index 23e7c29f22df..addc53028565 100755 --- a/packages/kbn-babel-code-parser/package.json +++ b/packages/kbn-babel-code-parser/package.json @@ -15,7 +15,7 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { - "babel-cli": "^6.26.0" + "@babel/cli": "^7.2.3" }, "dependencies": { "@kbn/babel-preset": "1.0.0", diff --git a/packages/kbn-babel-preset/common_preset.js b/packages/kbn-babel-preset/common_preset.js index a2d4495adc54..e67a2db5a380 100644 --- a/packages/kbn-babel-preset/common_preset.js +++ b/packages/kbn-babel-preset/common_preset.js @@ -19,20 +19,33 @@ module.exports = { presets: [ - require.resolve('babel-preset-react'), + require.resolve('@babel/preset-typescript'), + require.resolve('@babel/preset-react') ], plugins: [ require.resolve('babel-plugin-add-module-exports'), - // stage 3 - require.resolve('babel-plugin-transform-async-generator-functions'), - require.resolve('babel-plugin-transform-object-rest-spread'), - // the class properties proposal was merged with the private fields proposal + // The class properties proposal was merged with the private fields proposal // into the "class fields" proposal. Babel doesn't support this combined // proposal yet, which includes private field, so this transform is // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 // // See https://github.com/babel/proposals/issues/12 for progress - require.resolve('babel-plugin-transform-class-properties'), + require.resolve('@babel/plugin-proposal-class-properties'), ], + overrides: [ + { + // Babel 7 don't support the namespace feature on typescript code. + // With namespaces only used for type declarations, we can securely + // strip them off for babel on x-pack infra plugin + // + // See https://github.com/babel/babel/issues/8244#issuecomment-466548733 + test: /x-pack[\/\\]plugins[\/\\]infra[\/\\].*[\/\\]graphql/, + plugins: [ + [ + require.resolve('babel-plugin-typescript-strip-namespaces'), + ], + ] + } + ] }; diff --git a/packages/kbn-babel-preset/common_preset_7.js b/packages/kbn-babel-preset/common_preset_7.js deleted file mode 100644 index df72f382e2b0..000000000000 --- a/packages/kbn-babel-preset/common_preset_7.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. - */ - -module.exports = { - presets: [ - require.resolve('@babel/preset-react'), - require.resolve('@babel/preset-typescript'), - ], - plugins: [ - require.resolve('babel7-plugin-add-module-exports'), - // stage 3 - require.resolve('@babel/plugin-proposal-async-generator-functions'), - require.resolve('@babel/plugin-proposal-object-rest-spread'), - - // the class properties proposal was merged with the private fields proposal - // into the "class fields" proposal. Babel doesn't support this combined - // proposal yet, which includes private field, so this transform is - // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 - // - // See https://github.com/babel/proposals/issues/12 for progress - require.resolve('@babel/plugin-proposal-class-properties'), - ], -}; diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 04d6dd3609e8..ac4dc17e6380 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -17,34 +17,37 @@ * under the License. */ -module.exports = { - presets: [ - [ - require.resolve('babel-preset-env'), - { - targets: { - // only applies the necessary transformations based on the - // current node.js processes version. For example: running - // `nvm install 8 && node ./src/cli` will run kibana in node - // version 8 and babel will stop transpiling async/await - // because they are supported in the "current" version of node - node: 'current', - }, +module.exports = () => { + return { + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: { + // only applies the necessary transformations based on the + // current node.js processes version. For example: running + // `nvm install 8 && node ./src/cli` will run kibana in node + // version 8 and babel will stop transpiling async/await + // because they are supported in the "current" version of node + node: 'current', + }, - // replaces `import "babel-polyfill"` with a list of require statements - // for just the polyfills that the target versions don't already supply - // on their own - useBuiltIns: true, - }, + // replaces `import "@babel/polyfill"` with a list of require statements + // for just the polyfills that the target versions don't already supply + // on their own + useBuiltIns: 'entry', + modules: 'cjs' + }, + ], + require('./common_preset'), ], - require('./common_preset'), - ], - plugins: [ - [ - require.resolve('babel-plugin-transform-define'), - { - 'global.__BUILT_WITH_BABEL__': 'true' - } + plugins: [ + [ + require.resolve('babel-plugin-transform-define'), + { + 'global.__BUILT_WITH_BABEL__': 'true' + } + ] ] - ] + }; }; diff --git a/packages/kbn-babel-preset/node_preset_7.js b/packages/kbn-babel-preset/node_preset_7.js deleted file mode 100644 index b57dd58dd9f1..000000000000 --- a/packages/kbn-babel-preset/node_preset_7.js +++ /dev/null @@ -1,50 +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. - */ - -module.exports = () => ({ - presets: [ - [ - require.resolve('@babel/preset-env'), - { - targets: { - // only applies the necessary transformations based on the - // current node.js processes version. For example: running - // `nvm install 8 && node ./src/cli` will run kibana in node - // version 8 and babel will stop transpiling async/await - // because they are supported in the "current" version of node - node: 'current', - }, - - // replaces `import "babel-polyfill"` with a list of require statements - // for just the polyfills that the target versions don't already supply - // on their own - useBuiltIns: 'entry', - }, - ], - require('./common_preset_7'), - ], - plugins: [ - [ - require.resolve('babel-plugin-transform-define'), - { - 'global.__BUILT_WITH_BABEL__': 'true' - } - ] - ] -}); diff --git a/packages/kbn-babel-preset/package.json b/packages/kbn-babel-preset/package.json index 41c03c054267..79ee6bbe39c0 100644 --- a/packages/kbn-babel-preset/package.json +++ b/packages/kbn-babel-preset/package.json @@ -4,20 +4,12 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@babel/core": "^7.3.4", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-class-properties": "^7.3.4", - "@babel/plugin-proposal-object-rest-spread": "^7.3.4", + "@babel/preset-react":"^7.0.0", "@babel/preset-env": "^7.3.4", - "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-transform-async-generator-functions": "^6.24.1", - "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-add-module-exports": "^1.0.0", "babel-plugin-transform-define": "^1.3.1", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "babel7-plugin-add-module-exports": "npm:babel-plugin-add-module-exports@^1.0.0" + "babel-plugin-typescript-strip-namespaces": "^1.1.1" } } diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 97bfa44a049d..df5745bc33f8 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -17,21 +17,24 @@ * under the License. */ -module.exports = { - presets: [ - [ - require.resolve('babel-preset-env'), - { - targets: { - browsers: [ - 'last 2 versions', - '> 5%', - 'Safari 7', // for PhantomJS support: https://github.com/elastic/kibana/issues/27136 - ], +module.exports = () => { + return { + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: { + browsers: [ + 'last 2 versions', + '> 5%', + 'Safari 7', // for PhantomJS support: https://github.com/elastic/kibana/issues/27136 + ], + }, + useBuiltIns: 'entry', + modules: 'cjs' }, - useBuiltIns: true, - }, - ], - require('./common_preset'), - ] + ], + require('./common_preset'), + ] + }; }; diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index af39ffecf669..4fbc80d6e679 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -19,9 +19,9 @@ "tslib": "^1.9.3" }, "devDependencies": { + "@babel/cli": "^7.2.3", "@kbn/babel-preset": "1.0.0", "@kbn/expect": "1.0.0", - "babel-cli": "^6.26.0", "chance": "1.0.6" } } diff --git a/packages/kbn-eslint-plugin-eslint/package.json b/packages/kbn-eslint-plugin-eslint/package.json index b35387384071..e2024b54a620 100644 --- a/packages/kbn-eslint-plugin-eslint/package.json +++ b/packages/kbn-eslint-plugin-eslint/package.json @@ -4,8 +4,8 @@ "private": true, "license": "Apache-2.0", "peerDependencies": { - "eslint": "^5.6.0", - "babel-eslint": "^9.0.0" + "eslint": "^5.14.1", + "babel-eslint": "^10.0.1" }, "dependencies": { "dedent": "^0.7.0" diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index 3b757d1240bd..d3dae3078c1d 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -1,20 +1,20 @@ -{ - "extends": "../../tsconfig.json", - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "types/intl_format_cache.d.ts", - "types/intl_relativeformat.d.ts" - ], - "exclude": [ - "target" - ], - "compilerOptions": { - "declaration": true, - "declarationDir": "./target/types", - "types": [ - "jest", - "node" - ] - } -} +{ + "extends": "../../tsconfig.json", + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "types/intl_format_cache.d.ts", + "types/intl_relativeformat.d.ts" + ], + "exclude": [ + "target" + ], + "compilerOptions": { + "declaration": true, + "declarationDir": "./target/types", + "types": [ + "jest", + "node" + ] + } +} diff --git a/packages/kbn-interpreter/.babelrc b/packages/kbn-interpreter/.babelrc index 57a5cc3669eb..875cbcde9d0e 100644 --- a/packages/kbn-interpreter/.babelrc +++ b/packages/kbn-interpreter/.babelrc @@ -1,8 +1,7 @@ { "presets": ["@kbn/babel-preset/webpack_preset"], "plugins": [ - ["babel-plugin-transform-runtime", { - "polyfill": false, + ["@babel/plugin-transform-runtime", { "regenerator": true }] ] diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json index 290e02cb2b2e..ded8f38bff49 100644 --- a/packages/kbn-interpreter/package.json +++ b/packages/kbn-interpreter/package.json @@ -9,19 +9,20 @@ "kbn:watch": "node scripts/build --dev --watch" }, "dependencies": { + "@babel/runtime": "^7.3.4", "@kbn/i18n": "1.0.0", "lodash": "npm:@elastic/lodash@3.10.1-kibana1", "lodash.clone": "^4.5.0", "uuid": "3.0.1" }, "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "7.3.4", + "@babel/plugin-transform-runtime": "^7.3.4", + "@babel/polyfill": "7.2.5", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", - "babel-cli": "^6.26.0", - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-polyfill": "6.20.0", + "babel-loader": "8.0.5", "copy-webpack-plugin": "^4.6.0", "css-loader": "1.0.0", "del": "^3.0.0", diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.js b/packages/kbn-interpreter/tasks/build/server_code_transformer.js index 5db4dc13640c..b1185f475219 100644 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.js +++ b/packages/kbn-interpreter/tasks/build/server_code_transformer.js @@ -19,7 +19,7 @@ const { extname } = require('path'); -const { transform } = require('babel-core'); +const { transform } = require('@babel/core'); exports.createServerCodeTransformer = (sourceMaps) => { return (content, path) => { diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js b/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js index 01dc9323352a..519e529c20bf 100644 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js +++ b/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js @@ -28,15 +28,14 @@ describe('js support', () => { it('transpiles js file', () => { const transformer = createServerCodeTransformer(); expect(transformer(JS_FIXTURE, JS_FIXTURE_PATH)).toMatchInlineSnapshot(` -"'use strict'; +"\\"use strict\\"; -var _util = require('util'); - -var _util2 = _interopRequireDefault(_util); +var _util = _interopRequireDefault(require(\\"util\\")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -console.log(_util2.default.format('hello world')); /* eslint-disable */" +/* eslint-disable */ +console.log(_util.default.format('hello world'));" `); }); diff --git a/packages/kbn-plugin-generator/sao_template/template/package_template.json b/packages/kbn-plugin-generator/sao_template/template/package_template.json index 80e6ae8642e1..7a6d0842a164 100644 --- a/packages/kbn-plugin-generator/sao_template/template/package_template.json +++ b/packages/kbn-plugin-generator/sao_template/template/package_template.json @@ -27,15 +27,15 @@ "@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana", "@kbn/expect": "1.0.0", "@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers", - "babel-eslint": "^9.0.0", - "eslint": "^5.6.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.26.2", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-mocha": "^5.2.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.14.1", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.3.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.12.4" } } diff --git a/packages/kbn-plugin-helpers/lib/utils.js b/packages/kbn-plugin-helpers/lib/utils.js index ee82b9a8fd57..d9a5b9148208 100644 --- a/packages/kbn-plugin-helpers/lib/utils.js +++ b/packages/kbn-plugin-helpers/lib/utils.js @@ -25,7 +25,7 @@ function babelRegister() { const plugin = pluginConfig(); try { - // add support for moved babel-register source: https://github.com/elastic/kibana/pull/13973 + // add support for moved @babel/register source: https://github.com/elastic/kibana/pull/13973 require(resolve(plugin.kibanaRoot, 'src/setup_node_env/babel_register')); // eslint-disable-line import/no-dynamic-require } catch (error) { if (error.code === 'MODULE_NOT_FOUND') { diff --git a/packages/kbn-pm/.babelrc b/packages/kbn-pm/.babelrc index f34e55f9b7ba..1ca768097a7e 100644 --- a/packages/kbn-pm/.babelrc +++ b/packages/kbn-pm/.babelrc @@ -1,10 +1,14 @@ { "presets": [ - "stage-3", - ["env", { + "@babel/typescript", + ["@babel/preset-env", { "targets": { "node": "current" } }] + ], + "plugins": [ + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread" ] -} \ No newline at end of file +} diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 5910f00408b1..808f72116f81 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -87,146 +87,90 @@ module.exports = /************************************************************************/ /******/ ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _cli__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "run", function() { return _cli__WEBPACK_IMPORTED_MODULE_0__["run"]; }); + +/* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(367); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); + +/* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(131); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return _utils_workspaces__WEBPACK_IMPORTED_MODULE_2__["copyWorkspacePackages"]; }); + +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _cli = __webpack_require__(1); - -Object.defineProperty(exports, 'run', { - enumerable: true, - get: function () { - return _cli.run; - } -}); - -var _production = __webpack_require__(367); - -Object.defineProperty(exports, 'buildProductionProjects', { - enumerable: true, - get: function () { - return _production.buildProductionProjects; - } -}); -Object.defineProperty(exports, 'prepareExternalProjectDependencies', { - enumerable: true, - get: function () { - return _production.prepareExternalProjectDependencies; - } -}); - -var _workspaces = __webpack_require__(131); - -Object.defineProperty(exports, 'copyWorkspacePackages', { - enumerable: true, - get: function () { - return _workspaces.copyWorkspacePackages; - } -}); /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "run", function() { return run; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); +/* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dedent__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(getopts__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(357); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = undefined; -let run = exports.run = (() => { - var _ref = _asyncToGenerator(function* (argv) { - // We can simplify this setup (and remove this extra handling) once Yarn - // starts forwarding the `--` directly to this script, see - // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 - if (argv.includes('--')) { - _log.log.write(_chalk2.default.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); - process.exit(1); - } - const options = (0, _getopts2.default)(argv, { - alias: { - e: 'exclude', - h: 'help', - i: 'include' - }, - boolean: ['prefer-offline', 'frozen-lockfile'] - }); - const args = options._; - if (options.help || args.length === 0) { - help(); - return; - } - // This `rootPath` is relative to `./dist/` as that's the location of the - // built version of this tool. - const rootPath = (0, _path.resolve)(__dirname, '../../../'); - const commandName = args[0]; - const extraArgs = args.slice(1); - const commandOptions = { options, extraArgs, rootPath }; - const command = _commands.commands[commandName]; - if (command === undefined) { - _log.log.write(_chalk2.default.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); - process.exit(1); - } - yield (0, _run.runCommand)(command, commandOptions); - }); - return function run(_x) { - return _ref.apply(this, arguments); - }; -})(); -var _chalk = __webpack_require__(2); -var _chalk2 = _interopRequireDefault(_chalk); - -var _dedent = __webpack_require__(14); - -var _dedent2 = _interopRequireDefault(_dedent); - -var _getopts = __webpack_require__(15); - -var _getopts2 = _interopRequireDefault(_getopts); - -var _path = __webpack_require__(16); - -var _commands = __webpack_require__(17); - -var _run = __webpack_require__(357); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ function help() { - const availableCommands = Object.keys(_commands.commands).map(commandName => _commands.commands[commandName]).map(command => `${command.name} - ${command.description}`); - _log.log.write(_dedent2.default` + const availableCommands = Object.keys(_commands__WEBPACK_IMPORTED_MODULE_4__["commands"]).map(commandName => _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]).map(command => `${command.name} - ${command.description}`); + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(dedent__WEBPACK_IMPORTED_MODULE_1___default.a` usage: kbn [] By default commands are run for Kibana itself, all packages in the 'packages/' @@ -245,6 +189,50 @@ function help() { `); } +async function run(argv) { + // We can simplify this setup (and remove this extra handling) once Yarn + // starts forwarding the `--` directly to this script, see + // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 + if (argv.includes('--')) { + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); + process.exit(1); + } + + const options = getopts__WEBPACK_IMPORTED_MODULE_2___default()(argv, { + alias: { + e: 'exclude', + h: 'help', + i: 'include' + }, + boolean: ['prefer-offline', 'frozen-lockfile'] + }); + const args = options._; + + if (options.help || args.length === 0) { + help(); + return; + } // This `rootPath` is relative to `./dist/` as that's the location of the + // built version of this tool. + + + const rootPath = Object(path__WEBPACK_IMPORTED_MODULE_3__["resolve"])(__dirname, '../../../'); + const commandName = args[0]; + const extraArgs = args.slice(1); + const commandOptions = { + options, + extraArgs, + rootPath + }; + const command = _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]; + + if (command === undefined) { + _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); + process.exit(1); + } + + await Object(_run__WEBPACK_IMPORTED_MODULE_5__["runCommand"])(command, commandOptions); +} + /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { @@ -2452,24 +2440,15 @@ module.exports = require("path"); /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.commands = undefined; - -var _bootstrap = __webpack_require__(18); - -var _clean = __webpack_require__(133); - -var _run = __webpack_require__(155); - -var _watch = __webpack_require__(156); - +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commands", function() { return commands; }); +/* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); +/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(133); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(155); +/* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(156); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -2488,117 +2467,137 @@ var _watch = __webpack_require__(156); * specific language governing permissions and limitations * under the License. */ -const commands = exports.commands = { - bootstrap: _bootstrap.BootstrapCommand, - clean: _clean.CleanCommand, - run: _run.RunCommand, - watch: _watch.WatchCommand + + + + +const commands = { + bootstrap: _bootstrap__WEBPACK_IMPORTED_MODULE_0__["BootstrapCommand"], + clean: _clean__WEBPACK_IMPORTED_MODULE_1__["CleanCommand"], + run: _run__WEBPACK_IMPORTED_MODULE_2__["RunCommand"], + watch: _watch__WEBPACK_IMPORTED_MODULE_3__["WatchCommand"] }; /***/ }), /* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BootstrapCommand", function() { return BootstrapCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BootstrapCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _link_project_executables = __webpack_require__(19); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ -const BootstrapCommand = exports.BootstrapCommand = { - description: 'Install dependencies and crosslink projects', - name: 'bootstrap', - run(projects, projectGraph, { options }) { - return _asyncToGenerator(function* () { - const batchedProjectsByWorkspace = (0, _projects.topologicallyBatchProjects)(projects, projectGraph, { - batchByWorkspace: true - }); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; - _log.log.write(_chalk2.default.bold('\nRunning installs in topological order:')); - for (const batch of batchedProjectsByWorkspace) { - for (const project of batch) { - if (project.isWorkspaceProject) { - _log.log.write(`Skipping workspace project: ${project.name}`); - continue; - } - if (project.hasDependencies()) { - yield project.installDependencies({ extraArgs }); - } - } - } - _log.log.write(_chalk2.default.bold('\nInstalls completed, linking package executables:\n')); - yield (0, _link_project_executables.linkProjectExecutables)(projects, projectGraph); - /** - * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts - * in the list of projects. We do this because some projects need to be - * transpiled before they can be used. Ideally we shouldn't do this unless we - * have to, as it will slow down the bootstrapping process. - */ - _log.log.write(_chalk2.default.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - if (pkg.hasScript('kbn:bootstrap')) { - yield pkg.runScriptStreaming('kbn:bootstrap'); - } - }); - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - _log.log.write(_chalk2.default.green.bold('\nBootstrapping completed!\n')); - })(); +const BootstrapCommand = { + description: 'Install dependencies and crosslink projects', + name: 'bootstrap', + + async run(projects, projectGraph, { + options + }) { + const batchedProjectsByWorkspace = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph, { + batchByWorkspace: true + }); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph); + const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nRunning installs in topological order:')); + + for (const batch of batchedProjectsByWorkspace) { + for (const project of batch) { + if (project.isWorkspaceProject) { + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(`Skipping workspace project: ${project.name}`); + continue; + } + + if (project.hasDependencies()) { + await project.installDependencies({ + extraArgs + }); + } + } } + + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nInstalls completed, linking package executables:\n')); + await Object(_utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__["linkProjectExecutables"])(projects, projectGraph); + /** + * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts + * in the list of projects. We do this because some projects need to be + * transpiled before they can be used. Ideally we shouldn't do this unless we + * have to, as it will slow down the bootstrapping process. + */ + + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_3__["parallelizeBatches"])(batchedProjects, async pkg => { + if (pkg.hasScript('kbn:bootstrap')) { + await pkg.runScriptStreaming('kbn:bootstrap'); + } + }); + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green.bold('\nBootstrapping completed!\n')); + } + }; /***/ }), /* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkProjectExecutables", function() { return linkProjectExecutables; }); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33); +/* + * 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. + */ + + -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkProjectExecutables = undefined; /** * Yarn does not link the executables from dependencies that are installed @@ -2608,130 +2607,122 @@ exports.linkProjectExecutables = undefined; * dependencies, and manually linking their executables if defined. The logic * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 */ -let linkProjectExecutables = exports.linkProjectExecutables = (() => { - var _ref = _asyncToGenerator(function* (projectsByName, projectGraph) { - for (const [projectName, projectDeps] of projectGraph) { - const project = projectsByName.get(projectName); - const binsDir = (0, _path.resolve)(project.nodeModulesLocation, '.bin'); - for (const projectDep of projectDeps) { - const executables = projectDep.getExecutables(); - for (const name of Object.keys(executables)) { - const srcPath = executables[name]; - // existing logic from lerna -- ensure that the bin we are going to - // point to exists or ignore it - if (!(yield (0, _fs.isFile)(srcPath))) { - continue; - } - const dest = (0, _path.resolve)(binsDir, name); - // Get relative project path with normalized path separators. - const projectRelativePath = (0, _path.relative)(project.path, srcPath).split(_path.sep).join('/'); - _log.log.write(_chalk2.default`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); - yield (0, _fs.mkdirp)((0, _path.dirname)(dest)); - yield (0, _fs.createSymlink)(srcPath, dest, 'exec'); - yield (0, _fs.chmod)(dest, '755'); - } - } +async function linkProjectExecutables(projectsByName, projectGraph) { + for (const [projectName, projectDeps] of projectGraph) { + const project = projectsByName.get(projectName); + const binsDir = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(project.nodeModulesLocation, '.bin'); + + for (const projectDep of projectDeps) { + const executables = projectDep.getExecutables(); + + for (const name of Object.keys(executables)) { + const srcPath = executables[name]; // existing logic from lerna -- ensure that the bin we are going to + // point to exists or ignore it + + if (!(await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["isFile"])(srcPath))) { + continue; } - }); - return function linkProjectExecutables(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + const dest = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(binsDir, name); // Get relative project path with normalized path separators. -var _path = __webpack_require__(16); - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ + const projectRelativePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["relative"])(project.path, srcPath).split(path__WEBPACK_IMPORTED_MODULE_0__["sep"]).join('/'); + _log__WEBPACK_IMPORTED_MODULE_3__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_1___default.a`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["mkdirp"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["dirname"])(dest)); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["createSymlink"])(srcPath, dest, 'exec'); + await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["chmod"])(dest, '755'); + } + } + } +} /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unlink", function() { return unlink; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyDirectory", function() { return copyDirectory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chmod", function() { return chmod; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFile", function() { return readFile; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mkdirp", function() { return mkdirp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDirectory", function() { return isDirectory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSymlink", function() { return createSymlink; }); +/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); +/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cmd_shim__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31); +/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mkdirp__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32); +/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_5__); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createSymlink = exports.isFile = exports.isDirectory = exports.mkdirp = exports.readFile = exports.chmod = exports.copyDirectory = exports.unlink = undefined; -let statTest = (() => { - var _ref = _asyncToGenerator(function* (path, block) { - try { - return block((yield stat(path))); - } catch (e) { - if (e.code === 'ENOENT') { - return false; - } - throw e; - } - }); - return function statTest(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + + +const stat = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.stat); +const readFile = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.readFile); +const symlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.symlink); +const chmod = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod); +const cmdShim = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(cmd_shim__WEBPACK_IMPORTED_MODULE_0___default.a); +const mkdirp = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(mkdirp__WEBPACK_IMPORTED_MODULE_2___default.a); +const unlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink); +const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(ncp__WEBPACK_IMPORTED_MODULE_3__["ncp"]); + + +async function statTest(path, block) { + try { + return block((await stat(path))); + } catch (e) { + if (e.code === 'ENOENT') { + return false; + } + + throw e; + } +} /** * Test if a path points to a directory. * @param path */ -let isDirectory = exports.isDirectory = (() => { - var _ref2 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isDirectory(); - }); - }); - - return function isDirectory(_x3) { - return _ref2.apply(this, arguments); - }; -})(); +async function isDirectory(path) { + return await statTest(path, stats => stats.isDirectory()); +} /** * Test if a path points to a regular file. * @param path */ - -let isFile = exports.isFile = (() => { - var _ref3 = _asyncToGenerator(function* (path) { - return yield statTest(path, function (stats) { - return stats.isFile(); - }); - }); - - return function isFile(_x4) { - return _ref3.apply(this, arguments); - }; -})(); +async function isFile(path) { + return await statTest(path, stats => stats.isFile()); +} /** * Create a symlink at dest that points to src. Adapted from * https://github.com/lerna/lerna/blob/2f1b87d9e2295f587e4ac74269f714271d8ed428/src/FileSystemUtilities.js#L103. @@ -2743,96 +2734,32 @@ let isFile = exports.isFile = (() => { * for executable files on windows. */ +async function createSymlink(src, dest, type) { + if (process.platform === 'win32') { + if (type === 'exec') { + await cmdShim(src, dest); + } else { + await forceCreate(src, dest, type); + } + } else { + const posixType = type === 'exec' ? 'file' : type; + const relativeSource = Object(path__WEBPACK_IMPORTED_MODULE_4__["relative"])(Object(path__WEBPACK_IMPORTED_MODULE_4__["dirname"])(dest), src); + await forceCreate(relativeSource, dest, posixType); + } +} -let createSymlink = exports.createSymlink = (() => { - var _ref4 = _asyncToGenerator(function* (src, dest, type) { - if (process.platform === 'win32') { - if (type === 'exec') { - yield cmdShim(src, dest); - } else { - yield forceCreate(src, dest, type); - } - } else { - const posixType = type === 'exec' ? 'file' : type; - const relativeSource = (0, _path.relative)((0, _path.dirname)(dest), src); - yield forceCreate(relativeSource, dest, posixType); - } - }); +async function forceCreate(src, dest, type) { + try { + // If something exists at `dest` we need to remove it first. + await unlink(dest); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } - return function createSymlink(_x5, _x6, _x7) { - return _ref4.apply(this, arguments); - }; -})(); - -let forceCreate = (() => { - var _ref5 = _asyncToGenerator(function* (src, dest, type) { - try { - // If something exists at `dest` we need to remove it first. - yield unlink(dest); - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } - } - yield symlink(src, dest, type); - }); - - return function forceCreate(_x8, _x9, _x10) { - return _ref5.apply(this, arguments); - }; -})(); - -var _cmdShim = __webpack_require__(21); - -var _cmdShim2 = _interopRequireDefault(_cmdShim); - -var _fs = __webpack_require__(23); - -var _fs2 = _interopRequireDefault(_fs); - -var _mkdirp = __webpack_require__(31); - -var _mkdirp2 = _interopRequireDefault(_mkdirp); - -var _ncp = __webpack_require__(32); - -var _path = __webpack_require__(16); - -var _util = __webpack_require__(29); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ - - -const stat = (0, _util.promisify)(_fs2.default.stat); -const readFile = (0, _util.promisify)(_fs2.default.readFile); -const symlink = (0, _util.promisify)(_fs2.default.symlink); -const chmod = (0, _util.promisify)(_fs2.default.chmod); -const cmdShim = (0, _util.promisify)(_cmdShim2.default); -const mkdirp = (0, _util.promisify)(_mkdirp2.default); -const unlink = exports.unlink = (0, _util.promisify)(_fs2.default.unlink); -const copyDirectory = exports.copyDirectory = (0, _util.promisify)(_ncp.ncp); -exports.chmod = chmod; -exports.readFile = readFile; -exports.mkdirp = mkdirp; + await symlink(src, dest, type); +} /***/ }), /* 21 */ @@ -4179,14 +4106,11 @@ function ncp (source, dest, options, callback) { /***/ }), /* 33 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -4205,7 +4129,7 @@ Object.defineProperty(exports, "__esModule", { * specific language governing permissions and limitations * under the License. */ -const log = exports.log = { +const log = { /** * Log something to the console. Ideally we would use a real logger in * kbn-pm, but that's a pretty big change for now. @@ -4215,19 +4139,17 @@ const log = exports.log = { // tslint:disable no-console console.log(...args); } + }; /***/ }), /* 34 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelizeBatches", function() { return parallelizeBatches; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelize", function() { return parallelize; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -4246,252 +4168,258 @@ Object.defineProperty(exports, "__esModule", { * specific language governing permissions and limitations * under the License. */ -let parallelizeBatches = exports.parallelizeBatches = (() => { - var _ref = _asyncToGenerator(function* (batches, fn) { - for (const batch of batches) { - // We need to make sure the entire batch has completed before we can move on - // to the next batch - yield parallelize(batch, fn); +async function parallelizeBatches(batches, fn) { + for (const batch of batches) { + // We need to make sure the entire batch has completed before we can move on + // to the next batch + await parallelize(batch, fn); + } +} +async function parallelize(items, fn, concurrency = 4) { + if (items.length === 0) { + return; + } + + return new Promise((resolve, reject) => { + let activePromises = 0; + const values = items.slice(0); + + async function scheduleItem(item) { + activePromises++; + + try { + await fn(item); + activePromises--; + + if (values.length > 0) { + // We have more work to do, so we schedule the next promise + scheduleItem(values.shift()); + } else if (activePromises === 0) { + // We have no more values left, and all items have completed, so we've + // completed all the work. + resolve(); } - }); + } catch (error) { + reject(error); + } + } - return function parallelizeBatches(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); - -let parallelize = exports.parallelize = (() => { - var _ref2 = _asyncToGenerator(function* (items, fn, concurrency = 4) { - if (items.length === 0) { - return; - } - return new Promise(function (resolve, reject) { - let scheduleItem = (() => { - var _ref3 = _asyncToGenerator(function* (item) { - activePromises++; - try { - yield fn(item); - activePromises--; - if (values.length > 0) { - // We have more work to do, so we schedule the next promise - scheduleItem(values.shift()); - } else if (activePromises === 0) { - // We have no more values left, and all items have completed, so we've - // completed all the work. - resolve(); - } - } catch (error) { - reject(error); - } - }); - - return function scheduleItem(_x5) { - return _ref3.apply(this, arguments); - }; - })(); - - let activePromises = 0; - const values = items.slice(0); - - values.splice(0, concurrency).map(scheduleItem); - }); - }); - - return function parallelize(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + values.splice(0, concurrency).map(scheduleItem); + }); +} /***/ }), /* 35 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return getProjects; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProjectGraph", function() { return buildProjectGraph; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topologicallyBatchProjects", function() { return topologicallyBatchProjects; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includeTransitiveProjects", function() { return includeTransitiveProjects; }); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); +/* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53); +/* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(131); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getProjects = undefined; -let getProjects = exports.getProjects = (() => { - var _ref = _asyncToGenerator(function* (rootPath, projectsPathsPatterns, { include = [], exclude = [] } = {}) { - const projects = new Map(); - const workspaceProjectsPaths = yield (0, _workspaces.workspacePackagePaths)(rootPath); - for (const pattern of projectsPathsPatterns) { - const pathsToProcess = yield packagesFromGlobPattern({ pattern, rootPath }); - for (const filePath of pathsToProcess) { - const projectConfigPath = normalize(filePath); - const projectDir = _path2.default.dirname(projectConfigPath); - const project = yield _project.Project.fromPath(projectDir); - if (workspaceProjectsPaths.indexOf(filePath) >= 0) { - project.isWorkspaceProject = true; - } - const excludeProject = exclude.includes(project.name) || include.length > 0 && !include.includes(project.name); - if (excludeProject) { - continue; - } - if (projects.has(project.name)) { - throw new _errors.CliError(`There are multiple projects with the same name [${project.name}]`, { - name: project.name, - paths: [project.path, projects.get(project.name).path] - }); - } - projects.set(project.name, project); - } - } - return projects; + + + +const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); +async function getProjects(rootPath, projectsPathsPatterns, { + include = [], + exclude = [] +} = {}) { + const projects = new Map(); + const workspaceProjectsPaths = await Object(_workspaces__WEBPACK_IMPORTED_MODULE_5__["workspacePackagePaths"])(rootPath); + + for (const pattern of projectsPathsPatterns) { + const pathsToProcess = await packagesFromGlobPattern({ + pattern, + rootPath }); - return function getProjects(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + for (const filePath of pathsToProcess) { + const projectConfigPath = normalize(filePath); + const projectDir = path__WEBPACK_IMPORTED_MODULE_1___default.a.dirname(projectConfigPath); + const project = await _project__WEBPACK_IMPORTED_MODULE_4__["Project"].fromPath(projectDir); -exports.buildProjectGraph = buildProjectGraph; -exports.topologicallyBatchProjects = topologicallyBatchProjects; -exports.includeTransitiveProjects = includeTransitiveProjects; + if (workspaceProjectsPaths.indexOf(filePath) >= 0) { + project.isWorkspaceProject = true; + } -var _glob = __webpack_require__(36); + const excludeProject = exclude.includes(project.name) || include.length > 0 && !include.includes(project.name); -var _glob2 = _interopRequireDefault(_glob); + if (excludeProject) { + continue; + } -var _path = __webpack_require__(16); + if (projects.has(project.name)) { + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There are multiple projects with the same name [${project.name}]`, { + name: project.name, + paths: [project.path, projects.get(project.name).path] + }); + } -var _path2 = _interopRequireDefault(_path); + projects.set(project.name, project); + } + } -var _util = __webpack_require__(29); - -var _errors = __webpack_require__(52); - -var _project = __webpack_require__(53); - -var _workspaces = __webpack_require__(131); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ - - -const glob = (0, _util.promisify)(_glob2.default); - -function packagesFromGlobPattern({ pattern, rootPath }) { - const globOptions = { - cwd: rootPath, - // Should throw in case of unusual errors when reading the file system - strict: true, - // Always returns absolute paths for matched files - absolute: true, - // Do not match ** against multiple filenames - // (This is only specified because we currently don't have a need for it.) - noglobstar: true - }; - return glob(_path2.default.join(pattern, 'package.json'), globOptions); + return projects; } -// https://github.com/isaacs/node-glob/blob/master/common.js#L104 + +function packagesFromGlobPattern({ + pattern, + rootPath +}) { + const globOptions = { + cwd: rootPath, + // Should throw in case of unusual errors when reading the file system + strict: true, + // Always returns absolute paths for matched files + absolute: true, + // Do not match ** against multiple filenames + // (This is only specified because we currently don't have a need for it.) + noglobstar: true + }; + return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); +} // https://github.com/isaacs/node-glob/blob/master/common.js#L104 // glob always returns "\\" as "/" in windows, so everyone // gets normalized because we can't have nice things. + + function normalize(dir) { - return _path2.default.normalize(dir); + return path__WEBPACK_IMPORTED_MODULE_1___default.a.normalize(dir); } + function buildProjectGraph(projects) { - const projectGraph = new Map(); - for (const project of projects.values()) { - const projectDeps = []; - const dependencies = project.allDependencies; - for (const depName of Object.keys(dependencies)) { - if (projects.has(depName)) { - const dep = projects.get(depName); - const dependentProjectIsInWorkspace = project.isWorkspaceProject || project.json.name === 'kibana'; - project.ensureValidProjectDependency(dep, dependentProjectIsInWorkspace); - projectDeps.push(dep); - } - } - projectGraph.set(project.name, projectDeps); + const projectGraph = new Map(); + + for (const project of projects.values()) { + const projectDeps = []; + const dependencies = project.allDependencies; + + for (const depName of Object.keys(dependencies)) { + if (projects.has(depName)) { + const dep = projects.get(depName); + const dependentProjectIsInWorkspace = project.isWorkspaceProject || project.json.name === 'kibana'; + project.ensureValidProjectDependency(dep, dependentProjectIsInWorkspace); + projectDeps.push(dep); + } } - return projectGraph; + + projectGraph.set(project.name, projectDeps); + } + + return projectGraph; } -function topologicallyBatchProjects(projectsToBatch, projectGraph, { batchByWorkspace = false } = {}) { - // We're going to be chopping stuff out of this list, so copy it. - const projectsLeftToBatch = new Set(projectsToBatch.keys()); - const batches = []; - if (batchByWorkspace) { - const workspaceRootProject = Array.from(projectsToBatch.values()).find(p => p.isWorkspaceRoot); - if (!workspaceRootProject) { - throw new _errors.CliError(`There was no yarn workspace root found.`); - } - // Push in the workspace root first. - batches.push([workspaceRootProject]); - projectsLeftToBatch.delete(workspaceRootProject.name); - // In the next batch, push in all workspace projects. - const workspaceBatch = []; - for (const projectName of projectsLeftToBatch) { - const project = projectsToBatch.get(projectName); - if (project.isWorkspaceProject) { - workspaceBatch.push(project); - projectsLeftToBatch.delete(projectName); - } - } - batches.push(workspaceBatch); +function topologicallyBatchProjects(projectsToBatch, projectGraph, { + batchByWorkspace = false +} = {}) { + // We're going to be chopping stuff out of this list, so copy it. + const projectsLeftToBatch = new Set(projectsToBatch.keys()); + const batches = []; + + if (batchByWorkspace) { + const workspaceRootProject = Array.from(projectsToBatch.values()).find(p => p.isWorkspaceRoot); + + if (!workspaceRootProject) { + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There was no yarn workspace root found.`); + } // Push in the workspace root first. + + + batches.push([workspaceRootProject]); + projectsLeftToBatch.delete(workspaceRootProject.name); // In the next batch, push in all workspace projects. + + const workspaceBatch = []; + + for (const projectName of projectsLeftToBatch) { + const project = projectsToBatch.get(projectName); + + if (project.isWorkspaceProject) { + workspaceBatch.push(project); + projectsLeftToBatch.delete(projectName); + } } - while (projectsLeftToBatch.size > 0) { - // Get all projects that have no remaining dependencies within the repo - // that haven't yet been picked. - const batch = []; - for (const projectName of projectsLeftToBatch) { - const projectDeps = projectGraph.get(projectName); - const needsDependenciesBatched = projectDeps.some(dep => projectsLeftToBatch.has(dep.name)); - if (!needsDependenciesBatched) { - batch.push(projectsToBatch.get(projectName)); - } - } - // If we weren't able to find a project with no remaining dependencies, - // then we've encountered a cycle in the dependency graph. - const hasCycles = batch.length === 0; - if (hasCycles) { - const cycleProjectNames = [...projectsLeftToBatch]; - const message = 'Encountered a cycle in the dependency graph. Projects in cycle are:\n' + cycleProjectNames.join(', '); - throw new _errors.CliError(message); - } - batches.push(batch); - batch.forEach(project => projectsLeftToBatch.delete(project.name)); + + batches.push(workspaceBatch); + } + + while (projectsLeftToBatch.size > 0) { + // Get all projects that have no remaining dependencies within the repo + // that haven't yet been picked. + const batch = []; + + for (const projectName of projectsLeftToBatch) { + const projectDeps = projectGraph.get(projectName); + const needsDependenciesBatched = projectDeps.some(dep => projectsLeftToBatch.has(dep.name)); + + if (!needsDependenciesBatched) { + batch.push(projectsToBatch.get(projectName)); + } + } // If we weren't able to find a project with no remaining dependencies, + // then we've encountered a cycle in the dependency graph. + + + const hasCycles = batch.length === 0; + + if (hasCycles) { + const cycleProjectNames = [...projectsLeftToBatch]; + const message = 'Encountered a cycle in the dependency graph. Projects in cycle are:\n' + cycleProjectNames.join(', '); + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](message); } - return batches; + + batches.push(batch); + batch.forEach(project => projectsLeftToBatch.delete(project.name)); + } + + return batches; } -function includeTransitiveProjects(subsetOfProjects, allProjects, { onlyProductionDependencies = false } = {}) { - const dependentProjects = new Map(); - // the current list of packages we are expanding using breadth-first-search - const toProcess = [...subsetOfProjects]; - while (toProcess.length > 0) { - const project = toProcess.shift(); - const dependencies = onlyProductionDependencies ? project.productionDependencies : project.allDependencies; - Object.keys(dependencies).forEach(dep => { - if (allProjects.has(dep)) { - toProcess.push(allProjects.get(dep)); - } - }); - dependentProjects.set(project.name, project); - } - return dependentProjects; +function includeTransitiveProjects(subsetOfProjects, allProjects, { + onlyProductionDependencies = false +} = {}) { + const dependentProjects = new Map(); // the current list of packages we are expanding using breadth-first-search + + const toProcess = [...subsetOfProjects]; + + while (toProcess.length > 0) { + const project = toProcess.shift(); + const dependencies = onlyProductionDependencies ? project.productionDependencies : project.allDependencies; + Object.keys(dependencies).forEach(dep => { + if (allProjects.has(dep)) { + toProcess.push(allProjects.get(dep)); + } + }); + dependentProjects.set(project.name, project); + } + + return dependentProjects; } /***/ }), @@ -7854,14 +7782,11 @@ function onceStrict (fn) { /***/ }), /* 52 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CliError", function() { return CliError; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -7881,207 +7806,33 @@ Object.defineProperty(exports, "__esModule", { * under the License. */ class CliError extends Error { - constructor(message, meta = {}) { - super(message); - this.meta = meta; - } + constructor(message, meta = {}) { + super(message); + this.meta = meta; + } + } -exports.CliError = CliError; /***/ }), /* 53 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return Project; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); +/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54); +/* harmony import */ var _scripts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Project = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* - * 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. - */ - - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _path = __webpack_require__(16); - -var _util = __webpack_require__(29); - -var _errors = __webpack_require__(52); - -var _log = __webpack_require__(33); - -var _package_json = __webpack_require__(54); - -var _scripts = __webpack_require__(92); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } - -class Project { - constructor(packageJson, projectPath) { - this.isWorkspaceRoot = false; - this.isWorkspaceProject = false; - this.json = Object.freeze(packageJson); - this.path = projectPath; - this.packageJsonLocation = (0, _path.resolve)(this.path, 'package.json'); - this.nodeModulesLocation = (0, _path.resolve)(this.path, 'node_modules'); - this.targetLocation = (0, _path.resolve)(this.path, 'target'); - this.productionDependencies = this.json.dependencies || {}; - this.devDependencies = this.json.devDependencies || {}; - this.allDependencies = _extends({}, this.devDependencies, this.productionDependencies); - this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); - this.scripts = this.json.scripts || {}; - } - static fromPath(path) { - return _asyncToGenerator(function* () { - const pkgJson = yield (0, _package_json.readPackageJson)(path); - return new Project(pkgJson, path); - })(); - } - get name() { - return this.json.name; - } - ensureValidProjectDependency(project, dependentProjectIsInWorkspace) { - const versionInPackageJson = this.allDependencies[project.name]; - let expectedVersionInPackageJson; - if (dependentProjectIsInWorkspace) { - expectedVersionInPackageJson = project.json.version; - } else { - const relativePathToProject = normalizePath((0, _path.relative)(this.path, project.path)); - expectedVersionInPackageJson = `link:${relativePathToProject}`; - } - // No issues! - if (versionInPackageJson === expectedVersionInPackageJson) { - return; - } - let problemMsg; - if ((0, _package_json.isLinkDependency)(versionInPackageJson) && dependentProjectIsInWorkspace) { - problemMsg = `but should be using a workspace`; - } else if ((0, _package_json.isLinkDependency)(versionInPackageJson)) { - problemMsg = `using 'link:', but the path is wrong`; - } else { - problemMsg = `but it's not using the local package`; - } - throw new _errors.CliError(`[${this.name}] depends on [${project.name}] ${problemMsg}. Update its package.json to the expected value below.`, { - actual: `"${project.name}": "${versionInPackageJson}"`, - expected: `"${project.name}": "${expectedVersionInPackageJson}"`, - package: `${this.name} (${this.packageJsonLocation})` - }); - } - getBuildConfig() { - return this.json.kibana && this.json.kibana.build || {}; - } - /** - * Returns the directory that should be copied into the Kibana build artifact. - * This config can be specified to only include the project's build artifacts - * instead of everything located in the project directory. - */ - getIntermediateBuildDirectory() { - return (0, _path.resolve)(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); - } - getCleanConfig() { - return this.json.kibana && this.json.kibana.clean || {}; - } - hasScript(name) { - return name in this.scripts; - } - getExecutables() { - const raw = this.json.bin; - if (!raw) { - return {}; - } - if (typeof raw === 'string') { - return { - [this.name]: (0, _path.resolve)(this.path, raw) - }; - } - if (typeof raw === 'object') { - const binsConfig = {}; - for (const binName of Object.keys(raw)) { - binsConfig[binName] = (0, _path.resolve)(this.path, raw[binName]); - } - return binsConfig; - } - throw new _errors.CliError(`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { - binConfig: (0, _util.inspect)(raw), - package: `${this.name} (${this.packageJsonLocation})` - }); - } - runScript(scriptName, args = []) { - var _this = this; - - return _asyncToGenerator(function* () { - _log.log.write(_chalk2.default.bold(`\n\nRunning script [${_chalk2.default.green(scriptName)}] in [${_chalk2.default.green(_this.name)}]:\n`)); - return (0, _scripts.runScriptInPackage)(scriptName, args, _this); - })(); - } - runScriptStreaming(scriptName, args = []) { - return (0, _scripts.runScriptInPackageStreaming)(scriptName, args, this); - } - hasDependencies() { - return Object.keys(this.allDependencies).length > 0; - } - installDependencies({ extraArgs }) { - var _this2 = this; - - return _asyncToGenerator(function* () { - _log.log.write(_chalk2.default.bold(`\n\nInstalling dependencies in [${_chalk2.default.green(_this2.name)}]:\n`)); - return (0, _scripts.installInDir)(_this2.path, extraArgs); - })(); - } -} -exports.Project = Project; // We normalize all path separators to `/` in generated files - -function normalizePath(path) { - return path.replace(/[\\\/]+/g, '/'); -} - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isLinkDependency = undefined; -exports.readPackageJson = readPackageJson; -exports.writePackageJson = writePackageJson; - -var _readPkg = __webpack_require__(55); - -var _readPkg2 = _interopRequireDefault(_readPkg); - -var _writePkg = __webpack_require__(82); - -var _writePkg2 = _interopRequireDefault(_writePkg); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -8101,13 +7852,210 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * specific language governing permissions and limitations * under the License. */ + + + + + + + +class Project { + static async fromPath(path) { + const pkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["readPackageJson"])(path); + return new Project(pkgJson, path); + } + + constructor(packageJson, projectPath) { + _defineProperty(this, "json", void 0); + + _defineProperty(this, "packageJsonLocation", void 0); + + _defineProperty(this, "nodeModulesLocation", void 0); + + _defineProperty(this, "targetLocation", void 0); + + _defineProperty(this, "path", void 0); + + _defineProperty(this, "allDependencies", void 0); + + _defineProperty(this, "productionDependencies", void 0); + + _defineProperty(this, "devDependencies", void 0); + + _defineProperty(this, "scripts", void 0); + + _defineProperty(this, "isWorkspaceRoot", false); + + _defineProperty(this, "isWorkspaceProject", false); + + this.json = Object.freeze(packageJson); + this.path = projectPath; + this.packageJsonLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'package.json'); + this.nodeModulesLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'node_modules'); + this.targetLocation = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, 'target'); + this.productionDependencies = this.json.dependencies || {}; + this.devDependencies = this.json.devDependencies || {}; + this.allDependencies = _objectSpread({}, this.devDependencies, this.productionDependencies); + this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); + this.scripts = this.json.scripts || {}; + } + + get name() { + return this.json.name; + } + + ensureValidProjectDependency(project, dependentProjectIsInWorkspace) { + const versionInPackageJson = this.allDependencies[project.name]; + let expectedVersionInPackageJson; + + if (dependentProjectIsInWorkspace) { + expectedVersionInPackageJson = project.json.version; + } else { + const relativePathToProject = normalizePath(Object(path__WEBPACK_IMPORTED_MODULE_1__["relative"])(this.path, project.path)); + expectedVersionInPackageJson = `link:${relativePathToProject}`; + } // No issues! + + + if (versionInPackageJson === expectedVersionInPackageJson) { + return; + } + + let problemMsg; + + if (Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["isLinkDependency"])(versionInPackageJson) && dependentProjectIsInWorkspace) { + problemMsg = `but should be using a workspace`; + } else if (Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["isLinkDependency"])(versionInPackageJson)) { + problemMsg = `using 'link:', but the path is wrong`; + } else { + problemMsg = `but it's not using the local package`; + } + + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`[${this.name}] depends on [${project.name}] ${problemMsg}. Update its package.json to the expected value below.`, { + actual: `"${project.name}": "${versionInPackageJson}"`, + expected: `"${project.name}": "${expectedVersionInPackageJson}"`, + package: `${this.name} (${this.packageJsonLocation})` + }); + } + + getBuildConfig() { + return this.json.kibana && this.json.kibana.build || {}; + } + /** + * Returns the directory that should be copied into the Kibana build artifact. + * This config can be specified to only include the project's build artifacts + * instead of everything located in the project directory. + */ + + + getIntermediateBuildDirectory() { + return Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); + } + + getCleanConfig() { + return this.json.kibana && this.json.kibana.clean || {}; + } + + hasScript(name) { + return name in this.scripts; + } + + getExecutables() { + const raw = this.json.bin; + + if (!raw) { + return {}; + } + + if (typeof raw === 'string') { + return { + [this.name]: Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, raw) + }; + } + + if (typeof raw === 'object') { + const binsConfig = {}; + + for (const binName of Object.keys(raw)) { + binsConfig[binName] = Object(path__WEBPACK_IMPORTED_MODULE_1__["resolve"])(this.path, raw[binName]); + } + + return binsConfig; + } + + throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { + binConfig: Object(util__WEBPACK_IMPORTED_MODULE_2__["inspect"])(raw), + package: `${this.name} (${this.packageJsonLocation})` + }); + } + + async runScript(scriptName, args = []) { + _log__WEBPACK_IMPORTED_MODULE_4__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["runScriptInPackage"])(scriptName, args, this); + } + + runScriptStreaming(scriptName, args = []) { + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["runScriptInPackageStreaming"])(scriptName, args, this); + } + + hasDependencies() { + return Object.keys(this.allDependencies).length > 0; + } + + async installDependencies({ + extraArgs + }) { + _log__WEBPACK_IMPORTED_MODULE_4__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nInstalling dependencies in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); + return Object(_scripts__WEBPACK_IMPORTED_MODULE_6__["installInDir"])(this.path, extraArgs); + } + +} // We normalize all path separators to `/` in generated files + +function normalizePath(path) { + return path.replace(/[\\\/]+/g, '/'); +} + +/***/ }), +/* 54 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readPackageJson", function() { return readPackageJson; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writePackageJson", function() { return writePackageJson; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkDependency", function() { return isLinkDependency; }); +/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55); +/* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(read_pkg__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82); +/* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(write_pkg__WEBPACK_IMPORTED_MODULE_1__); +/* + * 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. + */ + + function readPackageJson(dir) { - return (0, _readPkg2.default)(dir, { normalize: false }); + return read_pkg__WEBPACK_IMPORTED_MODULE_0___default()(dir, { + normalize: false + }); } function writePackageJson(path, json) { - return (0, _writePkg2.default)(path, json); + return write_pkg__WEBPACK_IMPORTED_MODULE_1___default()(path, json); } -const isLinkDependency = exports.isLinkDependency = depVersion => depVersion.startsWith('link:'); +const isLinkDependency = depVersion => depVersion.startsWith('link:'); /***/ }), /* 55 */ @@ -13496,165 +13444,141 @@ module.exports = str => { /***/ }), /* 92 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installInDir", function() { return installInDir; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackage", function() { return runScriptInPackage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackageStreaming", function() { return runScriptInPackageStreaming; }); +/* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.runScriptInPackage = exports.installInDir = undefined; - /** * Install all dependencies in the given directory */ -let installInDir = exports.installInDir = (() => { - var _ref = _asyncToGenerator(function* (directory, extraArgs = []) { - const options = ['install', '--non-interactive', ...extraArgs]; - // We pass the mutex flag to ensure only one instance of yarn runs at any - // given time (e.g. to avoid conflicts). - yield (0, _child_process.spawn)('yarn', options, { - cwd: directory - }); - }); +async function installInDir(directory, extraArgs = []) { + const options = ['install', '--non-interactive', ...extraArgs]; // We pass the mutex flag to ensure only one instance of yarn runs at any + // given time (e.g. to avoid conflicts). - return function installInDir(_x) { - return _ref.apply(this, arguments); - }; -})(); + await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', options, { + cwd: directory + }); +} /** * Run script in the given directory */ - -let runScriptInPackage = exports.runScriptInPackage = (() => { - var _ref2 = _asyncToGenerator(function* (script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - yield (0, _child_process.spawn)('yarn', ['run', script, ...args], execOpts); - }); - - return function runScriptInPackage(_x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); +async function runScriptInPackage(script, args, pkg) { + const execOpts = { + cwd: pkg.path + }; + await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['run', script, ...args], execOpts); +} /** * Run script in the given directory */ - -exports.runScriptInPackageStreaming = runScriptInPackageStreaming; - -var _child_process = __webpack_require__(93); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ - - function runScriptInPackageStreaming(script, args, pkg) { - const execOpts = { - cwd: pkg.path - }; - return (0, _child_process.spawnStreaming)('yarn', ['run', script, ...args], execOpts, { - prefix: pkg.name - }); + const execOpts = { + cwd: pkg.path + }; + return Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawnStreaming"])('yarn', ['run', script, ...args], execOpts, { + prefix: pkg.name + }); } /***/ }), /* 93 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawn", function() { return spawn; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawnStreaming", function() { return spawnStreaming; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94); +/* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(122); +/* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(log_symbols__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(123); +/* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* - * 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. - */ -exports.spawn = spawn; -exports.spawnStreaming = spawnStreaming; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _execa = __webpack_require__(94); - -var _execa2 = _interopRequireDefault(_execa); - -var _logSymbols = __webpack_require__(122); - -var _logSymbols2 = _interopRequireDefault(_logSymbols); - -var _strongLogTransformer = __webpack_require__(123); - -var _strongLogTransformer2 = _interopRequireDefault(_strongLogTransformer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function generateColors() { - const colorWheel = [_chalk2.default.cyan, _chalk2.default.magenta, _chalk2.default.blue, _chalk2.default.yellow, _chalk2.default.green]; - const count = colorWheel.length; - let children = 0; - return () => colorWheel[children++ % count]; + const colorWheel = [chalk__WEBPACK_IMPORTED_MODULE_0___default.a.cyan, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.magenta, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.blue, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green]; + const count = colorWheel.length; + let children = 0; + return () => colorWheel[children++ % count]; } + function spawn(command, args, opts) { - return (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: 'inherit' - })); + return execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({}, opts, { + stdio: 'inherit' + })); } const nextColor = generateColors(); -function spawnStreaming(command, args, opts, { prefix }) { - const spawned = (0, _execa2.default)(command, args, _extends({}, opts, { - stdio: ['ignore', 'pipe', 'pipe'] - })); - const color = nextColor(); - const prefixedStdout = (0, _strongLogTransformer2.default)({ tag: `${color.bold(prefix)}:` }); - const prefixedStderr = (0, _strongLogTransformer2.default)({ - mergeMultiline: true, - tag: `${_logSymbols2.default.error} ${color.bold(prefix)}:` - }); - spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); - spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); - return spawned; +function spawnStreaming(command, args, opts, { + prefix +}) { + const spawned = execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({}, opts, { + stdio: ['ignore', 'pipe', 'pipe'] + })); + const color = nextColor(); + const prefixedStdout = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ + tag: `${color.bold(prefix)}:` + }); + const prefixedStderr = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ + mergeMultiline: true, + tag: `${log_symbols__WEBPACK_IMPORTED_MODULE_2___default.a.error} ${color.bold(prefix)}:` + }); + spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); + spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); + return spawned; } /***/ }), @@ -17429,306 +17353,290 @@ module.exports = {"name":"strong-log-transformer","version":"2.1.0","description /***/ }), /* 131 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "workspacePackagePaths", function() { return workspacePackagePaths; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return copyWorkspacePackages; }); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); +/* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); +/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(132); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54); +/* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.copyWorkspacePackages = exports.workspacePackagePaths = undefined; - -let workspacePackagePaths = exports.workspacePackagePaths = (() => { - var _ref = _asyncToGenerator(function* (rootPath) { - const rootPkgJson = yield (0, _package_json.readPackageJson)(_path2.default.join(rootPath, 'package.json')); - if (!rootPkgJson.workspaces) { - return []; - } - const workspacesPathsPatterns = rootPkgJson.workspaces.packages; - let workspaceProjectsPaths = []; - for (const pattern of workspacesPathsPatterns) { - workspaceProjectsPaths = workspaceProjectsPaths.concat((yield packagesFromGlobPattern({ pattern, rootPath }))); - } - // Filter out exclude glob patterns - for (const pattern of workspacesPathsPatterns) { - if (pattern.startsWith('!')) { - const pathToRemove = _path2.default.join(rootPath, pattern.slice(1), 'package.json'); - workspaceProjectsPaths = workspaceProjectsPaths.filter(function (p) { - return p !== pathToRemove; - }); - } - } - return workspaceProjectsPaths; - }); - - return function workspacePackagePaths(_x) { - return _ref.apply(this, arguments); - }; -})(); - -let copyWorkspacePackages = exports.copyWorkspacePackages = (() => { - var _ref2 = _asyncToGenerator(function* (rootPath) { - const workspaceProjects = yield getWorkspaceProjects(rootPath); - for (const project of workspaceProjects.values()) { - const dest = _path2.default.resolve(rootPath, 'node_modules', project.name); - // Remove the symlink - yield (0, _fs.unlink)(dest); - // Copy in the package - yield (0, _fs.copyDirectory)(project.path, dest); - } - }); - - return function copyWorkspacePackages(_x2) { - return _ref2.apply(this, arguments); - }; -})(); - -let getWorkspaceProjects = (() => { - var _ref3 = _asyncToGenerator(function* (rootPath) { - const projectPaths = (0, _config.getProjectPaths)(rootPath, {}); - const projects = yield (0, _projects.getProjects)(rootPath, projectPaths); - for (const [key, project] of projects.entries()) { - if (!project.isWorkspaceProject) { - projects.delete(key); - } - } - return projects; - }); - - return function getWorkspaceProjects(_x3) { - return _ref3.apply(this, arguments); - }; -})(); - -var _glob = __webpack_require__(36); - -var _glob2 = _interopRequireDefault(_glob); - -var _path = __webpack_require__(16); - -var _path2 = _interopRequireDefault(_path); - -var _util = __webpack_require__(29); - -var _config = __webpack_require__(132); - -var _fs = __webpack_require__(20); - -var _package_json = __webpack_require__(54); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ -const glob = (0, _util.promisify)(_glob2.default); -function packagesFromGlobPattern({ pattern, rootPath }) { - const globOptions = { - cwd: rootPath, - // Should throw in case of unusual errors when reading the file system - strict: true, - // Always returns absolute paths for matched files - absolute: true, - // Do not match ** against multiple filenames - // (This is only specified because we currently don't have a need for it.) - noglobstar: true - }; - return glob(_path2.default.join(pattern, 'package.json'), globOptions); + + +const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); +async function workspacePackagePaths(rootPath) { + const rootPkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["readPackageJson"])(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, 'package.json')); + + if (!rootPkgJson.workspaces) { + return []; + } + + const workspacesPathsPatterns = rootPkgJson.workspaces.packages; + let workspaceProjectsPaths = []; + + for (const pattern of workspacesPathsPatterns) { + workspaceProjectsPaths = workspaceProjectsPaths.concat((await packagesFromGlobPattern({ + pattern, + rootPath + }))); + } // Filter out exclude glob patterns + + + for (const pattern of workspacesPathsPatterns) { + if (pattern.startsWith('!')) { + const pathToRemove = path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, pattern.slice(1), 'package.json'); + workspaceProjectsPaths = workspaceProjectsPaths.filter(p => p !== pathToRemove); + } + } + + return workspaceProjectsPaths; +} +async function copyWorkspacePackages(rootPath) { + const workspaceProjects = await getWorkspaceProjects(rootPath); + + for (const project of workspaceProjects.values()) { + const dest = path__WEBPACK_IMPORTED_MODULE_1___default.a.resolve(rootPath, 'node_modules', project.name); // Remove the symlink + + await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["unlink"])(dest); // Copy in the package + + await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["copyDirectory"])(project.path, dest); + } +} + +async function getWorkspaceProjects(rootPath) { + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); + const projects = await Object(_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(rootPath, projectPaths); + + for (const [key, project] of projects.entries()) { + if (!project.isWorkspaceProject) { + projects.delete(key); + } + } + + return projects; +} + +function packagesFromGlobPattern({ + pattern, + rootPath +}) { + const globOptions = { + cwd: rootPath, + // Should throw in case of unusual errors when reading the file system + strict: true, + // Always returns absolute paths for matched files + absolute: true, + // Do not match ** against multiple filenames + // (This is only specified because we currently don't have a need for it.) + noglobstar: true + }; + return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); } /***/ }), /* 132 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return getProjectPaths; }); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getProjectPaths = getProjectPaths; - -var _path = __webpack_require__(16); - /** * Returns all the paths where plugins are located */ function getProjectPaths(rootPath, options) { - const skipKibanaPlugins = Boolean(options['skip-kibana-plugins']); - const ossOnly = Boolean(options.oss); - const projectPaths = [rootPath, (0, _path.resolve)(rootPath, 'packages/*')]; - // This is needed in order to install the dependencies for the declared - // plugin functional used in the selenium functional tests. - // As we are now using the webpack dll for the client vendors dependencies - // when we run the plugin functional tests against the distributable - // dependencies used by such plugins like @eui, react and react-dom can't - // be loaded from the dll as the context is different from the one declared - // into the webpack dll reference plugin. - // In anyway, have a plugin declaring their own dependencies is the - // correct and the expect behavior. - projectPaths.push((0, _path.resolve)(rootPath, 'test/plugin_functional/plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'test/interpreter_functional/plugins/*')); - if (!ossOnly) { - projectPaths.push((0, _path.resolve)(rootPath, 'x-pack')); - projectPaths.push((0, _path.resolve)(rootPath, 'x-pack/plugins/*')); - } - if (!skipKibanaPlugins) { - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*')); - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*/packages/*')); - projectPaths.push((0, _path.resolve)(rootPath, '../kibana-extra/*/plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*/packages/*')); - projectPaths.push((0, _path.resolve)(rootPath, 'plugins/*/plugins/*')); - } - return projectPaths; -} /* - * 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. - */ + const skipKibanaPlugins = Boolean(options['skip-kibana-plugins']); + const ossOnly = Boolean(options.oss); + const projectPaths = [rootPath, Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'packages/*')]; // This is needed in order to install the dependencies for the declared + // plugin functional used in the selenium functional tests. + // As we are now using the webpack dll for the client vendors dependencies + // when we run the plugin functional tests against the distributable + // dependencies used by such plugins like @eui, react and react-dom can't + // be loaded from the dll as the context is different from the one declared + // into the webpack dll reference plugin. + // In anyway, have a plugin declaring their own dependencies is the + // correct and the expect behavior. + + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/plugin_functional/plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/interpreter_functional/plugins/*')); + + if (!ossOnly) { + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack/plugins/*')); + } + + if (!skipKibanaPlugins) { + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/packages/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/packages/*')); + projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/plugins/*')); + } + + return projectPaths; +} /***/ }), /* 133 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CleanCommand", function() { return CleanCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(134); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(148); +/* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ora__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CleanCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _del = __webpack_require__(134); - -var _del2 = _interopRequireDefault(_del); - -var _ora = __webpack_require__(148); - -var _ora2 = _interopRequireDefault(_ora); - -var _path = __webpack_require__(16); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ -const CleanCommand = exports.CleanCommand = { - description: 'Remove the node_modules and target directories from all projects.', - name: 'clean', - run(projects) { - return _asyncToGenerator(function* () { - const toDelete = []; - for (const project of projects.values()) { - if (yield (0, _fs.isDirectory)(project.nodeModulesLocation)) { - toDelete.push({ - cwd: project.path, - pattern: (0, _path.relative)(project.path, project.nodeModulesLocation) - }); - } - if (yield (0, _fs.isDirectory)(project.targetLocation)) { - toDelete.push({ - cwd: project.path, - pattern: (0, _path.relative)(project.path, project.targetLocation) - }); - } - const { extraPatterns } = project.getCleanConfig(); - if (extraPatterns) { - toDelete.push({ - cwd: project.path, - pattern: extraPatterns - }); - } - } - if (toDelete.length === 0) { - _log.log.write(_chalk2.default.bold.green('\n\nNothing to delete')); - } else { - _log.log.write(_chalk2.default.bold.red('\n\nDeleting:\n')); - /** - * In order to avoid patterns like `/build` in packages from accidentally - * impacting files outside the package we use `process.chdir()` to change - * the cwd to the package and execute `del()` without the `force` option - * so it will check that each file being deleted is within the package. - * - * `del()` does support a `cwd` option, but it's only for resolving the - * patterns and does not impact the cwd check. - */ - const originalCwd = process.cwd(); - try { - for (const _ref of toDelete) { - const { pattern, cwd } = _ref; - process.chdir(cwd); - const promise = (0, _del2.default)(pattern); - _ora2.default.promise(promise, (0, _path.relative)(originalCwd, (0, _path.join)(cwd, String(pattern)))); - yield promise; - } - } finally { - process.chdir(originalCwd); - } - } - })(); + +const CleanCommand = { + description: 'Remove the node_modules and target directories from all projects.', + name: 'clean', + + async run(projects) { + const toDelete = []; + + for (const project of projects.values()) { + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.nodeModulesLocation)) { + toDelete.push({ + cwd: project.path, + pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.nodeModulesLocation) + }); + } + + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.targetLocation)) { + toDelete.push({ + cwd: project.path, + pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.targetLocation) + }); + } + + const { + extraPatterns + } = project.getCleanConfig(); + + if (extraPatterns) { + toDelete.push({ + cwd: project.path, + pattern: extraPatterns + }); + } } + + if (toDelete.length === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.green('\n\nNothing to delete')); + } else { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red('\n\nDeleting:\n')); + /** + * In order to avoid patterns like `/build` in packages from accidentally + * impacting files outside the package we use `process.chdir()` to change + * the cwd to the package and execute `del()` without the `force` option + * so it will check that each file being deleted is within the package. + * + * `del()` does support a `cwd` option, but it's only for resolving the + * patterns and does not impact the cwd check. + */ + + const originalCwd = process.cwd(); + + try { + for (const _ref of toDelete) { + const { + pattern, + cwd + } = _ref; + process.chdir(cwd); + const promise = del__WEBPACK_IMPORTED_MODULE_1___default()(pattern); + ora__WEBPACK_IMPORTED_MODULE_2___default.a.promise(promise, Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(originalCwd, Object(path__WEBPACK_IMPORTED_MODULE_3__["join"])(cwd, String(pattern)))); + await promise; + } + } finally { + process.chdir(originalCwd); + } + } + } + }; /***/ }), @@ -19288,202 +19196,16 @@ module.exports = {"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼", /***/ }), /* 155 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.RunCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ - - -const RunCommand = exports.RunCommand = { - description: 'Run script defined in package.json in each package that contains that script.', - name: 'run', - run(projects, projectGraph, { extraArgs }) { - return _asyncToGenerator(function* () { - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - if (extraArgs.length === 0) { - _log.log.write(_chalk2.default.red.bold('\nNo script specified')); - process.exit(1); - } - const scriptName = extraArgs[0]; - const scriptArgs = extraArgs.slice(1); - _log.log.write(_chalk2.default.bold(`\nRunning script [${_chalk2.default.green(scriptName)}] in batched topological order\n`)); - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - if (pkg.hasScript(scriptName)) { - yield pkg.runScriptStreaming(scriptName, scriptArgs); - } - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - })(); - } -}; - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.WatchCommand = undefined; - -var _chalk = __webpack_require__(2); - -var _chalk2 = _interopRequireDefault(_chalk); - -var _log = __webpack_require__(33); - -var _parallelize = __webpack_require__(34); - -var _projects = __webpack_require__(35); - -var _watch = __webpack_require__(157); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ - - -/** - * Name of the script in the package/project package.json file to run during `kbn watch`. - */ -const watchScriptName = 'kbn:watch'; -/** - * Name of the Kibana project. - */ -const kibanaProjectName = 'kibana'; -/** - * Command that traverses through list of available projects/packages that have `kbn:watch` script in their - * package.json files, groups them into topology aware batches and then processes theses batches one by one - * running `kbn:watch` scripts in parallel within the same batch. - * - * Command internally relies on the fact that most of the build systems that are triggered by `kbn:watch` - * will emit special "marker" once build/watch process is ready that we can use as completion condition for - * the `kbn:watch` script and eventually for the entire batch. Currently we support completion "markers" for - * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. - */ -const WatchCommand = exports.WatchCommand = { - description: 'Runs `kbn:watch` script for every project.', - name: 'watch', - run(projects, projectGraph) { - return _asyncToGenerator(function* () { - const projectsToWatch = new Map(); - for (const project of projects.values()) { - // We can't watch project that doesn't have `kbn:watch` script. - if (project.hasScript(watchScriptName)) { - projectsToWatch.set(project.name, project); - } - } - if (projectsToWatch.size === 0) { - _log.log.write(_chalk2.default.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); - return; - } - const projectNames = Array.from(projectsToWatch.keys()); - _log.log.write(_chalk2.default.bold(_chalk2.default.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); - // Kibana should always be run the last, so we don't rely on automatic - // topological batching and push it to the last one-entry batch manually. - const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projectsToWatch, projectGraph); - if (shouldWatchKibanaProject) { - batchedProjects.push([projects.get(kibanaProjectName)]); - } - yield (0, _parallelize.parallelizeBatches)(batchedProjects, (() => { - var _ref = _asyncToGenerator(function* (pkg) { - const completionHint = yield (0, _watch.waitUntilWatchIsReady)(pkg.runScriptStreaming(watchScriptName).stdout); - _log.log.write(_chalk2.default.bold(`[${_chalk2.default.green(pkg.name)}] Initial build completed (${completionHint}).`)); - }); - - return function (_x) { - return _ref.apply(this, arguments); - }; - })()); - })(); - } -}; - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.waitUntilWatchIsReady = waitUntilWatchIsReady; - -var _rxjs = __webpack_require__(158); - -var Rx = _interopRequireWildcard(_rxjs); - -var _operators = __webpack_require__(257); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/** - * Number of milliseconds we wait before we fall back to the default watch handler. - */ +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RunCommand", function() { return RunCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with @@ -19502,27 +19224,198 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; * specific language governing permissions and limitations * under the License. */ + + + + +const RunCommand = { + description: 'Run script defined in package.json in each package that contains that script.', + name: 'run', + + async run(projects, projectGraph, { + extraArgs + }) { + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projects, projectGraph); + + if (extraArgs.length === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red.bold('\nNo script specified')); + process.exit(1); + } + + const scriptName = extraArgs[0]; + const scriptArgs = extraArgs.slice(1); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in batched topological order\n`)); + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { + if (pkg.hasScript(scriptName)) { + await pkg.runScriptStreaming(scriptName, scriptArgs); + } + }); + } + +}; + +/***/ }), +/* 156 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WatchCommand", function() { return WatchCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); +/* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); +/* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(157); +/* + * 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. + */ + + + + + + +/** + * Name of the script in the package/project package.json file to run during `kbn watch`. + */ +const watchScriptName = 'kbn:watch'; +/** + * Name of the Kibana project. + */ + +const kibanaProjectName = 'kibana'; +/** + * Command that traverses through list of available projects/packages that have `kbn:watch` script in their + * package.json files, groups them into topology aware batches and then processes theses batches one by one + * running `kbn:watch` scripts in parallel within the same batch. + * + * Command internally relies on the fact that most of the build systems that are triggered by `kbn:watch` + * will emit special "marker" once build/watch process is ready that we can use as completion condition for + * the `kbn:watch` script and eventually for the entire batch. Currently we support completion "markers" for + * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. + */ + +const WatchCommand = { + description: 'Runs `kbn:watch` script for every project.', + name: 'watch', + + async run(projects, projectGraph) { + const projectsToWatch = new Map(); + + for (const project of projects.values()) { + // We can't watch project that doesn't have `kbn:watch` script. + if (project.hasScript(watchScriptName)) { + projectsToWatch.set(project.name, project); + } + } + + if (projectsToWatch.size === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); + return; + } + + const projectNames = Array.from(projectsToWatch.keys()); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); // Kibana should always be run the last, so we don't rely on automatic + // topological batching and push it to the last one-entry batch manually. + + const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projectsToWatch, projectGraph); + + if (shouldWatchKibanaProject) { + batchedProjects.push([projects.get(kibanaProjectName)]); + } + + await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { + const completionHint = await Object(_utils_watch__WEBPACK_IMPORTED_MODULE_4__["waitUntilWatchIsReady"])(pkg.runScriptStreaming(watchScriptName).stdout); + _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`[${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(pkg.name)}] Initial build completed (${completionHint}).`)); + }); + } + +}; + +/***/ }), +/* 157 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilWatchIsReady", function() { return waitUntilWatchIsReady; }); +/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(158); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257); +/* + * 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. + */ + + +/** + * Number of milliseconds we wait before we fall back to the default watch handler. + */ + const defaultHandlerDelay = 3000; /** * If default watch handler is used, then it's the number of milliseconds we wait for * any build output before we consider watch task ready. */ + const defaultHandlerReadinessTimeout = 2000; -function getWatchHandlers(buildOutput$, { handlerDelay = defaultHandlerDelay, handlerReadinessTimeout = defaultHandlerReadinessTimeout }) { - const typescriptHandler = buildOutput$.pipe((0, _operators.first)(data => data.includes('$ tsc')), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.first)(data => data.includes('Compilation complete.')), (0, _operators.mapTo)('tsc')))); - const webpackHandler = buildOutput$.pipe((0, _operators.first)(data => data.includes('$ webpack')), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.first)(data => data.includes('Chunk Names')), (0, _operators.mapTo)('webpack')))); - const defaultHandler = Rx.of(undefined).pipe((0, _operators.delay)(handlerReadinessTimeout), (0, _operators.map)(() => buildOutput$.pipe((0, _operators.timeout)(handlerDelay), (0, _operators.catchError)(() => Rx.of('timeout'))))); +/** + * Describes configurable watch options. + */ + +function getWatchHandlers(buildOutput$, { + handlerDelay = defaultHandlerDelay, + handlerReadinessTimeout = defaultHandlerReadinessTimeout +}) { + const typescriptHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ tsc')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Compilation complete.')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('tsc')))); + const webpackHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ webpack')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Chunk Names')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('webpack')))); + const defaultHandler = rxjs__WEBPACK_IMPORTED_MODULE_0__["of"](undefined).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["delay"])(handlerReadinessTimeout), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["timeout"])(handlerDelay), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["catchError"])(() => rxjs__WEBPACK_IMPORTED_MODULE_0__["of"]('timeout'))))); return [typescriptHandler, webpackHandler, defaultHandler]; } + function waitUntilWatchIsReady(stream, opts = {}) { - const buildOutput$ = new Rx.Subject(); + const buildOutput$ = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"](); + const onDataListener = data => buildOutput$.next(data.toString('utf-8')); + const onEndListener = () => buildOutput$.complete(); + const onErrorListener = e => buildOutput$.error(e); + stream.once('end', onEndListener); stream.once('error', onErrorListener); stream.on('data', onDataListener); - return Rx.race(getWatchHandlers(buildOutput$, opts)).pipe((0, _operators.mergeMap)(whenReady => whenReady), (0, _operators.finalize)(() => { + return rxjs__WEBPACK_IMPORTED_MODULE_0__["race"](getWatchHandlers(buildOutput$, opts)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mergeMap"])(whenReady => whenReady), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["finalize"])(() => { stream.removeListener('data', onDataListener); stream.removeListener('end', onEndListener); stream.removeListener('error', onErrorListener); @@ -31110,108 +31003,96 @@ function zipAll(project) { /***/ }), /* 357 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runCommand", function() { return runCommand; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(358); +/* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(indent_string__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(359); +/* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(wrap_ansi__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(132); +/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); +/* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(366); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.runCommand = undefined; -let runCommand = exports.runCommand = (() => { - var _ref = _asyncToGenerator(function* (command, config) { - try { - _log.log.write(_chalk2.default.bold(`Running [${_chalk2.default.green(command.name)}] command from [${_chalk2.default.yellow(config.rootPath)}]:\n`)); - const projectPaths = (0, _config.getProjectPaths)(config.rootPath, config.options); - const projects = yield (0, _projects.getProjects)(config.rootPath, projectPaths, { - exclude: toArray(config.options.exclude), - include: toArray(config.options.include) - }); - if (projects.size === 0) { - _log.log.write(_chalk2.default.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); - return process.exit(1); - } - const projectGraph = (0, _projects.buildProjectGraph)(projects); - _log.log.write(_chalk2.default.bold(`Found [${_chalk2.default.green(projects.size.toString())}] projects:\n`)); - _log.log.write((0, _projects_tree.renderProjectsTree)(config.rootPath, projects)); - yield command.run(projects, projectGraph, config); - } catch (e) { - _log.log.write(_chalk2.default.bold.red(`\n[${command.name}] failed:\n`)); - if (e instanceof _errors.CliError) { - const msg = _chalk2.default.red(`CliError: ${e.message}\n`); - _log.log.write((0, _wrapAnsi2.default)(msg, 80)); - const keys = Object.keys(e.meta); - if (keys.length > 0) { - const metaOutput = keys.map(function (key) { - const value = e.meta[key]; - return `${key}: ${value}`; - }); - _log.log.write('Additional debugging info:\n'); - _log.log.write((0, _indentString2.default)(metaOutput.join('\n'), 3)); - } - } else { - _log.log.write(e.stack); - } - process.exit(1); - } + + + + + +async function runCommand(command, config) { + try { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Running [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(command.name)}] command from [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow(config.rootPath)}]:\n`)); + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(config.rootPath, config.options); + const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(config.rootPath, projectPaths, { + exclude: toArray(config.options.exclude), + include: toArray(config.options.include) }); - return function runCommand(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + if (projects.size === 0) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); + return process.exit(1); + } -var _chalk = __webpack_require__(2); + const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["buildProjectGraph"])(projects); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Found [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(projects.size.toString())}] projects:\n`)); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(Object(_utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__["renderProjectsTree"])(config.rootPath, projects)); + await command.run(projects, projectGraph, config); + } catch (e) { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red(`\n[${command.name}] failed:\n`)); -var _chalk2 = _interopRequireDefault(_chalk); + if (e instanceof _utils_errors__WEBPACK_IMPORTED_MODULE_4__["CliError"]) { + const msg = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`CliError: ${e.message}\n`); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default()(msg, 80)); + const keys = Object.keys(e.meta); -var _indentString = __webpack_require__(358); - -var _indentString2 = _interopRequireDefault(_indentString); - -var _wrapAnsi = __webpack_require__(359); - -var _wrapAnsi2 = _interopRequireDefault(_wrapAnsi); - -var _config = __webpack_require__(132); - -var _errors = __webpack_require__(52); - -var _log = __webpack_require__(33); - -var _projects = __webpack_require__(35); - -var _projects_tree = __webpack_require__(366); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ + if (keys.length > 0) { + const metaOutput = keys.map(key => { + const value = e.meta[key]; + return `${key}: ${value}`; + }); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write('Additional debugging info:\n'); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(indent_string__WEBPACK_IMPORTED_MODULE_1___default()(metaOutput.join('\n'), 3)); + } + } else { + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(e.stack); + } + process.exit(1); + } +} function toArray(value) { - if (value == null) { - return []; - } - return Array.isArray(value) ? value : [value]; + if (value == null) { + return []; + } + + return Array.isArray(value) ? value : [value]; } /***/ }), @@ -31602,25 +31483,168 @@ module.exports = () => { /***/ }), /* 366 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderProjectsTree", function() { return renderProjectsTree; }); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.renderProjectsTree = renderProjectsTree; +const projectKey = Symbol('__project'); +function renderProjectsTree(rootPath, projects) { + const projectsTree = buildProjectsTree(rootPath, projects); + return treeToString(createTreeStructure(projectsTree)); +} -var _chalk = __webpack_require__(2); +function treeToString(tree) { + return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); +} -var _chalk2 = _interopRequireDefault(_chalk); +function childrenToStrings(tree, treePrefix) { + if (tree === undefined) { + return []; + } -var _path = __webpack_require__(16); + let strings = []; + tree.forEach((node, index) => { + const isLastNode = tree.length - 1 === index; + const nodePrefix = isLastNode ? '└── ' : '├── '; + const childPrefix = isLastNode ? ' ' : '│ '; + const childrenPrefix = treePrefix + childPrefix; + strings.push(`${treePrefix}${nodePrefix}${node.name}`); + strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); + }); + return strings; +} -var _path2 = _interopRequireDefault(_path); +function createTreeStructure(tree) { + let name; + const children = []; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (const [dir, project] of tree.entries()) { + // This is a leaf node (aka a project) + if (typeof project === 'string') { + name = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(project); + continue; + } // If there's only one project and the key indicates it's a leaf node, we + // know that we're at a package folder that contains a package.json, so we + // "inline it" so we don't get unnecessary levels, i.e. we'll just see + // `foo` instead of `foo -> foo`. + + + if (project.size === 1 && project.has(projectKey)) { + const projectName = project.get(projectKey); + children.push({ + children: [], + name: dirOrProjectName(dir, projectName) + }); + continue; + } + + const subtree = createTreeStructure(project); // If the name is specified, we know there's a package at the "root" of the + // subtree itself. + + if (subtree.name !== undefined) { + const projectName = subtree.name; + children.push({ + children: subtree.children, + name: dirOrProjectName(dir, projectName) + }); + continue; + } // Special-case whenever we have one child, so we don't get unnecessary + // folders in the output. E.g. instead of `foo -> bar -> baz` we get + // `foo/bar/baz` instead. + + + if (subtree.children && subtree.children.length === 1) { + const child = subtree.children[0]; + const newName = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(dir.toString(), child.name)); + children.push({ + children: child.children, + name: newName + }); + continue; + } + + children.push({ + children: subtree.children, + name: chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(dir.toString()) + }); + } + + return { + name, + children + }; +} + +function dirOrProjectName(dir, projectName) { + return dir === projectName ? chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(dir) : chalk__WEBPACK_IMPORTED_MODULE_0___default.a`{dim ${dir.toString()} ({reset.green ${projectName}})}`; +} + +function buildProjectsTree(rootPath, projects) { + const tree = new Map(); + + for (const project of projects.values()) { + if (rootPath === project.path) { + tree.set(projectKey, project.name); + } else { + const relativeProjectPath = path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(rootPath, project.path); + addProjectToTree(tree, relativeProjectPath.split(path__WEBPACK_IMPORTED_MODULE_1___default.a.sep), project); + } + } + + return tree; +} + +function addProjectToTree(tree, pathParts, project) { + if (pathParts.length === 0) { + tree.set(projectKey, project.name); + } else { + const [currentDir, ...rest] = pathParts; + + if (!tree.has(currentDir)) { + tree.set(currentDir, new Map()); + } + + const subtree = tree.get(currentDir); + addProjectToTree(subtree, rest, project); + } +} + +/***/ }), +/* 367 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(368); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; }); + +/* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(547); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); /* * Licensed to Elasticsearch B.V. under one or more contributor @@ -31640,173 +31664,74 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * specific language governing permissions and limitations * under the License. */ -const projectKey = Symbol('__project'); -function renderProjectsTree(rootPath, projects) { - const projectsTree = buildProjectsTree(rootPath, projects); - return treeToString(createTreeStructure(projectsTree)); -} -function treeToString(tree) { - return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); -} -function childrenToStrings(tree, treePrefix) { - if (tree === undefined) { - return []; - } - let strings = []; - tree.forEach((node, index) => { - const isLastNode = tree.length - 1 === index; - const nodePrefix = isLastNode ? '└── ' : '├── '; - const childPrefix = isLastNode ? ' ' : '│ '; - const childrenPrefix = treePrefix + childPrefix; - strings.push(`${treePrefix}${nodePrefix}${node.name}`); - strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); - }); - return strings; -} -function createTreeStructure(tree) { - let name; - const children = []; - for (const [dir, project] of tree.entries()) { - // This is a leaf node (aka a project) - if (typeof project === 'string') { - name = _chalk2.default.green(project); - continue; - } - // If there's only one project and the key indicates it's a leaf node, we - // know that we're at a package folder that contains a package.json, so we - // "inline it" so we don't get unnecessary levels, i.e. we'll just see - // `foo` instead of `foo -> foo`. - if (project.size === 1 && project.has(projectKey)) { - const projectName = project.get(projectKey); - children.push({ - children: [], - name: dirOrProjectName(dir, projectName) - }); - continue; - } - const subtree = createTreeStructure(project); - // If the name is specified, we know there's a package at the "root" of the - // subtree itself. - if (subtree.name !== undefined) { - const projectName = subtree.name; - children.push({ - children: subtree.children, - name: dirOrProjectName(dir, projectName) - }); - continue; - } - // Special-case whenever we have one child, so we don't get unnecessary - // folders in the output. E.g. instead of `foo -> bar -> baz` we get - // `foo/bar/baz` instead. - if (subtree.children && subtree.children.length === 1) { - const child = subtree.children[0]; - const newName = _chalk2.default.dim(_path2.default.join(dir.toString(), child.name)); - children.push({ - children: child.children, - name: newName - }); - continue; - } - children.push({ - children: subtree.children, - name: _chalk2.default.dim(dir.toString()) - }); - } - return { name, children }; -} -function dirOrProjectName(dir, projectName) { - return dir === projectName ? _chalk2.default.green(dir) : _chalk2.default`{dim ${dir.toString()} ({reset.green ${projectName}})}`; -} -function buildProjectsTree(rootPath, projects) { - const tree = new Map(); - for (const project of projects.values()) { - if (rootPath === project.path) { - tree.set(projectKey, project.name); - } else { - const relativeProjectPath = _path2.default.relative(rootPath, project.path); - addProjectToTree(tree, relativeProjectPath.split(_path2.default.sep), project); - } - } - return tree; -} -function addProjectToTree(tree, pathParts, project) { - if (pathParts.length === 0) { - tree.set(projectKey, project.name); - } else { - const [currentDir, ...rest] = pathParts; - if (!tree.has(currentDir)) { - tree.set(currentDir, new Map()); - } - const subtree = tree.get(currentDir); - addProjectToTree(subtree, rest, project); - } -} - -/***/ }), -/* 367 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _build_production_projects = __webpack_require__(368); - -Object.defineProperty(exports, 'buildProductionProjects', { - enumerable: true, - get: function () { - return _build_production_projects.buildProductionProjects; - } -}); - -var _prepare_project_dependencies = __webpack_require__(547); - -Object.defineProperty(exports, 'prepareExternalProjectDependencies', { - enumerable: true, - get: function () { - return _prepare_project_dependencies.prepareExternalProjectDependencies; - } -}); /***/ }), /* 368 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return buildProductionProjects; }); +/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(369); +/* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cpy__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(134); +/* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(132); +/* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); +/* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54); +/* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(35); +/* + * 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. + */ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildProductionProjects = undefined; -let buildProductionProjects = exports.buildProductionProjects = (() => { - var _ref = _asyncToGenerator(function* ({ kibanaRoot, buildRoots }) { - const projects = yield getProductionProjects(kibanaRoot); - const projectGraph = (0, _projects.buildProjectGraph)(projects); - const batchedProjects = (0, _projects.topologicallyBatchProjects)(projects, projectGraph); - const projectNames = [...projects.values()].map(function (project) { - return project.name; - }); - _log.log.write(`Preparing production build for [${projectNames.join(', ')}]`); - for (const batch of batchedProjects) { - for (const project of batch) { - yield deleteTarget(project); - yield buildProject(project); - for (const buildRoot of buildRoots) { - yield copyToBuild(project, kibanaRoot, buildRoot); - } - } - } - }); - return function buildProductionProjects(_x) { - return _ref.apply(this, arguments); - }; -})(); + + + + +async function buildProductionProjects({ + kibanaRoot, + buildRoots +}) { + const projects = await getProductionProjects(kibanaRoot); + const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["buildProjectGraph"])(projects); + const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["topologicallyBatchProjects"])(projects, projectGraph); + const projectNames = [...projects.values()].map(project => project.name); + _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(`Preparing production build for [${projectNames.join(', ')}]`); + + for (const batch of batchedProjects) { + for (const project of batch) { + await deleteTarget(project); + await buildProject(project); + + for (const buildRoot of buildRoots) { + await copyToBuild(project, kibanaRoot, buildRoot); + } + } + } +} /** * Returns the subset of projects that should be built into the production * bundle. As we copy these into Kibana's `node_modules` during the build step, @@ -31814,48 +31739,32 @@ let buildProductionProjects = exports.buildProductionProjects = (() => { * we only include Kibana's transitive _production_ dependencies. */ +async function getProductionProjects(rootPath) { + const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); + const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["getProjects"])(rootPath, projectPaths); + const productionProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["includeTransitiveProjects"])([projects.get('kibana')], projects, { + onlyProductionDependencies: true + }); // We remove Kibana, as we're already building Kibana -let getProductionProjects = (() => { - var _ref2 = _asyncToGenerator(function* (rootPath) { - const projectPaths = (0, _config.getProjectPaths)(rootPath, {}); - const projects = yield (0, _projects.getProjects)(rootPath, projectPaths); - const productionProjects = (0, _projects.includeTransitiveProjects)([projects.get('kibana')], projects, { - onlyProductionDependencies: true - }); - // We remove Kibana, as we're already building Kibana - productionProjects.delete('kibana'); - return productionProjects; + productionProjects.delete('kibana'); + return productionProjects; +} + +async function deleteTarget(project) { + const targetDir = project.targetLocation; + + if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(targetDir)) { + await del__WEBPACK_IMPORTED_MODULE_1___default()(targetDir, { + force: true }); + } +} - return function getProductionProjects(_x2) { - return _ref2.apply(this, arguments); - }; -})(); - -let deleteTarget = (() => { - var _ref3 = _asyncToGenerator(function* (project) { - const targetDir = project.targetLocation; - if (yield (0, _fs.isDirectory)(targetDir)) { - yield (0, _del2.default)(targetDir, { force: true }); - } - }); - - return function deleteTarget(_x3) { - return _ref3.apply(this, arguments); - }; -})(); - -let buildProject = (() => { - var _ref4 = _asyncToGenerator(function* (project) { - if (project.hasScript('build')) { - yield project.runScript('build'); - } - }); - - return function buildProject(_x4) { - return _ref4.apply(this, arguments); - }; -})(); +async function buildProject(project) { + if (project.hasScript('build')) { + await project.runScript('build'); + } +} /** * Copy all the project's files from its "intermediate build directory" and * into the build. The intermediate directory can either be the root of the @@ -31869,73 +31778,26 @@ let buildProject = (() => { */ -let copyToBuild = (() => { - var _ref5 = _asyncToGenerator(function* (project, kibanaRoot, buildRoot) { - // We want the package to have the same relative location within the build - const relativeProjectPath = (0, _path.relative)(kibanaRoot, project.path); - const buildProjectPath = (0, _path.resolve)(buildRoot, relativeProjectPath); - yield (0, _cpy2.default)(['**/*', '!node_modules/**'], buildProjectPath, { - cwd: project.getIntermediateBuildDirectory(), - dot: true, - nodir: true, - parents: true - }); - // If a project is using an intermediate build directory, we special-case our - // handling of `package.json`, as the project build process might have copied - // (a potentially modified) `package.json` into the intermediate build - // directory already. If so, we want to use that `package.json` as the basis - // for creating the production-ready `package.json`. If it's not present in - // the intermediate build, we fall back to using the project's already defined - // `package.json`. - const packageJson = (yield (0, _fs.isFile)((0, _path.join)(buildProjectPath, 'package.json'))) ? yield (0, _package_json.readPackageJson)(buildProjectPath) : project.json; - yield (0, _package_json.writePackageJson)(buildProjectPath, packageJson); - }); +async function copyToBuild(project, kibanaRoot, buildRoot) { + // We want the package to have the same relative location within the build + const relativeProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["relative"])(kibanaRoot, project.path); + const buildProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(buildRoot, relativeProjectPath); + await cpy__WEBPACK_IMPORTED_MODULE_0___default()(['**/*', '!node_modules/**'], buildProjectPath, { + cwd: project.getIntermediateBuildDirectory(), + dot: true, + nodir: true, + parents: true + }); // If a project is using an intermediate build directory, we special-case our + // handling of `package.json`, as the project build process might have copied + // (a potentially modified) `package.json` into the intermediate build + // directory already. If so, we want to use that `package.json` as the basis + // for creating the production-ready `package.json`. If it's not present in + // the intermediate build, we fall back to using the project's already defined + // `package.json`. - return function copyToBuild(_x5, _x6, _x7) { - return _ref5.apply(this, arguments); - }; -})(); - -var _cpy = __webpack_require__(369); - -var _cpy2 = _interopRequireDefault(_cpy); - -var _del = __webpack_require__(134); - -var _del2 = _interopRequireDefault(_del); - -var _path = __webpack_require__(16); - -var _config = __webpack_require__(132); - -var _fs = __webpack_require__(20); - -var _log = __webpack_require__(33); - -var _package_json = __webpack_require__(54); - -var _projects = __webpack_require__(35); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ + const packageJson = (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isFile"])(Object(path__WEBPACK_IMPORTED_MODULE_2__["join"])(buildProjectPath, 'package.json'))) ? await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["readPackageJson"])(buildProjectPath) : project.json; + await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["writePackageJson"])(buildProjectPath, packageJson); +} /***/ }), /* 369 */ @@ -55219,67 +55081,31 @@ module.exports = CpyError; /***/ }), /* 547 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.prepareExternalProjectDependencies = undefined; - -/** - * This prepares the dependencies for an _external_ project. +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return prepareExternalProjectDependencies; }); +/* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54); +/* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53); +/* + * 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. */ -let prepareExternalProjectDependencies = exports.prepareExternalProjectDependencies = (() => { - var _ref = _asyncToGenerator(function* (projectPath) { - const project = yield _project.Project.fromPath(projectPath); - if (!project.hasDependencies()) { - return; - } - const deps = project.allDependencies; - for (const depName of Object.keys(deps)) { - const depVersion = deps[depName]; - // Kibana currently only supports `link:` dependencies on Kibana's own - // packages, as these are packaged into the `node_modules` folder when - // Kibana is built, so we don't need to take any action to enable - // `require(...)` to resolve for these packages. - if ((0, _package_json.isLinkDependency)(depVersion) && !isKibanaDep(depVersion)) { - // For non-Kibana packages we need to set up symlinks during the - // installation process, but this is not something we support yet. - throw new Error('This plugin is using `link:` dependencies for non-Kibana packages'); - } - } - }); - - return function prepareExternalProjectDependencies(_x) { - return _ref.apply(this, arguments); - }; -})(); - -var _package_json = __webpack_require__(54); - -var _project = __webpack_require__(53); - -function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* - * 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. - */ /** @@ -55287,7 +55113,35 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a * to the Kibana root directory or `../kibana-extra/{plugin}` relative * to Kibana itself. */ + const isKibanaDep = depVersion => depVersion.includes('../../kibana/'); +/** + * This prepares the dependencies for an _external_ project. + */ + + +async function prepareExternalProjectDependencies(projectPath) { + const project = await _utils_project__WEBPACK_IMPORTED_MODULE_1__["Project"].fromPath(projectPath); + + if (!project.hasDependencies()) { + return; + } + + const deps = project.allDependencies; + + for (const depName of Object.keys(deps)) { + const depVersion = deps[depName]; // Kibana currently only supports `link:` dependencies on Kibana's own + // packages, as these are packaged into the `node_modules` folder when + // Kibana is built, so we don't need to take any action to enable + // `require(...)` to resolve for these packages. + + if (Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_0__["isLinkDependency"])(depVersion) && !isKibanaDep(depVersion)) { + // For non-Kibana packages we need to set up symlinks during the + // installation process, but this is not something we support yet. + throw new Error('This plugin is using `link:` dependencies for non-Kibana packages'); + } + } +} /***/ }) /******/ ]); \ No newline at end of file diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 6248e919976d..86d67c0bcfe1 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -10,6 +10,11 @@ "prettier": "prettier --write './src/**/*.ts'" }, "devDependencies": { + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-class-properties": "^7.3.4", + "@babel/plugin-proposal-object-rest-spread": "^7.3.4", + "@babel/preset-env": "^7.3.4", + "@babel/preset-typescript": "^7.3.3", "@types/cmd-shim": "^2.0.0", "@types/cpy": "^5.1.0", "@types/dedent": "^0.7.0", @@ -32,10 +37,7 @@ "@types/tempy": "^0.1.0", "@types/wrap-ansi": "^2.0.14", "@types/write-pkg": "^3.1.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-stage-3": "^6.24.1", + "babel-loader": "^8.0.5", "chalk": "^2.4.1", "cmd-shim": "^2.0.2", "cpy": "^7.0.1", @@ -60,7 +62,6 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.2.1", - "ts-loader": "^5.2.2", "typescript": "^3.3.3333", "unlazy-loader": "^0.1.3", "webpack": "^4.23.1", diff --git a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json index df6ad1d3d6d9..c1269fc7c037 100644 --- a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json +++ b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/bar/package.json @@ -4,10 +4,11 @@ "private": true, "main": "./target/index.js", "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1" + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4" }, "scripts": { - "build": "babel --presets env --out-dir target src" + "build": "babel --presets=@babel/preset-env --out-dir target src" } } diff --git a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json index 385aa59bffc7..8b8225594c5a 100644 --- a/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json +++ b/packages/kbn-pm/src/production/integration_tests/__fixtures__/packages/foo/package.json @@ -7,11 +7,12 @@ "@elastic/bar": "link:../bar" }, "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/core": "^7.3.4", + "@babel/cli": "^7.2.3", + "@babel/preset-env": "^7.3.4", "moment": "2.20.1" }, "scripts": { - "build": "babel --presets env --out-dir target src" + "build": "babel --presets=@babel/preset-env --out-dir target src" } } diff --git a/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap b/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap index 94642340e0d9..5049c692aae6 100644 --- a/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap +++ b/packages/kbn-pm/src/production/integration_tests/__snapshots__/build_production_projects.test.ts.snap @@ -20,14 +20,15 @@ Array [ exports[`kbn-pm production builds and copies projects for production: packages/bar/package.json 1`] = ` Object { "devDependencies": Object { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4", }, "main": "./target/index.js", "name": "@elastic/bar", "private": true, "scripts": Object { - "build": "babel --presets env --out-dir target src", + "build": "babel --presets=@babel/preset-env --out-dir target src", }, "version": "1.0.0", } @@ -47,15 +48,16 @@ Object { "@elastic/bar": "link:../bar", }, "devDependencies": Object { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/preset-env": "^7.3.4", "moment": "2.20.1", }, "main": "./target/index.js", "name": "@elastic/foo", "private": true, "scripts": Object { - "build": "babel --presets env --out-dir target src", + "build": "babel --presets=@babel/preset-env --out-dir target src", }, "version": "1.0.0", } diff --git a/packages/kbn-pm/tsconfig.json b/packages/kbn-pm/tsconfig.json index f7c8cdab1678..2141c5502ae9 100644 --- a/packages/kbn-pm/tsconfig.json +++ b/packages/kbn-pm/tsconfig.json @@ -4,7 +4,7 @@ "dist" ], "include": [ - "./src/**/*.ts" + "./src/**/*.ts", ], "compilerOptions": { "types": [ diff --git a/packages/kbn-pm/webpack.config.js b/packages/kbn-pm/webpack.config.js index 1424850265e0..ff77d3cfb7e9 100644 --- a/packages/kbn-pm/webpack.config.js +++ b/packages/kbn-pm/webpack.config.js @@ -44,15 +44,6 @@ module.exports = { { loader: 'babel-loader', }, - { - loader: 'ts-loader', - options: { - compilerOptions: { - // enable esnext modules so webpack can do its thing better - module: 'esnext', - }, - }, - }, ], exclude: /node_modules/, }, diff --git a/packages/kbn-test/babel.config.js b/packages/kbn-test/babel.config.js index 962d7d3e05c5..ff657603f4c8 100644 --- a/packages/kbn-test/babel.config.js +++ b/packages/kbn-test/babel.config.js @@ -18,6 +18,6 @@ */ module.exports = { - presets: ['@kbn/babel-preset/node_preset_7'], + presets: ['@kbn/babel-preset/node_preset'], ignore: ['**/*.test.js'], }; diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index aa57d854e14c..56790e8cb194 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -10,9 +10,9 @@ "kbn:watch": "yarn build --watch" }, "devDependencies": { + "@babel/cli": "^7.2.3", "@kbn/babel-preset": "1.0.0", - "@kbn/dev-utils": "1.0.0", - "@babel/cli": "^7.2.3" + "@kbn/dev-utils": "1.0.0" }, "dependencies": { "chalk": "^2.4.1", diff --git a/packages/kbn-ui-framework/doc_site/src/index.js b/packages/kbn-ui-framework/doc_site/src/index.js index 094437d85e6b..f53e8a608e1a 100644 --- a/packages/kbn-ui-framework/doc_site/src/index.js +++ b/packages/kbn-ui-framework/doc_site/src/index.js @@ -19,7 +19,7 @@ require('./main.scss'); -import 'babel-polyfill'; +import '@babel/polyfill'; import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index 87e586e90ec2..f2b9c2f7e713 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -26,16 +26,16 @@ "uuid": "3.0.1" }, "peerDependencies": { - "enzyme": "3.2.0", - "enzyme-adapter-react-16": "^1.1.1" + "enzyme": "^3.8.0", + "enzyme-adapter-react-16": "^1.9.1" }, "devDependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", "@elastic/eui": "0.0.23", "@kbn/babel-preset": "1.0.0", "autoprefixer": "6.5.4", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-polyfill": "^6.26.0", + "babel-loader": "^8.0.5", "brace": "0.10.0", "chalk": "^2.4.1", "chokidar": "1.6.0", @@ -43,7 +43,7 @@ "expose-loader": "^0.7.5", "file-loader": "^2.0.0", "grunt": "1.0.3", - "grunt-babel": "^7.0.0", + "grunt-babel": "^8.0.0", "grunt-contrib-clean": "^1.1.0", "grunt-contrib-copy": "^1.0.0", "highlight.js": "9.0.0", diff --git a/src/core/public/core_system.test.mocks.ts b/src/core/public/core_system.test.mocks.ts new file mode 100644 index 000000000000..cb3f45361d5f --- /dev/null +++ b/src/core/public/core_system.test.mocks.ts @@ -0,0 +1,92 @@ +/* + * 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 { basePathServiceMock } from './base_path/base_path_service.mock'; +import { chromeServiceMock } from './chrome/chrome_service.mock'; +import { fatalErrorsServiceMock } from './fatal_errors/fatal_errors_service.mock'; +import { httpServiceMock } from './http/http_service.mock'; +import { i18nServiceMock } from './i18n/i18n_service.mock'; +import { injectedMetadataServiceMock } from './injected_metadata/injected_metadata_service.mock'; +import { legacyPlatformServiceMock } from './legacy/legacy_service.mock'; +import { notificationServiceMock } from './notifications/notifications_service.mock'; +import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; + +export const MockLegacyPlatformService = legacyPlatformServiceMock.create(); +export const LegacyPlatformServiceConstructor = jest + .fn() + .mockImplementation(() => MockLegacyPlatformService); +jest.doMock('./legacy', () => ({ + LegacyPlatformService: LegacyPlatformServiceConstructor, +})); + +export const MockInjectedMetadataService = injectedMetadataServiceMock.create(); +export const InjectedMetadataServiceConstructor = jest + .fn() + .mockImplementation(() => MockInjectedMetadataService); +jest.doMock('./injected_metadata', () => ({ + InjectedMetadataService: InjectedMetadataServiceConstructor, +})); + +export const MockFatalErrorsService = fatalErrorsServiceMock.create(); +export const FatalErrorsServiceConstructor = jest + .fn() + .mockImplementation(() => MockFatalErrorsService); +jest.doMock('./fatal_errors', () => ({ + FatalErrorsService: FatalErrorsServiceConstructor, +})); + +export const MockI18nService = i18nServiceMock.create(); +export const I18nServiceConstructor = jest.fn().mockImplementation(() => MockI18nService); +jest.doMock('./i18n', () => ({ + I18nService: I18nServiceConstructor, +})); + +export const MockNotificationsService = notificationServiceMock.create(); +export const NotificationServiceConstructor = jest + .fn() + .mockImplementation(() => MockNotificationsService); +jest.doMock('./notifications', () => ({ + NotificationsService: NotificationServiceConstructor, +})); + +export const MockHttpService = httpServiceMock.create(); +export const HttpServiceConstructor = jest.fn().mockImplementation(() => MockHttpService); +jest.doMock('./http', () => ({ + HttpService: HttpServiceConstructor, +})); + +export const MockBasePathService = basePathServiceMock.create(); +export const BasePathServiceConstructor = jest.fn().mockImplementation(() => MockBasePathService); +jest.doMock('./base_path', () => ({ + BasePathService: BasePathServiceConstructor, +})); + +export const MockUiSettingsService = uiSettingsServiceMock.create(); +export const UiSettingsServiceConstructor = jest + .fn() + .mockImplementation(() => MockUiSettingsService); +jest.doMock('./ui_settings', () => ({ + UiSettingsService: UiSettingsServiceConstructor, +})); + +export const MockChromeService = chromeServiceMock.create(); +export const ChromeServiceConstructor = jest.fn().mockImplementation(() => MockChromeService); +jest.doMock('./chrome', () => ({ + ChromeService: ChromeServiceConstructor, +})); diff --git a/src/core/public/core_system.test.ts b/src/core/public/core_system.test.ts index 9d9620e3b085..3a8580127f15 100644 --- a/src/core/public/core_system.test.ts +++ b/src/core/public/core_system.test.ts @@ -17,73 +17,26 @@ * under the License. */ -import { basePathServiceMock } from './base_path/base_path_service.mock'; -import { chromeServiceMock } from './chrome/chrome_service.mock'; -import { fatalErrorsServiceMock } from './fatal_errors/fatal_errors_service.mock'; -import { httpServiceMock } from './http/http_service.mock'; -import { i18nServiceMock } from './i18n/i18n_service.mock'; -import { injectedMetadataServiceMock } from './injected_metadata/injected_metadata_service.mock'; -import { legacyPlatformServiceMock } from './legacy/legacy_service.mock'; -import { notificationServiceMock } from './notifications/notifications_service.mock'; -import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; - -const MockLegacyPlatformService = legacyPlatformServiceMock.create(); -const LegacyPlatformServiceConstructor = jest - .fn() - .mockImplementation(() => MockLegacyPlatformService); -jest.mock('./legacy', () => ({ - LegacyPlatformService: LegacyPlatformServiceConstructor, -})); - -const MockInjectedMetadataService = injectedMetadataServiceMock.create(); -const InjectedMetadataServiceConstructor = jest - .fn() - .mockImplementation(() => MockInjectedMetadataService); -jest.mock('./injected_metadata', () => ({ - InjectedMetadataService: InjectedMetadataServiceConstructor, -})); - -const MockFatalErrorsService = fatalErrorsServiceMock.create(); -const FatalErrorsServiceConstructor = jest.fn().mockImplementation(() => MockFatalErrorsService); -jest.mock('./fatal_errors', () => ({ - FatalErrorsService: FatalErrorsServiceConstructor, -})); - -const MockI18nService = i18nServiceMock.create(); -const I18nServiceConstructor = jest.fn().mockImplementation(() => MockI18nService); -jest.mock('./i18n', () => ({ - I18nService: I18nServiceConstructor, -})); - -const MockNotificationsService = notificationServiceMock.create(); -const NotificationServiceConstructor = jest.fn().mockImplementation(() => MockNotificationsService); -jest.mock('./notifications', () => ({ - NotificationsService: NotificationServiceConstructor, -})); - -const MockHttpService = httpServiceMock.create(); -const HttpServiceConstructor = jest.fn().mockImplementation(() => MockHttpService); -jest.mock('./http', () => ({ - HttpService: HttpServiceConstructor, -})); - -const MockBasePathService = basePathServiceMock.create(); -const BasePathServiceConstructor = jest.fn().mockImplementation(() => MockBasePathService); -jest.mock('./base_path', () => ({ - BasePathService: BasePathServiceConstructor, -})); - -const MockUiSettingsService = uiSettingsServiceMock.create(); -const UiSettingsServiceConstructor = jest.fn().mockImplementation(() => MockUiSettingsService); -jest.mock('./ui_settings', () => ({ - UiSettingsService: UiSettingsServiceConstructor, -})); - -const MockChromeService = chromeServiceMock.create(); -const ChromeServiceConstructor = jest.fn().mockImplementation(() => MockChromeService); -jest.mock('./chrome', () => ({ - ChromeService: ChromeServiceConstructor, -})); +import { + BasePathServiceConstructor, + ChromeServiceConstructor, + FatalErrorsServiceConstructor, + HttpServiceConstructor, + I18nServiceConstructor, + InjectedMetadataServiceConstructor, + LegacyPlatformServiceConstructor, + MockBasePathService, + MockChromeService, + MockFatalErrorsService, + MockHttpService, + MockI18nService, + MockInjectedMetadataService, + MockLegacyPlatformService, + MockNotificationsService, + MockUiSettingsService, + NotificationServiceConstructor, + UiSettingsServiceConstructor, +} from './core_system.test.mocks'; import { CoreSystem } from './core_system'; jest.spyOn(CoreSystem.prototype, 'stop'); diff --git a/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap b/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap index a58d0f6fc9c3..c6912764db2a 100644 --- a/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap +++ b/src/core/public/fatal_errors/__snapshots__/fatal_errors_screen.test.tsx.snap @@ -53,8 +53,7 @@ exports[`rendering render matches snapshot 1`] = ` body={

    diff --git a/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts b/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts new file mode 100644 index 000000000000..b998817a1bfc --- /dev/null +++ b/src/core/public/fatal_errors/fatal_errors_service.test.mocks.ts @@ -0,0 +1,25 @@ +/* + * 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 const mockRender = jest.fn(); +jest.mock('react-dom', () => { + return { + render: mockRender, + }; +}); diff --git a/src/core/public/fatal_errors/fatal_errors_service.test.ts b/src/core/public/fatal_errors/fatal_errors_service.test.ts index 6f3842fc4e0e..b1ad92c8c2f6 100644 --- a/src/core/public/fatal_errors/fatal_errors_service.test.ts +++ b/src/core/public/fatal_errors/fatal_errors_service.test.ts @@ -24,12 +24,7 @@ expect.addSnapshotSerializer({ print: () => `Rx.Observable`, }); -const mockRender = jest.fn(); -jest.mock('react-dom', () => { - return { - render: mockRender, - }; -}); +import { mockRender } from './fatal_errors_service.test.mocks'; import { FatalErrorsService } from './fatal_errors_service'; diff --git a/src/core/public/notifications/toasts/toasts_service.test.mocks.ts b/src/core/public/notifications/toasts/toasts_service.test.mocks.ts new file mode 100644 index 000000000000..90ea76c55156 --- /dev/null +++ b/src/core/public/notifications/toasts/toasts_service.test.mocks.ts @@ -0,0 +1,25 @@ +/* + * 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 const mockReactDomRender = jest.fn(); +export const mockReactDomUnmount = jest.fn(); +jest.mock('react-dom', () => ({ + render: mockReactDomRender, + unmountComponentAtNode: mockReactDomUnmount, +})); diff --git a/src/core/public/notifications/toasts/toasts_service.test.tsx b/src/core/public/notifications/toasts/toasts_service.test.tsx index d380ad5b77ea..849fdda97f93 100644 --- a/src/core/public/notifications/toasts/toasts_service.test.tsx +++ b/src/core/public/notifications/toasts/toasts_service.test.tsx @@ -17,12 +17,7 @@ * under the License. */ -const mockReactDomRender = jest.fn(); -const mockReactDomUnmount = jest.fn(); -jest.mock('react-dom', () => ({ - render: mockReactDomRender, - unmountComponentAtNode: mockReactDomUnmount, -})); +import { mockReactDomRender, mockReactDomUnmount } from './toasts_service.test.mocks'; import { ToastsService } from './toasts_service'; import { ToastsSetup } from './toasts_start'; diff --git a/src/core/public/ui_settings/ui_settings_service.test.mocks.ts b/src/core/public/ui_settings/ui_settings_service.test.mocks.ts new file mode 100644 index 000000000000..458a9efdea46 --- /dev/null +++ b/src/core/public/ui_settings/ui_settings_service.test.mocks.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +function mockClass( + module: string, + Class: { new (...args: any[]): T }, + setup: (instance: any, args: any[]) => void +) { + const MockClass = jest.fn(function(this: any, ...args: any[]) { + setup(this, args); + }); + + // define the mock name which is used in some snapshots + MockClass.mockName(`Mock${Class.name}`); + + // define the class name for the MockClass which is used in other snapshots + Object.defineProperty(MockClass, 'name', { + value: `Mock${Class.name}`, + }); + + jest.doMock(module, () => ({ + [Class.name]: MockClass, + })); + + return MockClass; +} + +// Mock the UiSettingsApi class +import { UiSettingsApi } from './ui_settings_api'; +export const MockUiSettingsApi = mockClass('./ui_settings_api', UiSettingsApi, inst => { + inst.stop = jest.fn(); + inst.getLoadingCount$ = jest.fn().mockReturnValue({ + loadingCountObservable: true, + }); +}); + +// Mock the UiSettingsClient class +import { UiSettingsClient } from './ui_settings_client'; +export const MockUiSettingsClient = mockClass('./ui_settings_client', UiSettingsClient, inst => { + inst.stop = jest.fn(); +}); diff --git a/src/core/public/ui_settings/ui_settings_service.test.ts b/src/core/public/ui_settings/ui_settings_service.test.ts index e58b517984fc..f1bfab2981d6 100644 --- a/src/core/public/ui_settings/ui_settings_service.test.ts +++ b/src/core/public/ui_settings/ui_settings_service.test.ts @@ -17,44 +17,7 @@ * under the License. */ -function mockClass( - module: string, - Class: { new (...args: any[]): T }, - setup: (instance: any, args: any[]) => void -) { - const MockClass = jest.fn(function(this: any, ...args: any[]) { - setup(this, args); - }); - - // define the mock name which is used in some snapshots - MockClass.mockName(`Mock${Class.name}`); - - // define the class name for the MockClass which is used in other snapshots - Object.defineProperty(MockClass, 'name', { - value: `Mock${Class.name}`, - }); - - jest.mock(module, () => ({ - [Class.name]: MockClass, - })); - - return MockClass; -} - -// Mock the UiSettingsApi class -import { UiSettingsApi } from './ui_settings_api'; -const MockUiSettingsApi = mockClass('./ui_settings_api', UiSettingsApi, inst => { - inst.stop = jest.fn(); - inst.getLoadingCount$ = jest.fn().mockReturnValue({ - loadingCountObservable: true, - }); -}); - -// Mock the UiSettingsClient class -import { UiSettingsClient } from './ui_settings_client'; -const MockUiSettingsClient = mockClass('./ui_settings_client', UiSettingsClient, inst => { - inst.stop = jest.fn(); -}); +import { MockUiSettingsApi, MockUiSettingsClient } from './ui_settings_service.test.mocks'; import { basePathServiceMock } from '../base_path/base_path_service.mock'; import { httpServiceMock } from '../http/http_service.mock'; diff --git a/src/core/server/config/config_service.mock.ts b/src/core/server/config/config_service.mock.ts index d9f460905fc4..92b0f117b1a0 100644 --- a/src/core/server/config/config_service.mock.ts +++ b/src/core/server/config/config_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { BehaviorSubject } from 'rxjs'; import { ObjectToConfigAdapter } from './object_to_config_adapter'; diff --git a/src/core/server/config/config_service.test.mocks.ts b/src/core/server/config/config_service.test.mocks.ts new file mode 100644 index 000000000000..8fa1ec997d62 --- /dev/null +++ b/src/core/server/config/config_service.test.mocks.ts @@ -0,0 +1,21 @@ +/* + * 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 const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../package.json', () => mockPackage); diff --git a/src/core/server/config/config_service.test.ts b/src/core/server/config/config_service.test.ts index 7a10d4992e2c..a054786c80f7 100644 --- a/src/core/server/config/config_service.test.ts +++ b/src/core/server/config/config_service.test.ts @@ -22,8 +22,7 @@ import { BehaviorSubject } from 'rxjs'; import { first } from 'rxjs/operators'; -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../package.json', () => mockPackage); +import { mockPackage } from './config_service.test.mocks'; import { schema, Type, TypeOf } from '@kbn/config-schema'; diff --git a/src/core/server/config/env.test.mocks.ts b/src/core/server/config/env.test.mocks.ts new file mode 100644 index 000000000000..be65aa172707 --- /dev/null +++ b/src/core/server/config/env.test.mocks.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +jest.mock('process', () => ({ + cwd() { + return '/test/cwd'; + }, +})); + +jest.mock('path', () => ({ + resolve(...pathSegments: string[]) { + return pathSegments.join('/'); + }, +})); + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../package.json', () => mockPackage); diff --git a/src/core/server/config/env.test.ts b/src/core/server/config/env.test.ts index 3c251b7339e4..13bd05c3b1c8 100644 --- a/src/core/server/config/env.test.ts +++ b/src/core/server/config/env.test.ts @@ -17,20 +17,7 @@ * under the License. */ -jest.mock('process', () => ({ - cwd() { - return '/test/cwd'; - }, -})); - -jest.mock('path', () => ({ - resolve(...pathSegments: string[]) { - return pathSegments.join('/'); - }, -})); - -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../package.json', () => mockPackage); +import { mockPackage } from './env.test.mocks'; import { Env } from '.'; import { getEnvOptions } from './__mocks__/env'; diff --git a/src/core/server/config/raw_config_service.test.mocks.ts b/src/core/server/config/raw_config_service.test.mocks.ts new file mode 100644 index 000000000000..be43b0f64e65 --- /dev/null +++ b/src/core/server/config/raw_config_service.test.mocks.ts @@ -0,0 +1,24 @@ +/* + * 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 const mockGetConfigFromFiles = jest.fn(); + +jest.mock('./read_config', () => ({ + getConfigFromFiles: mockGetConfigFromFiles, +})); diff --git a/src/core/server/config/raw_config_service.test.ts b/src/core/server/config/raw_config_service.test.ts index 0cd0dc45cd93..361cef0d042e 100644 --- a/src/core/server/config/raw_config_service.test.ts +++ b/src/core/server/config/raw_config_service.test.ts @@ -17,11 +17,7 @@ * under the License. */ -const mockGetConfigFromFiles = jest.fn(); - -jest.mock('./read_config', () => ({ - getConfigFromFiles: mockGetConfigFromFiles, -})); +import { mockGetConfigFromFiles } from './raw_config_service.test.mocks'; import { first } from 'rxjs/operators'; import { RawConfigService } from '.'; diff --git a/src/core/server/elasticsearch/cluster_client.test.mocks.ts b/src/core/server/elasticsearch/cluster_client.test.mocks.ts new file mode 100644 index 000000000000..4a8553d1d5f9 --- /dev/null +++ b/src/core/server/elasticsearch/cluster_client.test.mocks.ts @@ -0,0 +1,35 @@ +/* + * 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 const MockClient = jest.fn(); +jest.mock('elasticsearch', () => ({ + // Jest types don't include `requireActual` right now. + ...jest.requireActual('elasticsearch'), + Client: MockClient, +})); + +export const MockScopedClusterClient = jest.fn(); +jest.mock('./scoped_cluster_client', () => ({ + ScopedClusterClient: MockScopedClusterClient, +})); + +export const mockParseElasticsearchClientConfig = jest.fn(); +jest.mock('./elasticsearch_client_config', () => ({ + parseElasticsearchClientConfig: mockParseElasticsearchClientConfig, +})); diff --git a/src/core/server/elasticsearch/cluster_client.test.ts b/src/core/server/elasticsearch/cluster_client.test.ts index da511c282981..30a1ac7a038e 100644 --- a/src/core/server/elasticsearch/cluster_client.test.ts +++ b/src/core/server/elasticsearch/cluster_client.test.ts @@ -19,22 +19,11 @@ import { ElasticsearchConfig } from './elasticsearch_config'; -const MockClient = jest.fn(); -jest.mock('elasticsearch', () => ({ - // Jest types don't include `requireActual` right now. - ...(jest as any).requireActual('elasticsearch'), - Client: MockClient, -})); - -const MockScopedClusterClient = jest.fn(); -jest.mock('./scoped_cluster_client', () => ({ - ScopedClusterClient: MockScopedClusterClient, -})); - -const mockParseElasticsearchClientConfig = jest.fn(); -jest.mock('./elasticsearch_client_config', () => ({ - parseElasticsearchClientConfig: mockParseElasticsearchClientConfig, -})); +import { + MockClient, + mockParseElasticsearchClientConfig, + MockScopedClusterClient, +} from './cluster_client.test.mocks'; import { errors } from 'elasticsearch'; import { get } from 'lodash'; diff --git a/src/dev/jest/ts_transform.js b/src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts similarity index 88% rename from src/dev/jest/ts_transform.js rename to src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts index f097ed2f8076..f6c6079822cb 100644 --- a/src/dev/jest/ts_transform.js +++ b/src/core/server/elasticsearch/elasticsearch_client_config.test.mocks.ts @@ -17,5 +17,5 @@ * under the License. */ -require('../../setup_node_env'); -module.exports = require('./ts_transform.ts'); +export const mockReadFileSync = jest.fn(); +jest.mock('fs', () => ({ readFileSync: mockReadFileSync })); diff --git a/src/core/server/elasticsearch/elasticsearch_client_config.test.ts b/src/core/server/elasticsearch/elasticsearch_client_config.test.ts index f2eb30f73640..64fb41cb3e4e 100644 --- a/src/core/server/elasticsearch/elasticsearch_client_config.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_client_config.test.ts @@ -17,8 +17,7 @@ * under the License. */ -const mockReadFileSync = jest.fn(); -jest.mock('fs', () => ({ readFileSync: mockReadFileSync })); +import { mockReadFileSync } from './elasticsearch_client_config.test.mocks'; import { duration } from 'moment'; import { loggingServiceMock } from '../logging/logging_service.mock'; @@ -67,7 +66,7 @@ Object { }); test('parses fully specified config', () => { - mockReadFileSync.mockImplementation(path => `content-of-${path}`); + mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`); const elasticsearchConfig: ElasticsearchClientConfig = { apiVersion: 'v7.0.0', @@ -607,7 +606,7 @@ Object { }); test('#ignoreCertAndKey = true', () => { - mockReadFileSync.mockImplementation(path => `content-of-${path}`); + mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`); expect( parseElasticsearchClientConfig( diff --git a/src/core/server/elasticsearch/elasticsearch_service.mock.ts b/src/core/server/elasticsearch/elasticsearch_service.mock.ts index bbd7fda86c5e..57157adc2fac 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.mock.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { BehaviorSubject } from 'rxjs'; import { ClusterClient } from './cluster_client'; import { ElasticsearchConfig } from './elasticsearch_config'; diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts b/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts new file mode 100644 index 000000000000..e87913a3c5e4 --- /dev/null +++ b/src/core/server/elasticsearch/elasticsearch_service.test.mocks.ts @@ -0,0 +1,21 @@ +/* + * 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 const MockClusterClient = jest.fn(); +jest.mock('./cluster_client', () => ({ ClusterClient: MockClusterClient })); diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/src/core/server/elasticsearch/elasticsearch_service.test.ts index f880e318e717..0697d9152f0a 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.test.ts @@ -19,8 +19,7 @@ import { first } from 'rxjs/operators'; -const MockClusterClient = jest.fn(); -jest.mock('./cluster_client', () => ({ ClusterClient: MockClusterClient })); +import { MockClusterClient } from './elasticsearch_service.test.mocks'; import { BehaviorSubject, combineLatest } from 'rxjs'; import { Config, ConfigService, Env, ObjectToConfigAdapter } from '../config'; diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index f246ff6634b3..bc9a42b26fdf 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + import { Server, ServerOptions } from 'hapi'; import { HttpService } from './http_service'; diff --git a/src/core/server/http/http_service.test.mocks.ts b/src/core/server/http/http_service.test.mocks.ts new file mode 100644 index 000000000000..a0d7ff5069eb --- /dev/null +++ b/src/core/server/http/http_service.test.mocks.ts @@ -0,0 +1,24 @@ +/* + * 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 const mockHttpServer = jest.fn(); + +jest.mock('./http_server', () => ({ + HttpServer: mockHttpServer, +})); diff --git a/src/core/server/http/http_service.test.ts b/src/core/server/http/http_service.test.ts index 6ed3d13221dc..6c38162a0b7f 100644 --- a/src/core/server/http/http_service.test.ts +++ b/src/core/server/http/http_service.test.ts @@ -17,11 +17,7 @@ * under the License. */ -const mockHttpServer = jest.fn(); - -jest.mock('./http_server', () => ({ - HttpServer: mockHttpServer, -})); +import { mockHttpServer } from './http_service.test.mocks'; import { noop } from 'lodash'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/core/server/index.test.mocks.ts b/src/core/server/index.test.mocks.ts new file mode 100644 index 000000000000..c25772ea46de --- /dev/null +++ b/src/core/server/index.test.mocks.ts @@ -0,0 +1,40 @@ +/* + * 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 { httpServiceMock } from './http/http_service.mock'; +export const httpService = httpServiceMock.create(); +jest.doMock('./http/http_service', () => ({ + HttpService: jest.fn(() => httpService), +})); + +export const mockPluginsService = { setup: jest.fn(), stop: jest.fn() }; +jest.doMock('./plugins/plugins_service', () => ({ + PluginsService: jest.fn(() => mockPluginsService), +})); + +import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; +export const elasticsearchService = elasticsearchServiceMock.create(); +jest.doMock('./elasticsearch/elasticsearch_service', () => ({ + ElasticsearchService: jest.fn(() => elasticsearchService), +})); + +export const mockLegacyService = { setup: jest.fn(), stop: jest.fn() }; +jest.mock('./legacy/legacy_service', () => ({ + LegacyService: jest.fn(() => mockLegacyService), +})); diff --git a/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap b/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap index 050184b1f1d5..76d53b4b1cc5 100644 --- a/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap +++ b/src/core/server/legacy/__snapshots__/legacy_service.test.ts.snap @@ -28,6 +28,7 @@ Array [ "valueInBytes": 1073741824, }, }, + "httpsAgent": undefined, "log": Object { "context": Array [ "server", @@ -52,6 +53,7 @@ Array [ "trace": [MockFunction], "warn": [MockFunction], }, + "server": undefined, }, ], ] diff --git a/src/core/server/logging/appenders/appenders.test.mocks.ts b/src/core/server/logging/appenders/appenders.test.mocks.ts new file mode 100644 index 000000000000..551a4ac1bedc --- /dev/null +++ b/src/core/server/logging/appenders/appenders.test.mocks.ts @@ -0,0 +1,29 @@ +/* + * 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 const mockCreateLayout = jest.fn(); +jest.mock('../layouts/layouts', () => { + const { schema } = require('@kbn/config-schema'); + return { + Layouts: { + configSchema: schema.object({ kind: schema.literal('mock') }), + create: mockCreateLayout, + }, + }; +}); diff --git a/src/core/server/logging/appenders/appenders.test.ts b/src/core/server/logging/appenders/appenders.test.ts index df528f4c58cd..7cfd2158be33 100644 --- a/src/core/server/logging/appenders/appenders.test.ts +++ b/src/core/server/logging/appenders/appenders.test.ts @@ -17,16 +17,7 @@ * under the License. */ -const mockCreateLayout = jest.fn(); -jest.mock('../layouts/layouts', () => { - const { schema } = require('@kbn/config-schema'); - return { - Layouts: { - configSchema: schema.object({ kind: schema.literal('mock') }), - create: mockCreateLayout, - }, - }; -}); +import { mockCreateLayout } from './appenders.test.mocks'; import { LegacyAppender } from '../../legacy/logging/appenders/legacy_appender'; import { Appenders } from './appenders'; diff --git a/src/core/server/logging/appenders/file/file_appender.test.mocks.ts b/src/core/server/logging/appenders/file/file_appender.test.mocks.ts new file mode 100644 index 000000000000..a4e4532882f5 --- /dev/null +++ b/src/core/server/logging/appenders/file/file_appender.test.mocks.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +jest.mock('../../layouts/layouts', () => { + const { schema } = require('@kbn/config-schema'); + return { + Layouts: { + configSchema: schema.object({ + kind: schema.literal('mock'), + }), + }, + }; +}); + +export const mockCreateWriteStream = jest.fn(); +jest.mock('fs', () => ({ createWriteStream: mockCreateWriteStream })); diff --git a/src/core/server/logging/appenders/file/file_appender.test.ts b/src/core/server/logging/appenders/file/file_appender.test.ts index 1d9ef3399595..fccca629f7d6 100644 --- a/src/core/server/logging/appenders/file/file_appender.test.ts +++ b/src/core/server/logging/appenders/file/file_appender.test.ts @@ -17,19 +17,7 @@ * under the License. */ -jest.mock('../../layouts/layouts', () => { - const { schema } = require('@kbn/config-schema'); - return { - Layouts: { - configSchema: schema.object({ - kind: schema.literal('mock'), - }), - }, - }; -}); - -const mockCreateWriteStream = jest.fn(); -jest.mock('fs', () => ({ createWriteStream: mockCreateWriteStream })); +import { mockCreateWriteStream } from './file_appender.test.mocks'; import { LogLevel } from '../../log_level'; import { LogRecord } from '../../log_record'; diff --git a/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts b/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts new file mode 100644 index 000000000000..d92465e4dd49 --- /dev/null +++ b/src/core/server/plugins/discovery/plugin_discovery.test.mocks.ts @@ -0,0 +1,30 @@ +/* + * 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 const mockReaddir = jest.fn(); +export const mockReadFile = jest.fn(); +export const mockStat = jest.fn(); +jest.mock('fs', () => ({ + readdir: mockReaddir, + readFile: mockReadFile, + stat: mockStat, +})); + +export const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../../../package.json', () => mockPackage); diff --git a/src/core/server/plugins/discovery/plugin_discovery.test.ts b/src/core/server/plugins/discovery/plugin_discovery.test.ts index 266ad1780d47..ac02a21cbe7a 100644 --- a/src/core/server/plugins/discovery/plugin_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugin_discovery.test.ts @@ -17,17 +17,7 @@ * under the License. */ -const mockReaddir = jest.fn(); -const mockReadFile = jest.fn(); -const mockStat = jest.fn(); -jest.mock('fs', () => ({ - readdir: mockReaddir, - readFile: mockReadFile, - stat: mockStat, -})); - -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../../../package.json', () => mockPackage); +import { mockPackage, mockReaddir, mockReadFile, mockStat } from './plugin_discovery.test.mocks'; import { resolve } from 'path'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts new file mode 100644 index 000000000000..eb8dc1e60958 --- /dev/null +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts @@ -0,0 +1,22 @@ +/* + * 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 const mockReadFile = jest.fn(); +const mockStat = jest.fn(); +jest.mock('fs', () => ({ readFile: mockReadFile, stat: mockStat })); diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts index d6012e4a5e2e..082cd82e5e1f 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts @@ -19,9 +19,7 @@ import { PluginDiscoveryErrorType } from './plugin_discovery_error'; -const mockReadFile = jest.fn(); -const mockStat = jest.fn(); -jest.mock('fs', () => ({ readFile: mockReadFile, stat: mockStat })); +import { mockReadFile } from './plugin_manifest_parser.test.mocks'; import { resolve } from 'path'; import { parseManifest } from './plugin_manifest_parser'; diff --git a/src/core/server/plugins/plugin.test.ts b/src/core/server/plugins/plugin.test.ts index 284e9e10cb7b..2f2a73668a59 100644 --- a/src/core/server/plugins/plugin.test.ts +++ b/src/core/server/plugins/plugin.test.ts @@ -30,15 +30,15 @@ import { createPluginInitializerContext, createPluginSetupContext } from './plug const mockPluginInitializer = jest.fn(); const logger = loggingServiceMock.create(); -jest.mock( +jest.doMock( join('plugin-with-initializer-path', 'server'), () => ({ plugin: mockPluginInitializer }), { virtual: true } ); -jest.mock(join('plugin-without-initializer-path', 'server'), () => ({}), { +jest.doMock(join('plugin-without-initializer-path', 'server'), () => ({}), { virtual: true, }); -jest.mock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { +jest.doMock(join('plugin-with-wrong-initializer-path', 'server'), () => ({ plugin: {} }), { virtual: true, }); diff --git a/src/core/server/plugins/plugins_service.test.mocks.ts b/src/core/server/plugins/plugins_service.test.mocks.ts new file mode 100644 index 000000000000..13b492e382d6 --- /dev/null +++ b/src/core/server/plugins/plugins_service.test.mocks.ts @@ -0,0 +1,26 @@ +/* + * 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 const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); +jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage })); + +export const mockDiscover = jest.fn(); +jest.mock('./discovery/plugins_discovery', () => ({ discover: mockDiscover })); + +jest.mock('./plugins_system'); diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts index 553cb8a03138..2a3ce3a4f88d 100644 --- a/src/core/server/plugins/plugins_service.test.ts +++ b/src/core/server/plugins/plugins_service.test.ts @@ -17,13 +17,7 @@ * under the License. */ -const mockPackage = new Proxy({ raw: {} as any }, { get: (obj, prop) => obj.raw[prop] }); -jest.mock('../../../legacy/utils/package_json', () => ({ pkg: mockPackage })); - -const mockDiscover = jest.fn(); -jest.mock('./discovery/plugins_discovery', () => ({ discover: mockDiscover })); - -jest.mock('./plugins_system'); +import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; import { resolve } from 'path'; import { BehaviorSubject, from } from 'rxjs'; diff --git a/src/core/server/plugins/plugins_system.test.mocks.ts b/src/core/server/plugins/plugins_system.test.mocks.ts new file mode 100644 index 000000000000..9bcbba892fa2 --- /dev/null +++ b/src/core/server/plugins/plugins_system.test.mocks.ts @@ -0,0 +1,23 @@ +/* + * 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 const mockCreatePluginSetupContext = jest.fn(); +jest.mock('./plugin_context', () => ({ + createPluginSetupContext: mockCreatePluginSetupContext, +})); diff --git a/src/core/server/plugins/plugins_system.test.ts b/src/core/server/plugins/plugins_system.test.ts index 2df8b8301b0e..3202a7697bd6 100644 --- a/src/core/server/plugins/plugins_system.test.ts +++ b/src/core/server/plugins/plugins_system.test.ts @@ -17,16 +17,12 @@ * under the License. */ -import { CoreContext } from '../core_context'; - -const mockCreatePluginSetupContext = jest.fn(); -jest.mock('./plugin_context', () => ({ - createPluginSetupContext: mockCreatePluginSetupContext, -})); +import { mockCreatePluginSetupContext } from './plugins_system.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { Config, ConfigService, Env, ObjectToConfigAdapter } from '../config'; import { getEnvOptions } from '../config/__mocks__/env'; +import { CoreContext } from '../core_context'; import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; import { loggingServiceMock } from '../logging/logging_service.mock'; import { Plugin, PluginName } from './plugin'; diff --git a/src/core/server/root/index.test.mocks.ts b/src/core/server/root/index.test.mocks.ts new file mode 100644 index 000000000000..602fa2368a76 --- /dev/null +++ b/src/core/server/root/index.test.mocks.ts @@ -0,0 +1,33 @@ +/* + * 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 { loggingServiceMock } from '../logging/logging_service.mock'; +export const logger = loggingServiceMock.create(); +jest.doMock('../logging', () => ({ + LoggingService: jest.fn(() => logger), +})); + +import { configServiceMock } from '../config/config_service.mock'; +export const configService = configServiceMock.create(); +jest.doMock('../config/config_service', () => ({ + ConfigService: jest.fn(() => configService), +})); + +export const mockServer = { setup: jest.fn(), stop: jest.fn() }; +jest.mock('../server', () => ({ Server: jest.fn(() => mockServer) })); diff --git a/src/core/server/root/index.test.ts b/src/core/server/root/index.test.ts index b5915debfe6a..4eba2133dce2 100644 --- a/src/core/server/root/index.test.ts +++ b/src/core/server/root/index.test.ts @@ -17,20 +17,7 @@ * under the License. */ -import { loggingServiceMock } from '../logging/logging_service.mock'; -const logger = loggingServiceMock.create(); -jest.mock('../logging', () => ({ - LoggingService: jest.fn(() => logger), -})); - -import { configServiceMock } from '../config/config_service.mock'; -const configService = configServiceMock.create(); -jest.mock('../config/config_service', () => ({ - ConfigService: jest.fn(() => configService), -})); - -const mockServer = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('../server', () => ({ Server: jest.fn(() => mockServer) })); +import { configService, logger, mockServer } from './index.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { filter, first } from 'rxjs/operators'; diff --git a/src/core/server/server.test.ts b/src/core/server/server.test.ts index a3bfa8db21c4..cbfdbbc3bc00 100644 --- a/src/core/server/server.test.ts +++ b/src/core/server/server.test.ts @@ -16,27 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { httpServiceMock } from './http/http_service.mock'; -const httpService = httpServiceMock.create(); -jest.mock('./http/http_service', () => ({ - HttpService: jest.fn(() => httpService), -})); -const mockPluginsService = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('./plugins/plugins_service', () => ({ - PluginsService: jest.fn(() => mockPluginsService), -})); - -import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; -const elasticsearchService = elasticsearchServiceMock.create(); -jest.mock('./elasticsearch/elasticsearch_service', () => ({ - ElasticsearchService: jest.fn(() => elasticsearchService), -})); - -const mockLegacyService = { setup: jest.fn(), stop: jest.fn() }; -jest.mock('./legacy/legacy_service', () => ({ - LegacyService: jest.fn(() => mockLegacyService), -})); +import { + elasticsearchService, + httpService, + mockLegacyService, + mockPluginsService, +} from './index.test.mocks'; import { BehaviorSubject } from 'rxjs'; import { Env } from './config'; diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index cda00064162f..bb450dcd006b 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -47,8 +47,8 @@ import { RemovePackageJsonDepsTask, RemoveWorkspacesTask, TranspileBabelTask, - TranspileTypescriptTask, TranspileScssTask, + TypecheckTypescriptTask, UpdateLicenseFileTask, VerifyEnvTask, VerifyExistingNodeBuildsTask, @@ -107,15 +107,14 @@ export async function buildDistributables(options) { * run platform-generic build tasks */ await run(CopySourceTask); + await run(TypecheckTypescriptTask); await run(CreateEmptyDirsAndFilesTask); await run(CreateReadmeTask); await run(TranspileBabelTask); - await run(TranspileTypescriptTask); await run(BuildPackagesTask); await run(CreatePackageJsonTask); await run(InstallDependenciesTask); await run(RemoveWorkspacesTask); - await run(CleanTypescriptTask); await run(CleanPackagesTask); await run(CreateNoticeFileTask); await run(UpdateLicenseFileTask); @@ -123,6 +122,7 @@ export async function buildDistributables(options) { await run(TranspileScssTask); await run(OptimizeBuildTask); await run(CleanClientModulesOnDLLTask); + await run(CleanTypescriptTask); await run(CleanExtraFilesFromModulesTask); await run(CleanEmptyFoldersTask); diff --git a/src/dev/build/tasks/copy_source_task.js b/src/dev/build/tasks/copy_source_task.js index 18ca6492f08c..01b31b51a060 100644 --- a/src/dev/build/tasks/copy_source_task.js +++ b/src/dev/build/tasks/copy_source_task.js @@ -28,7 +28,8 @@ export const CopySourceTask = { select: [ 'yarn.lock', 'src/**', - '!src/**/*.test.{js,ts,tsx}', + '!src/**/*.{test,test.mocks,mock}.{js,ts,tsx}', + '!src/**/mocks.ts', // special file who imports .mock files '!src/**/{__tests__,__snapshots__}/**', '!src/test_utils/**', '!src/fixtures/**', diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index ecf86d6af23e..acf4680fd6f4 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -33,7 +33,7 @@ export * from './notice_file_task'; export * from './optimize_task'; export * from './os_packages'; export * from './transpile_babel_task'; -export * from './transpile_typescript_task'; +export * from './typecheck_typescript_task'; export * from './transpile_scss_task'; export * from './verify_env_task'; export * from './write_sha_sums_task'; diff --git a/src/dev/build/tasks/transpile_babel_task.js b/src/dev/build/tasks/transpile_babel_task.js index 1ea3d8158391..c6d762be9d73 100644 --- a/src/dev/build/tasks/transpile_babel_task.js +++ b/src/dev/build/tasks/transpile_babel_task.js @@ -22,31 +22,59 @@ import vfs from 'vinyl-fs'; import { createPromiseFromStreams } from '../../../legacy/utils'; +const transpileWithBabel = async (srcGlobs, build, presets) => { + const buildRoot = build.resolvePath(); + + await createPromiseFromStreams([ + vfs.src( + srcGlobs.concat([ + '!**/*.d.ts', + '!packages/**', + '!**/node_modules/**', + '!**/bower_components/**', + '!**/__tests__/**', + ]), + { + cwd: buildRoot, + } + ), + + gulpBabel({ + babelrc: false, + presets, + }), + + vfs.dest(buildRoot), + ]); +}; + export const TranspileBabelTask = { description: 'Transpiling sources with babel', async run(config, log, build) { - await createPromiseFromStreams([ - vfs.src( - [ - '**/*.js', - '!packages/**', - '!**/public/**', - '!**/node_modules/**', - '!**/bower_components/**', - '!**/__tests__/**', - ], - { - cwd: build.resolvePath(), - } - ), + // Transpile server code + await transpileWithBabel( + [ + '**/*.{js,ts,tsx}', + '!**/public/**', + ], + build, + [ + require.resolve('@kbn/babel-preset/node_preset') + ] + ); - gulpBabel({ - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/node_preset')], - }), - - vfs.dest(build.resolvePath()), - ]); + // Transpile client code + // NOTE: For the client, as we have the optimizer, we are only + // pre-transpiling the typescript based files + await transpileWithBabel( + [ + '**/public/**/*.{ts,tsx}', + ], + build, + [ + require.resolve('@kbn/babel-preset/webpack_preset') + ] + ); }, }; diff --git a/src/dev/build/tasks/transpile_typescript_task.js b/src/dev/build/tasks/typecheck_typescript_task.js similarity index 85% rename from src/dev/build/tasks/transpile_typescript_task.js rename to src/dev/build/tasks/typecheck_typescript_task.js index 735d6c17afec..bbdc5f69be8b 100644 --- a/src/dev/build/tasks/transpile_typescript_task.js +++ b/src/dev/build/tasks/typecheck_typescript_task.js @@ -20,22 +20,13 @@ import { exec, write } from '../lib'; import { Project } from '../../typescript'; -export const TranspileTypescriptTask = { - description: 'Transpiling sources with typescript compiler', +export const TypecheckTypescriptTask = { + description: 'Typechecking sources with typescript compiler', async run(config, log, build) { // these projects are built in the build folder - const defaultProject = new Project(build.resolvePath('tsconfig.json')); const browserProject = new Project(build.resolvePath('tsconfig.browser.json')); - - // update the default config to exclude **/public/**/* files - await write(defaultProject.tsConfigPath, JSON.stringify({ - ...defaultProject.config, - exclude: [ - ...defaultProject.config.exclude, - 'src/**/public/**/*' - ] - })); + const defaultProject = new Project(build.resolvePath('tsconfig.json')); // update the browser config file to include **/public/**/* files await write(browserProject.tsConfigPath, JSON.stringify({ @@ -47,21 +38,28 @@ export const TranspileTypescriptTask = { ] })); + // update the default config to exclude **/public/**/* files + await write(defaultProject.tsConfigPath, JSON.stringify({ + ...defaultProject.config, + exclude: [ + ...defaultProject.config.exclude, + 'src/**/public/**/*' + ] + })); + const projects = [ - // Browser needs to be compiled before server code so that any shared code - // is compiled to the lowest common denominator (server's CommonJS format) - // which can be supported by both environments. browserProject.tsConfigPath, defaultProject.tsConfigPath, ]; // compile each typescript config file for (const tsConfigPath of projects) { - log.info(`Compiling`, tsConfigPath, 'project'); + log.info(`Typechecking`, tsConfigPath, 'project'); await exec( log, require.resolve('typescript/bin/tsc'), [ + '--noEmit', '--pretty', 'true', '--project', tsConfigPath, ], diff --git a/src/dev/i18n/integrate_locale_files.test.mocks.ts b/src/dev/i18n/integrate_locale_files.test.mocks.ts new file mode 100644 index 000000000000..e84ca068c067 --- /dev/null +++ b/src/dev/i18n/integrate_locale_files.test.mocks.ts @@ -0,0 +1,27 @@ +/* + * 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 const mockWriteFileAsync = jest.fn(); +export const mockMakeDirAsync = jest.fn(); +jest.mock('./utils', () => ({ + // Jest typings don't define `requireActual` for some reason. + ...(jest as any).requireActual('./utils'), + writeFileAsync: mockWriteFileAsync, + makeDirAsync: mockMakeDirAsync, +})); diff --git a/src/dev/i18n/integrate_locale_files.test.ts b/src/dev/i18n/integrate_locale_files.test.ts index 050f16f3d334..7d7d1ba74468 100644 --- a/src/dev/i18n/integrate_locale_files.test.ts +++ b/src/dev/i18n/integrate_locale_files.test.ts @@ -17,14 +17,7 @@ * under the License. */ -const mockWriteFileAsync = jest.fn(); -const mockMakeDirAsync = jest.fn(); -jest.mock('./utils', () => ({ - // Jest typings don't define `requireActual` for some reason. - ...(jest as any).requireActual('./utils'), - writeFileAsync: mockWriteFileAsync, - makeDirAsync: mockMakeDirAsync, -})); +import { mockMakeDirAsync, mockWriteFileAsync } from './integrate_locale_files.test.mocks'; import path from 'path'; import { integrateLocaleFiles, verifyMessages } from './integrate_locale_files'; diff --git a/src/dev/jest/babel_transform.js b/src/dev/jest/babel_transform.js index 7bdba8ae7fa1..0796cf859d4e 100644 --- a/src/dev/jest/babel_transform.js +++ b/src/dev/jest/babel_transform.js @@ -22,5 +22,5 @@ const babelJest = require('babel-jest'); module.exports = babelJest.createTransformer({ presets: [ require.resolve('@kbn/babel-preset/node_preset') - ] + ], }); diff --git a/src/dev/jest/config.js b/src/dev/jest/config.js index 1427624f0ce9..840510815d34 100644 --- a/src/dev/jest/config.js +++ b/src/dev/jest/config.js @@ -59,11 +59,6 @@ export default { coverageReporters: [ 'html', ], - globals: { - 'ts-jest': { - skipBabel: true, - }, - }, moduleFileExtensions: [ 'js', 'json', @@ -83,8 +78,7 @@ export default { 'integration_tests/' ], transform: { - '^.+\\.js$': '/src/dev/jest/babel_transform.js', - '^.+\\.tsx?$': '/src/dev/jest/ts_transform.js', + '^.+\\.(js|tsx?)$': '/src/dev/jest/babel_transform.js', '^.+\\.txt?$': 'jest-raw-loader', '^.+\\.html?$': 'jest-raw-loader', }, diff --git a/src/dev/jest/setup/babel_polyfill.js b/src/dev/jest/setup/babel_polyfill.js index 38e1cfbcdd72..58325c1a67f9 100644 --- a/src/dev/jest/setup/babel_polyfill.js +++ b/src/dev/jest/setup/babel_polyfill.js @@ -18,6 +18,6 @@ */ // Note: In theory importing the polyfill should not be needed, as Babel should -// include the necessary polyfills when using `babel-preset-env`, but for some +// include the necessary polyfills when using `@babel/preset-env`, but for some // reason it did not work. See https://github.com/elastic/kibana/issues/14506 import '../../../setup_node_env/babel_register/polyfill'; diff --git a/src/dev/jest/ts_transform.ts b/src/dev/jest/ts_transform.ts deleted file mode 100644 index ed366bcd091a..000000000000 --- a/src/dev/jest/ts_transform.ts +++ /dev/null @@ -1,74 +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 TsJest from 'ts-jest'; - -import { getTsProjectForAbsolutePath } from '../typescript'; - -const DEFAULT_TS_CONFIG_PATH = require.resolve('../../../tsconfig.json'); -const DEFAULT_BROWSER_TS_CONFIG_PATH = require.resolve('../../../tsconfig.browser.json'); - -function extendJestConfigJSON(jestConfigJSON: string, filePath: string) { - const jestConfig = JSON.parse(jestConfigJSON) as jest.ProjectConfig; - return JSON.stringify(extendJestConfig(jestConfig, filePath)); -} - -function extendJestConfig(jestConfig: jest.ProjectConfig, filePath: string) { - let tsConfigFile = getTsProjectForAbsolutePath(filePath).tsConfigPath; - - // swap ts config file for jest tests - if (tsConfigFile === DEFAULT_BROWSER_TS_CONFIG_PATH) { - tsConfigFile = DEFAULT_TS_CONFIG_PATH; - } - - return { - ...jestConfig, - globals: { - ...(jestConfig.globals || {}), - 'ts-jest': { - skipBabel: true, - tsConfigFile, - }, - }, - }; -} - -module.exports = { - canInstrument: true, - - process( - src: string, - filePath: jest.Path, - jestConfig: jest.ProjectConfig, - transformOptions: jest.TransformOptions - ) { - const extendedConfig = extendJestConfig(jestConfig, filePath); - return TsJest.process(src, filePath, extendedConfig, transformOptions); - }, - - getCacheKey( - src: string, - filePath: string, - jestConfigJSON: string, - transformOptions: jest.TransformOptions - ) { - const extendedConfigJSON = extendJestConfigJSON(jestConfigJSON, filePath); - return TsJest.getCacheKey!(src, filePath, extendedConfigJSON, transformOptions); - }, -}; diff --git a/src/dev/license_checker/config.js b/src/dev/license_checker/config.js index 9c6fa7767ee1..879c2147ccb1 100644 --- a/src/dev/license_checker/config.js +++ b/src/dev/license_checker/config.js @@ -105,5 +105,5 @@ export const LICENSE_OVERRIDES = { 'walk@2.3.9': ['MIT'], // TODO remove this once we upgrade past or equal to v1.0.2 - 'babel-plugin-mock-imports@0.0.5': ['MIT'] + 'babel-plugin-mock-imports@1.0.1': ['MIT'] }; diff --git a/src/dev/mocha/run_mocha_cli.js b/src/dev/mocha/run_mocha_cli.js index d24f9a06eafd..299a910127d4 100644 --- a/src/dev/mocha/run_mocha_cli.js +++ b/src/dev/mocha/run_mocha_cli.js @@ -43,7 +43,7 @@ export function runMochaCli() { // check that we aren't leaking any globals process.argv.push('--check-leaks'); // prevent globals injected from canvas plugins from triggering leak check - process.argv.push('--globals', 'core,regeneratorRuntime,_'); + process.argv.push('--globals', '__core-js_shared__,core,_, '); // ensure that mocha requires the setup_node_env script process.argv.push('--require', require.resolve('../../setup_node_env')); diff --git a/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap b/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap index fdd47c581b7f..522a12b4ec84 100644 --- a/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap +++ b/src/legacy/core_plugins/inspector_views/public/data/__snapshots__/data_view.test.js.snap @@ -222,6 +222,8 @@ exports[`Inspector Data View component should render loading state 1`] = ` }, "_eventsCount": 1, "_maxListeners": undefined, + "tabular": undefined, + "tabularOptions": undefined, }, } } diff --git a/src/legacy/core_plugins/interpreter/common/types/register.js b/src/legacy/core_plugins/interpreter/common/types/register.js index 17b03f022967..582843c91f83 100644 --- a/src/legacy/core_plugins/interpreter/common/types/register.js +++ b/src/legacy/core_plugins/interpreter/common/types/register.js @@ -17,7 +17,7 @@ * under the License. */ -import 'babel-polyfill'; +import '@babel/polyfill'; import { typeSpecs } from './index'; // eslint-disable-next-line no-undef diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap index bc0bdddfdbc5..aa33eb4ab1d0 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap @@ -1125,10 +1125,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` className="euiScreenReaderOnly" > - - +

    - - +

    - + - + @@ -2595,7 +2592,7 @@ exports[`NewVisModal should render as expected 1`] = `

    - - +

    - - +

    - + - + diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts new file mode 100644 index 000000000000..04c99a1547ba --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.mocks.ts @@ -0,0 +1,26 @@ +/* + * 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 const settingsGet = jest.fn(); + +jest.doMock('ui/chrome', () => ({ + getUiSettingsClient: () => ({ + get: settingsGet, + }), +})); diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx index dd357d70f8a0..fbb3faf7b356 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx @@ -20,13 +20,7 @@ import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; -const settingsGet = jest.fn(); - -jest.mock('ui/chrome', () => ({ - getUiSettingsClient: () => ({ - get: settingsGet, - }), -})); +import { settingsGet } from './new_vis_modal.test.mocks'; import { NewVisModal } from './new_vis_modal'; diff --git a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js index 99238fcd1c9c..bed96987ac2b 100644 --- a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js +++ b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js @@ -30,7 +30,7 @@ export const createTestEntryTemplate = (defaultUiSettings) => (bundle) => ` */ // import global polyfills before everything else -import 'babel-polyfill'; +import '@babel/polyfill'; import 'custom-event-polyfill'; import 'whatwg-fetch'; import 'abortcontroller-polyfill'; diff --git a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap index 8a0efdef7201..12492b0bb7b6 100644 --- a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap +++ b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.js.snap @@ -14,7 +14,7 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` , + "content": , "data-test-subj": "syntaxTab", "id": "syntax", "name": "Syntax", @@ -23,7 +23,7 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` tabs={ Array [ Object { - "content": , + "content": , "data-test-subj": "syntaxTab", "id": "syntax", "name": "Syntax", diff --git a/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap b/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap index c58cab79fdc4..0f0788999876 100644 --- a/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap +++ b/src/legacy/ui/public/query_bar/components/__snapshots__/language_switcher.test.tsx.snap @@ -47,9 +47,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = ` >

    { + return { + getBasePath: () => `foo`, + getUiSettingsClient: () => { + return { + get: (key: string) => { + switch (key) { + case 'history:limit': + return 10; + default: + throw new Error(`Unexpected config key: ${key}`); + } + }, + }; + }, + }; +}); + +export const mockPersistedLog = { + add: jest.fn(), + get: jest.fn(() => ['response:200']), +}; + +export const mockPersistedLogFactory = jest.fn, any>(() => { + return mockPersistedLog; +}); + +export const mockGetAutocompleteSuggestions = jest.fn(() => Promise.resolve([])); +const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions); +export const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider); + +jest.mock('ui/chrome', () => mockChromeFactory()); +jest.mock('../../chrome', () => mockChromeFactory()); +jest.mock('ui/persisted_log', () => ({ + PersistedLog: mockPersistedLogFactory, +})); +jest.mock('../../metadata', () => ({ + metadata: { + branch: 'foo', + }, +})); +jest.mock('../../autocomplete_providers', () => ({ + getAutocompleteProvider: mockGetAutocompleteProvider, +})); + +import _ from 'lodash'; +// Using doMock to avoid hoisting so that I can override only the debounce method in lodash +jest.doMock('lodash', () => ({ + ..._, + debounce: (func: () => any) => func, +})); diff --git a/src/legacy/ui/public/query_bar/components/query_bar.test.tsx b/src/legacy/ui/public/query_bar/components/query_bar.test.tsx index fdcfb7704391..f6947574bee1 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.test.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.test.tsx @@ -17,57 +17,12 @@ * under the License. */ -const mockChromeFactory = jest.fn(() => { - return { - getBasePath: () => `foo`, - getUiSettingsClient: () => { - return { - get: (key: string) => { - switch (key) { - case 'history:limit': - return 10; - default: - throw new Error(`Unexpected config key: ${key}`); - } - }, - }; - }, - }; -}); - -const mockPersistedLog = { - add: jest.fn(), - get: jest.fn(() => ['response:200']), -}; - -const mockPersistedLogFactory = jest.fn, any>(() => { - return mockPersistedLog; -}); - -const mockGetAutocompleteSuggestions = jest.fn(() => Promise.resolve([])); -const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions); -const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider); - -jest.mock('ui/chrome', () => mockChromeFactory()); -jest.mock('../../chrome', () => mockChromeFactory()); -jest.mock('ui/persisted_log', () => ({ - PersistedLog: mockPersistedLogFactory, -})); -jest.mock('../../metadata', () => ({ - metadata: { - branch: 'foo', - }, -})); -jest.mock('../../autocomplete_providers', () => ({ - getAutocompleteProvider: mockGetAutocompleteProvider, -})); - -import _ from 'lodash'; -// Using doMock to avoid hoisting so that I can override only the debounce method in lodash -jest.doMock('lodash', () => ({ - ..._, - debounce: (func: () => any) => func, -})); +import { + mockGetAutocompleteProvider, + mockGetAutocompleteSuggestions, + mockPersistedLog, + mockPersistedLogFactory, +} from 'ui/query_bar/components/query_bar.test.mocks'; import { EuiFieldText } from '@elastic/eui'; import React from 'react'; diff --git a/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap b/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap index 6388a57832c0..3b51c1db50d0 100644 --- a/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap +++ b/src/legacy/ui/public/query_bar/components/typeahead/__snapshots__/suggestions_component.test.tsx.snap @@ -16,7 +16,7 @@ exports[`SuggestionsComponent Passing the index should control which suggestion onScroll={[Function]} role="listbox" > - - - - @@ -207,8 +203,7 @@ exports[`should enable saved object export option when objectId is provided 1`] aria-label="Info" content={ diff --git a/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts b/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts new file mode 100644 index 000000000000..815d2f09150c --- /dev/null +++ b/src/legacy/ui/public/utils/subscribe_with_scope.test.mocks.ts @@ -0,0 +1,23 @@ +/* + * 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 const mockFatalError = jest.fn(); +jest.mock('ui/notify/fatal_error', () => ({ + fatalError: mockFatalError, +})); diff --git a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts index a5a3312bad4b..077875c5ac6e 100644 --- a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts +++ b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts @@ -16,11 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -const mockFatalError = jest.fn(); -jest.mock('ui/notify/fatal_error', () => ({ - fatalError: mockFatalError, -})); +import { mockFatalError } from './subscribe_with_scope.test.mocks'; import * as Rx from 'rxjs'; import { subscribeWithScope } from './subscribe_with_scope'; diff --git a/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts b/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts index 3e7623b6c25f..ab57153755c9 100644 --- a/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts +++ b/src/legacy/ui/public/vis/editors/default/agg_param_editor_props.ts @@ -20,11 +20,13 @@ import { AggParam } from '../../../agg_types'; import { AggConfig } from '../../agg_config'; -interface AggParamEditorProps { +// NOTE: we cannot export the interface with export { InterfaceName } +// as there is currently a bug on babel typescript transform plugin for it +// https://github.com/babel/babel/issues/7641 +// +export interface AggParamEditorProps { agg: AggConfig; aggParam: AggParam; value: T; setValue(value: T): void; } - -export { AggParamEditorProps }; diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts new file mode 100644 index 000000000000..6adea30c94fb --- /dev/null +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.mocks.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ + +jest.useFakeTimers(); + +import { EventEmitter } from 'events'; + +jest.mock('ui/notify', () => ({ + toastNotifications: jest.fn(), +})); + +jest.mock('./utils', () => ({ + queryGeohashBounds: jest.fn(), +})); + +jest.mock('./pipeline_helpers/utilities', () => ({ + getFormat: jest.fn(), + getTableAggs: jest.fn(), +})); + +export const timefilter = new EventEmitter(); +jest.doMock('../../timefilter', () => ({ timefilter })); + +jest.mock('../../inspector', () => ({ + Inspector: { + open: jest.fn(), + isAvailable: jest.fn(), + }, +})); + +export const mockDataLoaderFetch = jest.fn().mockReturnValue({ + as: 'visualization', + value: { + visType: 'histogram', + visData: {}, + visConfig: {}, + params: {}, + }, +}); +const MockDataLoader = class { + public async fetch(data: any) { + return await mockDataLoaderFetch(data); + } +}; + +jest.mock('./pipeline_data_loader', () => ({ + PipelineDataLoader: MockDataLoader, +})); +jest.mock('./visualize_data_loader', () => ({ + VisualizeDataLoader: MockDataLoader, +})); diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts index 3dc39ba7e2a9..e5a4eb122dc8 100644 --- a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.test.ts @@ -16,61 +16,13 @@ * specific language governing permissions and limitations * under the License. */ - -jest.useFakeTimers(); - -import { EventEmitter } from 'events'; +import { mockDataLoaderFetch, timefilter } from './embedded_visualize_handler.test.mocks'; // @ts-ignore import MockState from '../../../../../fixtures/mock_state'; import { RequestHandlerParams, Vis } from '../../vis'; import { VisResponseData } from './types'; -jest.mock('ui/notify', () => ({ - toastNotifications: jest.fn(), -})); - -jest.mock('./utils', () => ({ - queryGeohashBounds: jest.fn(), -})); - -jest.mock('./pipeline_helpers/utilities', () => ({ - getFormat: jest.fn(), - getTableAggs: jest.fn(), -})); - -const timefilter = new EventEmitter(); -jest.mock('../../timefilter', () => ({ timefilter })); - -jest.mock('../../inspector', () => ({ - Inspector: { - open: jest.fn(), - isAvailable: jest.fn(), - }, -})); - -const mockDataLoaderFetch = jest.fn().mockReturnValue({ - as: 'visualization', - value: { - visType: 'histogram', - visData: {}, - visConfig: {}, - params: {}, - }, -}); -const MockDataLoader = class { - public async fetch(data: any) { - return await mockDataLoaderFetch(data); - } -}; - -jest.mock('./pipeline_data_loader', () => ({ - PipelineDataLoader: MockDataLoader, -})); -jest.mock('./visualize_data_loader', () => ({ - VisualizeDataLoader: MockDataLoader, -})); - import { Inspector } from '../../inspector'; import { EmbeddedVisualizeHandler } from './embedded_visualize_handler'; diff --git a/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts b/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts index fe9a36a0e5a6..3617c77e42b0 100644 --- a/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts +++ b/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts @@ -31,7 +31,7 @@ import { fieldFormats } from '../../../registry/field_formats'; const config = chrome.getUiSettingsClient(); const defaultFormat = { convert: identity }; -const getConfig = (...args: any[]): any => (config.get as any)(...args); +const getConfig = (...args: any[]): any => config.get(...args); const getFieldFormat = (id: string, params: object) => { const Format = fieldFormats.byId[id]; diff --git a/src/legacy/ui/ui_bundles/app_entry_template.js b/src/legacy/ui/ui_bundles/app_entry_template.js index 2d92dc30556f..625ce5e381d2 100644 --- a/src/legacy/ui/ui_bundles/app_entry_template.js +++ b/src/legacy/ui/ui_bundles/app_entry_template.js @@ -33,7 +33,7 @@ import 'dll/set_csp_nonce'; __webpack_nonce__ = window.__kbnNonce__; // import global polyfills -import 'babel-polyfill'; +import '@babel/polyfill'; import 'custom-event-polyfill'; import 'whatwg-fetch'; import 'abortcontroller-polyfill'; diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index b260f57df331..bb130e386950 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -123,10 +123,6 @@ export default class BaseOptimizer { BABEL_PRESET_PATH ]; - const nonDistributableOnlyModules = !IS_KIBANA_DISTRIBUTABLE - ? ['ts-loader'] - : []; - threadLoader.warmup( // pool options, like passed to loader options // must match loader options to boot the correct pool @@ -134,7 +130,6 @@ export default class BaseOptimizer { [ // modules to load on the pool ...baseModules, - ...nonDistributableOnlyModules ] ); } @@ -368,7 +363,7 @@ export default class BaseOptimizer { } }, { - resource: createSourceFileResourceSelector(/\.js$/), + resource: createSourceFileResourceSelector(/\.(js|tsx?)$/), use: maybeAddCacheLoader('babel', [ { loader: 'thread-loader', @@ -394,7 +389,7 @@ export default class BaseOptimizer { }, resolve: { - extensions: ['.js', '.json'], + extensions: ['.js', '.ts', '.tsx', '.json'], mainFields: ['browser', 'browserify', 'main'], modules: [ 'webpackShims', @@ -429,47 +424,6 @@ export default class BaseOptimizer { ] }; - // when running from source transpile TypeScript automatically - const getSourceConfig = () => { - // dev/typescript is deleted from the distributable, so only require it if we actually need the source config - const { Project } = require('../dev/typescript'); - const browserProject = new Project(fromRoot('tsconfig.browser.json')); - - return { - module: { - rules: [ - { - resource: createSourceFileResourceSelector(/\.tsx?$/), - use: maybeAddCacheLoader('typescript', [ - { - loader: 'thread-loader', - options: this.getThreadLoaderPoolConfig() - }, - { - loader: 'ts-loader', - options: { - happyPackMode: true, - transpileOnly: true, - experimentalWatchApi: true, - onlyCompileBundledFiles: true, - configFile: fromRoot('tsconfig.json'), - compilerOptions: { - ...browserProject.config.compilerOptions, - sourceMap: Boolean(this.sourceMaps), - } - } - } - ]), - } - ] - }, - - resolve: { - extensions: ['.ts', '.tsx'], - }, - }; - }; - // We need to add react-addons (and a few other bits) for enzyme to work. // https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md const supportEnzymeConfig = { @@ -516,7 +470,7 @@ export default class BaseOptimizer { commonConfig, IS_KIBANA_DISTRIBUTABLE ? isDistributableConfig - : getSourceConfig(), + : {}, this.uiBundles.isDevMode() ? webpackMerge(watchingConfig, supportEnzymeConfig) : productionConfig diff --git a/src/optimize/watch/watch_cache.ts b/src/optimize/watch/watch_cache.ts index 01afed1b2640..ab11a8c5d2f1 100644 --- a/src/optimize/watch/watch_cache.ts +++ b/src/optimize/watch/watch_cache.ts @@ -95,16 +95,7 @@ export class WatchCache { await del(this.statePath, { force: true }); // delete everything in optimize/.cache directory - // except ts-node - await del( - await globby( - [ - normalizePosixPath(this.cachePath), - `${normalizePosixPath(`!${this.cachePath}/ts-node/**`)}`, - ], - { dot: true } - ) - ); + await del(await globby([normalizePosixPath(this.cachePath)], { dot: true })); // delete some empty folder that could be left // from the previous cache path reset action diff --git a/src/setup_node_env/babel_register/index.js b/src/setup_node_env/babel_register/index.js index 44b9427ed8e3..1574be8937a2 100644 --- a/src/setup_node_env/babel_register/index.js +++ b/src/setup_node_env/babel_register/index.js @@ -17,16 +17,6 @@ * under the License. */ -// unless we are running a prebuilt/distributable version of -// kibana, automatically transpile typescript to js before babel -if (!global.__BUILT_WITH_BABEL__) { - var resolve = require('path').resolve; - require('ts-node').register({ - transpileOnly: true, - cacheDirectory: resolve(__dirname, '../../../optimize/.cache/ts-node') - }); -} - // register and polyfill need to happen in this // order and in separate files. Checkout each file // for a much more detailed explanation diff --git a/src/setup_node_env/babel_register/polyfill.js b/src/setup_node_env/babel_register/polyfill.js index e72a2eff001a..4e92583f830e 100644 --- a/src/setup_node_env/babel_register/polyfill.js +++ b/src/setup_node_env/babel_register/polyfill.js @@ -17,13 +17,13 @@ * under the License. */ -// `babel-preset-env` looks for and rewrites the following import +// `@babel/preset-env` looks for and rewrites the following import // statement into a list of import statements based on the polyfills // necessary for our target environment (the current version of node) -// but since it does that during compilation, `import 'babel-polyfill'` -// must be in a file that is loaded with `require()` AFTER `babel-register` +// but since it does that during compilation, `import '@babel/polyfill'` +// must be in a file that is loaded with `require()` AFTER `@babel/register` // is configured. // // This is why we have this single statement in it's own file and require // it from ./index.js -require('babel-polyfill'); +require('@babel/polyfill'); diff --git a/src/setup_node_env/babel_register/register.js b/src/setup_node_env/babel_register/register.js index f0898b245fb0..37e39d4685ca 100644 --- a/src/setup_node_env/babel_register/register.js +++ b/src/setup_node_env/babel_register/register.js @@ -19,13 +19,13 @@ var resolve = require('path').resolve; -// this must happen before `require('babel-register')` and can't be changed +// this must happen before `require('@babel/register')` and can't be changed // once the module has been loaded if (!process.env.BABEL_CACHE_PATH) { process.env.BABEL_CACHE_PATH = resolve(__dirname, '../../../optimize/.babelcache.json'); } -// paths that babel-register should ignore +// paths that @babel/register should ignore var ignore = [ /\/bower_components\//, /\/kbn-pm\/dist\//, @@ -48,10 +48,10 @@ var ignore = [ if (global.__BUILT_WITH_BABEL__) { // when building the Kibana source we replace the statement // `global.__BUILT_WITH_BABEL__` with the value `true` so that - // when babel-register is required for the first time by users + // when @babel/register is required for the first time by users // it will exclude kibana's `src` directory. // - // We still need babel-register for plugins though, we've been + // We still need @babel/register for plugins though, we've been // building their server code at require-time since version 4.2 // TODO: the plugin install process could transpile plugin server code... ignore.push(resolve(__dirname, '../../../src')); @@ -66,10 +66,11 @@ if (global.__BUILT_WITH_BABEL__) { // modifies all future calls to require() to automatically // compile the required source with babel -require('babel-register')({ +require('@babel/register')({ ignore, babelrc: false, presets: [ require.resolve('@kbn/babel-preset/node_preset') ], + extensions: ['.js', '.ts', '.tsx'], }); diff --git a/x-pack/dev-tools/jest/create_jest_config.js b/x-pack/dev-tools/jest/create_jest_config.js index bf20e8833378..ad5b2fde1acf 100644 --- a/x-pack/dev-tools/jest/create_jest_config.js +++ b/x-pack/dev-tools/jest/create_jest_config.js @@ -37,8 +37,7 @@ export function createJestConfig({ '**/*.test.{js,ts,tsx}' ], transform: { - '^.+\\.js$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`, - '^.+\\.tsx?$': `${kibanaDirectory}/src/dev/jest/ts_transform.js`, + '^.+\\.(js|tsx?)$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`, }, transformIgnorePatterns: [ '[/\\\\]node_modules[/\\\\].+\\.js$' diff --git a/x-pack/package.json b/x-pack/package.json index 2ad347a2d728..7655ffdefdcc 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -74,11 +74,11 @@ "ansi-colors": "^3.0.5", "ansicolors": "0.3.2", "axios": "^0.18.0", - "babel-jest": "^23.6.0", - "babel-plugin-inline-react-svg": "^0.5.4", - "babel-plugin-mock-imports": "^0.0.5", - "babel-plugin-require-context-hook": "^1.0.0", - "babel-plugin-transform-react-remove-prop-types": "^0.4.14", + "babel-jest": "^24.1.0", + "babel-plugin-inline-react-svg": "^1.0.1", + "babel-plugin-mock-imports": "^1.0.1", + "babel-plugin-require-context-hook": "npm:babel-plugin-require-context-hook-babel7@^1.0.0", + "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "chalk": "^2.4.1", "chance": "1.0.10", "checksum": "0.1.1", @@ -128,13 +128,16 @@ "supertest-as-promised": "^4.0.2", "tmp": "0.0.31", "tree-kill": "^1.1.0", - "ts-loader": "^5.2.2", "typescript": "^3.3.3333", "vinyl-fs": "^3.0.2", "xml-crypto": "^0.10.1", "yargs": "4.8.1" }, "dependencies": { + "@babel/core": "^7.3.4", + "@babel/polyfill": "^7.2.5", + "@babel/register": "^7.0.0", + "@babel/runtime": "^7.3.4", "@elastic/datemath": "5.0.2", "@elastic/eui": "9.5.0", "@elastic/node-crypto": "0.1.2", @@ -160,11 +163,6 @@ "apollo-server-errors": "^2.0.2", "apollo-server-hapi": "^1.3.6", "axios": "^0.18.0", - "babel-core": "^6.26.3", - "babel-polyfill": "6.20.0", - "babel-preset-es2015": "^6.24.1", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", "base64-js": "^1.2.1", "bluebird": "3.5.3", "boom": "^7.2.0", diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx index ed5c609cb900..12198b1a870d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx @@ -15,8 +15,6 @@ import { DiscoverErrorLink } from '../DiscoverErrorLink'; import { DiscoverSpanLink } from '../DiscoverSpanLink'; import { DiscoverTransactionLink } from '../DiscoverTransactionLink'; -// NOTE: jest.mock() is broken in TS test files (b/c of ts-jest, I think) -// but using jest's "spies can be stubbed" feature, this works: jest .spyOn(savedObjects, 'getAPMIndexPattern') .mockReturnValue( diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx b/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx index 47cffde62612..61d2fcf02665 100644 --- a/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/__test__/tabConfig.test.tsx @@ -4,18 +4,33 @@ * you may not use this file except in compliance with the Elastic License. */ +jest.mock('../tabConfigConst', () => { + return { + TAB_CONFIG: [ + { + key: 'testProperty', + label: 'testPropertyLabel', + required: false, + presortedKeys: ['name', 'age'] + }, + { + key: 'optionalProperty', + label: 'optionalPropertyLabel', + required: false + }, + { + key: 'requiredProperty', + label: 'requiredPropertyLabel', + required: true + } + ] + }; +}); + import * as propertyConfig from '../tabConfig'; const { getTabsFromObject, sortKeysByConfig } = propertyConfig; describe('tabConfig', () => { - beforeEach(() => { - mockPropertyConfig(); - }); - - afterEach(() => { - unMockPropertyConfig(); - }); - describe('getTabsFromObject', () => { it('should return selected and required keys only', () => { const expectedTabs = [ @@ -64,31 +79,3 @@ describe('tabConfig', () => { }); }); }); - -function mockPropertyConfig() { - // @ts-ignore - propertyConfig.TAB_CONFIG = [ - { - key: 'testProperty', - label: 'testPropertyLabel', - required: false, - presortedKeys: ['name', 'age'] - }, - { - key: 'optionalProperty', - label: 'optionalPropertyLabel', - required: false - }, - { - key: 'requiredProperty', - label: 'requiredPropertyLabel', - required: true - } - ]; -} - -const originalPropertyConfig = propertyConfig.TAB_CONFIG; -function unMockPropertyConfig() { - // @ts-ignore - propertyConfig.TAB_CONFIG = originalPropertyConfig; -} diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts index cb9ce7f8538b..2648c2875cd8 100644 --- a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfig.ts @@ -4,28 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; import { get, indexBy, uniq } from 'lodash'; import { first, has } from 'lodash'; import { StringMap } from 'x-pack/plugins/apm/typings/common'; import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/ui/APMError'; import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/ui/Transaction'; - -export type PropertyTabKey = - | keyof Transaction - | keyof APMError - | 'transaction.custom' - | 'error.custom'; - -export interface PropertyTab { - key: PropertyTabKey; - label: string; -} - -interface TabConfig extends PropertyTab { - required: boolean; - presortedKeys: string[]; -} +import { + PropertyTab, + PropertyTabKey, + TAB_CONFIG, + TabConfig +} from './tabConfigConst'; export function getTabsFromObject(obj: Transaction | APMError): PropertyTab[] { return TAB_CONFIG.filter( @@ -53,96 +42,4 @@ export function getCurrentTab( return selectedTab ? selectedTab : first(tabs) || {}; } -export const TAB_CONFIG: TabConfig[] = [ - { - key: 'http', - label: i18n.translate('xpack.apm.propertiesTable.tabs.httpLabel', { - defaultMessage: 'HTTP' - }), - required: false, - presortedKeys: [] - }, - { - key: 'host', - label: i18n.translate('xpack.apm.propertiesTable.tabs.hostLabel', { - defaultMessage: 'Host' - }), - required: false, - presortedKeys: ['hostname', 'architecture', 'platform'] - }, - { - key: 'service', - label: i18n.translate('xpack.apm.propertiesTable.tabs.serviceLabel', { - defaultMessage: 'Service' - }), - required: false, - presortedKeys: ['runtime', 'framework', 'version'] - }, - { - key: 'process', - label: i18n.translate('xpack.apm.propertiesTable.tabs.processLabel', { - defaultMessage: 'Process' - }), - required: false, - presortedKeys: ['pid', 'title', 'args'] - }, - { - key: 'agent', - label: i18n.translate('xpack.apm.propertiesTable.tabs.agentLabel', { - defaultMessage: 'Agent' - }), - required: false, - presortedKeys: [] - }, - { - key: 'url', - label: i18n.translate('xpack.apm.propertiesTable.tabs.urlLabel', { - defaultMessage: 'URL' - }), - required: false, - presortedKeys: [] - }, - { - key: 'container', - label: i18n.translate('xpack.apm.propertiesTable.tabs.containerLabel', { - defaultMessage: 'Container' - }), - required: false, - presortedKeys: [] - }, - { - key: 'user', - label: i18n.translate('xpack.apm.propertiesTable.tabs.userLabel', { - defaultMessage: 'User' - }), - required: true, - presortedKeys: ['id', 'username', 'email'] - }, - { - key: 'labels', - label: i18n.translate('xpack.apm.propertiesTable.tabs.labelsLabel', { - defaultMessage: 'Labels' - }), - required: true, - presortedKeys: [] - }, - { - key: 'transaction.custom', - label: i18n.translate( - 'xpack.apm.propertiesTable.tabs.transactionCustomLabel', - { - defaultMessage: 'Custom' - } - ), - required: false, - presortedKeys: [] - }, - { - key: 'error.custom', - label: i18n.translate('xpack.apm.propertiesTable.tabs.errorCustomLabel', { - defaultMessage: 'Custom' - }), - required: false, - presortedKeys: [] - } -]; +export { TAB_CONFIG, TabConfig, PropertyTab, PropertyTabKey }; diff --git a/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts new file mode 100644 index 000000000000..95c4f6da9f37 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/PropertiesTable/tabConfigConst.ts @@ -0,0 +1,119 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/ui/APMError'; +import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/ui/Transaction'; + +export type PropertyTabKey = + | keyof Transaction + | keyof APMError + | 'transaction.custom' + | 'error.custom'; + +export interface PropertyTab { + key: PropertyTabKey; + label: string; +} + +export interface TabConfig extends PropertyTab { + required: boolean; + presortedKeys: string[]; +} + +export const TAB_CONFIG: TabConfig[] = [ + { + key: 'http', + label: i18n.translate('xpack.apm.propertiesTable.tabs.httpLabel', { + defaultMessage: 'HTTP' + }), + required: false, + presortedKeys: [] + }, + { + key: 'host', + label: i18n.translate('xpack.apm.propertiesTable.tabs.hostLabel', { + defaultMessage: 'Host' + }), + required: false, + presortedKeys: ['hostname', 'architecture', 'platform'] + }, + { + key: 'service', + label: i18n.translate('xpack.apm.propertiesTable.tabs.serviceLabel', { + defaultMessage: 'Service' + }), + required: false, + presortedKeys: ['runtime', 'framework', 'version'] + }, + { + key: 'process', + label: i18n.translate('xpack.apm.propertiesTable.tabs.processLabel', { + defaultMessage: 'Process' + }), + required: false, + presortedKeys: ['pid', 'title', 'args'] + }, + { + key: 'agent', + label: i18n.translate('xpack.apm.propertiesTable.tabs.agentLabel', { + defaultMessage: 'Agent' + }), + required: false, + presortedKeys: [] + }, + { + key: 'url', + label: i18n.translate('xpack.apm.propertiesTable.tabs.urlLabel', { + defaultMessage: 'URL' + }), + required: false, + presortedKeys: [] + }, + { + key: 'container', + label: i18n.translate('xpack.apm.propertiesTable.tabs.containerLabel', { + defaultMessage: 'Container' + }), + required: false, + presortedKeys: [] + }, + { + key: 'user', + label: i18n.translate('xpack.apm.propertiesTable.tabs.userLabel', { + defaultMessage: 'User' + }), + required: true, + presortedKeys: ['id', 'username', 'email'] + }, + { + key: 'labels', + label: i18n.translate('xpack.apm.propertiesTable.tabs.labelsLabel', { + defaultMessage: 'Labels' + }), + required: true, + presortedKeys: [] + }, + { + key: 'transaction.custom', + label: i18n.translate( + 'xpack.apm.propertiesTable.tabs.transactionCustomLabel', + { + defaultMessage: 'Custom' + } + ), + required: false, + presortedKeys: [] + }, + { + key: 'error.custom', + label: i18n.translate('xpack.apm.propertiesTable.tabs.errorCustomLabel', { + defaultMessage: 'Custom' + }), + required: false, + presortedKeys: [] + } +]; diff --git a/x-pack/plugins/canvas/.storybook/webpack.config.js b/x-pack/plugins/canvas/.storybook/webpack.config.js index b52a4020c592..39e33c9613e4 100644 --- a/x-pack/plugins/canvas/.storybook/webpack.config.js +++ b/x-pack/plugins/canvas/.storybook/webpack.config.js @@ -17,7 +17,7 @@ module.exports = (_baseConfig, _env, config) => { include: /\.storybook/, loaders: 'babel-loader', options: { - presets: [require.resolve('babel-preset-react')], + presets: [require.resolve('@babel/preset-react')], }, }, ); diff --git a/x-pack/plugins/canvas/public/components/workpad_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/index.js index adc6bae7418a..7a408de33583 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_page/index.js @@ -41,6 +41,7 @@ const mapDispatchToProps = dispatch => { }; }; +// eslint-disable-next-line const getRootElementId = (lookup, id) => { if (!lookup.has(id)) { return null; diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js index 6e93f9eb5fb4..d62fbe21fa0f 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js @@ -436,6 +436,7 @@ export const applyLocalTransforms = (shapes, transformIntents) => { return shapes.map(shapeApplyLocalTransforms(transformIntents)); }; +// eslint-disable-next-line const getUpstreamTransforms = (shapes, shape) => shape.parent ? getUpstreamTransforms(shapes, shapes.find(s => s.id === shape.parent)).concat([ diff --git a/x-pack/plugins/canvas/tasks/helpers/babelhook.js b/x-pack/plugins/canvas/tasks/helpers/babelhook.js index 4a48d09449b2..dea18db918fc 100644 --- a/x-pack/plugins/canvas/tasks/helpers/babelhook.js +++ b/x-pack/plugins/canvas/tasks/helpers/babelhook.js @@ -5,7 +5,7 @@ */ const { resolve } = require('path'); -const register = require('babel-register'); +const register = require('@babel/register'); const options = { babelrc: false, presets: [require.resolve('@kbn/babel-preset/node_preset')], diff --git a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js index 091e692d0bbd..caeb73c3bf79 100644 --- a/x-pack/plugins/infra/scripts/generate_types_from_graphql.js +++ b/x-pack/plugins/infra/scripts/generate_types_from_graphql.js @@ -28,7 +28,6 @@ async function main() { config: SERVER_CONFIG_PATH, out: OUTPUT_INTROSPECTION_PATH, overwrite: true, - require: ['ts-node/register'], schema: SCHEMA_PATH, template: 'graphql-codegen-introspection-template', }, diff --git a/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap b/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap index 8b7d26d3c755..327a8dc4fee4 100644 --- a/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap +++ b/x-pack/plugins/ml/public/components/form_label/__snapshots__/form_label.test.js.snap @@ -6,7 +6,7 @@ exports[`FormLabel Basic initialization 1`] = ` className="euiFormLabel" id="ml_aria_label_undefined" /> - @@ -20,7 +20,7 @@ exports[`FormLabel Full initialization 1`] = ` > Label Text - diff --git a/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap b/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap index 7133002e495c..869e321d4a7a 100644 --- a/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap +++ b/x-pack/plugins/ml/public/components/kql_filter_bar/suggestions/__snapshots__/suggestions.test.js.snap @@ -4,7 +4,7 @@ exports[`Suggestions snapshot 1`] = ` - - - + - + diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap index d6db223edc13..2ab3c6b3aa7b 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap @@ -286,7 +286,7 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh isCollectionIntervalUpdating={true} property="xpack.monitoring.collection.interval" > - + - + @@ -609,7 +609,7 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect isCollectionIntervalUpdating={false} property="xpack.monitoring.collection.interval" > - + - + diff --git a/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts b/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts new file mode 100644 index 000000000000..7f1392cb2a49 --- /dev/null +++ b/x-pack/plugins/reporting/public/components/report_info_button.test.mocks.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export const mockJobQueueClient = { getInfo: jest.fn() }; +jest.mock('../lib/job_queue_client', () => ({ jobQueueClient: mockJobQueueClient })); diff --git a/x-pack/plugins/reporting/public/components/report_info_button.test.tsx b/x-pack/plugins/reporting/public/components/report_info_button.test.tsx index 93ceed0f64a0..3b9c2a848542 100644 --- a/x-pack/plugins/reporting/public/components/report_info_button.test.tsx +++ b/x-pack/plugins/reporting/public/components/report_info_button.test.tsx @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -const mockJobQueueClient = { getInfo: jest.fn() }; -jest.mock('../lib/job_queue_client', () => ({ jobQueueClient: mockJobQueueClient })); +import { mockJobQueueClient } from './report_info_button.test.mocks'; import React from 'react'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; diff --git a/x-pack/plugins/reporting/public/components/report_listing.tsx b/x-pack/plugins/reporting/public/components/report_listing.tsx index 262362a1e5a5..56f0e382d23a 100644 --- a/x-pack/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/plugins/reporting/public/components/report_listing.tsx @@ -23,7 +23,7 @@ import { ReportErrorButton } from './report_error_button'; import { ReportInfoButton } from './report_info_button'; import { - EuiBasicTable, + EuiBasicTable as EuiBasicTableTyped, EuiButtonIcon, EuiPageContent, EuiSpacer, @@ -296,7 +296,7 @@ class ReportListingUi extends Component { }; return ( - ; } -import { EuiButton, EuiCopy, EuiForm, EuiFormRow, EuiSpacer, EuiText } from '@elastic/eui'; +import { + EuiButton, + EuiCopy as EuiCopyTyped, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiText, +} from '@elastic/eui'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import React, { Component, ReactElement } from 'react'; import { KFetchError } from 'ui/kfetch/kfetch_error'; @@ -131,7 +138,7 @@ class ReportingPanelContentUi extends Component { - @@ -143,7 +150,7 @@ class ReportingPanelContentUi extends Component { /> )} - + ); } diff --git a/x-pack/plugins/searchprofiler/README.md b/x-pack/plugins/searchprofiler/README.md index 54bbd1203235..1dec1bb4e545 100644 --- a/x-pack/plugins/searchprofiler/README.md +++ b/x-pack/plugins/searchprofiler/README.md @@ -19,7 +19,7 @@ If you have installed this somewhere other than via x-plugins, and next to the k To run the server tests, change into `x-plugins/kibana` and run: ```bash -mocha --debug --compilers js:babel/register plugins/profiler/**/__tests__/**/*.js +mocha --debug --compilers js:@babel/register plugins/profiler/**/__tests__/**/*.js ``` diff --git a/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap b/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap index 5c38e3f28c4d..19dacf984f5d 100644 --- a/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap +++ b/x-pack/plugins/security/public/views/management/edit_role/components/privileges/kibana/__snapshots__/privilege_callout_warning.test.tsx.snap @@ -179,9 +179,7 @@ exports[`PrivilegeCalloutWarning renders without crashing 1`] = ` >

    - grants full access to all - spaces. To customize privileges for individual spaces, the minimum privilege must be - either + grants full access to all spaces. To customize privileges for individual spaces, the minimum privilege must be either renders without crashing 1`] = ` >

    with user profile disabling "manageSpaces" re

    { const subject = buildPrivilegeMap; it('should produce an object of the expected form', () => { - const getSavedObjectAction = sinon.fake((t: any, a: any) => { + const getSavedObjectAction = sinon.fake((t, a) => { if (!t || !isString(t)) { throw new Error('type is required and must be a string'); } diff --git a/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap b/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap index da0f3ed3558e..9b6336ad6444 100644 --- a/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap +++ b/x-pack/plugins/spaces/public/components/__snapshots__/space_avatar.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`removes aria-label when instructed not to announce the space name 1`] = ` - - + `; exports[`renders with a space name entirely made of whitespace 1`] = ` diff --git a/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap b/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap index 42da3769ac8e..5b3b0cede89a 100644 --- a/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap +++ b/x-pack/plugins/spaces/public/views/management/components/advanced_settings_title/__snapshots__/advanced_settings_title.test.tsx.snap @@ -9,7 +9,7 @@ exports[`AdvancedSettingsTitle renders as expected 1`] = ` - - - , - , + - , - , + - , + , ] `; diff --git a/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap b/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap index 00c49341ce0e..265dcc349e1b 100644 --- a/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap +++ b/x-pack/plugins/spaces/public/views/nav_control/__snapshots__/nav_control_popover.test.tsx.snap @@ -6,7 +6,7 @@ exports[`NavControlPopover renders without crashing 1`] = ` button={ - - - diff --git a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap index 3a726b70fc9e..170d668a027a 100644 --- a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap +++ b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/checklist_step.test.tsx.snap @@ -17,16 +17,14 @@ exports[`ChecklistFlyout renders 1`] = ` >

    @@ -45,7 +43,7 @@ exports[`ChecklistFlyout renders 1`] = ` />

    - { ); expect(wrapper).toMatchInlineSnapshot(` - { ); expect(wrapper).toMatchInlineSnapshot(` - ({ + create: jest.fn().mockReturnValue(mockClient), +})); diff --git a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts index f15927c0d6a3..9f47f51bc8cd 100644 --- a/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts +++ b/x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/polling_service.test.ts @@ -4,25 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { mockClient } from './polling_service.test.mocks'; + import { ReindexStatus, ReindexStep } from '../../../../../../common/types'; - -const mockClient = { - post: jest.fn().mockResolvedValue({ - lastCompletedStep: ReindexStep.created, - status: ReindexStatus.inProgress, - }), - get: jest.fn().mockResolvedValue({ - status: 200, - data: { - warnings: [], - reindexOp: null, - }, - }), -}; -jest.mock('axios', () => ({ - create: jest.fn().mockReturnValue(mockClient), -})); - import { ReindexPollingService } from './polling_service'; describe('ReindexPollingService', () => { diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts index 9d37fec650b7..1b19db8a378e 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts @@ -7,7 +7,7 @@ import { CallCluster, CallClusterWithRequest } from 'src/legacy/core_plugins/ela import { Request, Server } from 'src/legacy/server/kbn_server'; import { SavedObjectsClient } from 'src/legacy/server/saved_objects'; -import moment = require('moment'); +import moment from 'moment'; import { XPackInfo } from 'x-pack/plugins/xpack_main/server/lib/xpack_info'; import { ReindexSavedObject, ReindexStatus } from '../../../common/types'; import { CredentialStore } from './credential_store'; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap index 717cb187623a..030b03f1c75a 100644 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap @@ -111,7 +111,7 @@ exports[`Snapshot component renders without errors 1`] = ` } } > - - - - + + `; exports[`EmptyState component renders child components when count is truthy 1`] = ` @@ -268,7 +268,7 @@ exports[`EmptyState component renders child components when count is truthy 1`] `; exports[`EmptyState component renders empty state with appropriate base path 1`] = ` - - - - + + `; exports[`EmptyState component renders message while loading 1`] = ` - - + - - + + `; exports[`EmptyState component renders the message when an error occurs 1`] = ` - - - - + + `; diff --git a/x-pack/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/plugins/uptime/scripts/infer_graphql_types.js index c4b87c9ea933..104fd5b66b5d 100644 --- a/x-pack/plugins/uptime/scripts/infer_graphql_types.js +++ b/x-pack/plugins/uptime/scripts/infer_graphql_types.js @@ -20,7 +20,6 @@ async function main() { config: CONFIG_PATH, out: OUTPUT_INTROSPECTION_PATH, overwrite: true, - require: ['ts-node/register'], schema: SCHEMA_PATH, template: 'graphql-codegen-introspection-template', }, diff --git a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts new file mode 100644 index 000000000000..36f76516e188 --- /dev/null +++ b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.mocks.ts @@ -0,0 +1,28 @@ +/* + * 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 { Readable } from 'stream'; + +jest.doMock('fs', () => ({ + createReadStream(filepath: string): Readable { + if (filepath === 'ERROR') { + throw new Error('MOCK ERROR - Invalid Path'); + } + const readableStream = new Readable(); + const streamData = filepath.split(''); + let cursor = 0; + + readableStream._read = function(size) { + const current = streamData[cursor++]; + if (typeof current === 'undefined') { + return this.push(null); + } + this.push(current); + }; + + return readableStream; + }, +})); diff --git a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts index 5e554cd77d84..668b0d0c2108 100644 --- a/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts +++ b/x-pack/plugins/xpack_main/server/lib/file_integrity.test.ts @@ -4,28 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Readable } from 'stream'; - -jest.mock('fs', () => ({ - createReadStream(filepath: string): Readable { - if (filepath === 'ERROR') { - throw new Error('MOCK ERROR - Invalid Path'); - } - const readableStream = new Readable(); - const streamData = filepath.split(''); - let cursor = 0; - - readableStream._read = function(size) { - const current = streamData[cursor++]; - if (typeof current === 'undefined') { - return this.push(null); - } - this.push(current); - }; - - return readableStream; - }, -})); +import './file_integrity.test.mocks'; import { getIntegrityHash, getIntegrityHashes } from './file_integrity'; diff --git a/x-pack/tasks/build.js b/x-pack/tasks/build.js index 82ccc9c75bd6..59033bb40c7d 100644 --- a/x-pack/tasks/build.js +++ b/x-pack/tasks/build.js @@ -34,7 +34,7 @@ export default (gulp, { buildTarget }) => { // As result of it, we need to move the transpiled js files for the correct folder // and in the end deleting the generated outDir from the intermediateBuildDirectory. // - //# TODO: This might be able to go away with the upgrade to babel 7 + //# TODO: This might be able to go away as soon as we upgrade the x-pack build to use babel7 await moveFiles( gulp, resolve(buildRoot, 'x-pack/build/plugin/kibana/x-pack/**/!(*.test).js'), diff --git a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json index ede03a08a272..ec63c512e9cd 100644 --- a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json +++ b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json @@ -1,4 +1,12 @@ { "name": "sample_task_plugin", - "version": "kibana" + "version": "1.0.0", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" + } } diff --git a/x-pack/test/saved_object_api_integration/common/services/es.js b/x-pack/test/saved_object_api_integration/common/services/es.js index f5ef3be4b4bd..af188ca5e397 100644 --- a/x-pack/test/saved_object_api_integration/common/services/es.js +++ b/x-pack/test/saved_object_api_integration/common/services/es.js @@ -8,9 +8,8 @@ import { format as formatUrl } from 'url'; import elasticsearch from 'elasticsearch'; import shieldPlugin from '../../../../server/lib/esjs_shield_plugin'; -import { TestInvoker } from '../lib/types'; -export function EsProvider({ getService }: TestInvoker) { +export function EsProvider({ getService }) { const config = getService('config'); return new elasticsearch.Client({ diff --git a/x-pack/test_utils/jest/config.js b/x-pack/test_utils/jest/config.js index 014c3793c585..e460c705f293 100644 --- a/x-pack/test_utils/jest/config.js +++ b/x-pack/test_utils/jest/config.js @@ -31,11 +31,6 @@ export default { coverageReporters: [ 'html', ], - globals: { - 'ts-jest': { - skipBabel: true, - }, - }, moduleFileExtensions: [ 'js', 'json', @@ -55,8 +50,7 @@ export default { 'integration_tests/' ], transform: { - '^.+\\.js$': '/../src/dev/jest/babel_transform.js', - '^.+\\.tsx?$': '/../src/dev/jest/ts_transform.js', + '^.+\\.(js|tsx?)$': '/../src/dev/jest/babel_transform.js', '^.+\\.txt?$': 'jest-raw-loader', '^.+\\.html?$': 'jest-raw-loader', }, diff --git a/yarn.lock b/yarn.lock index e15a2219367b..18dccaaa691c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,7 +35,7 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.3.4": +"@babel/core@7.3.4", "@babel/core@^7.1.0", "@babel/core@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.3.4.tgz#921a5a13746c21e32445bf0798680e9d11a6530b" integrity sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA== @@ -259,7 +259,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.3", "@babel/parser@^7.2.2", "@babel/parser@^7.3.4": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.1.3", "@babel/parser@^7.2.2", "@babel/parser@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== @@ -596,6 +596,16 @@ resolve "^1.8.1" semver "^5.5.1" +"@babel/plugin-transform-runtime@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.3.4.tgz#57805ac8c1798d102ecd75c03b024a5b3ea9b431" + integrity sha512-PaoARuztAdd5MgeVjAxnIDAIUet5KpogqaefQvPOmPYCxYoaPhautxDh3aO8a4xHsKgT/b9gSxR0BKK1MIewPA== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + resolve "^1.8.1" + semver "^5.5.1" + "@babel/plugin-transform-shorthand-properties@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" @@ -650,6 +660,14 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" +"@babel/polyfill@7.2.5", "@babel/polyfill@^7.2.5": + version "7.2.5" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d" + integrity sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug== + dependencies: + core-js "^2.5.7" + regenerator-runtime "^0.12.0" + "@babel/preset-env@^7.1.0", "@babel/preset-env@^7.3.4": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.3.4.tgz#887cf38b6d23c82f19b5135298bdb160062e33e1" @@ -726,6 +744,19 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript" "^7.3.2" +"@babel/register@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" + integrity sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g== + dependencies: + core-js "^2.5.7" + find-cache-dir "^1.0.0" + home-or-tmp "^3.0.0" + lodash "^4.17.10" + mkdirp "^0.5.1" + pirates "^4.0.0" + source-map-support "^0.5.9" + "@babel/runtime@7.0.0-beta.54": version "7.0.0-beta.54" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0-beta.54.tgz#39ebb42723fe7ca4b3e1b00e967e80138d47cadf" @@ -741,6 +772,13 @@ dependencies: regenerator-runtime "^0.12.0" +"@babel/runtime@^7.3.4": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" + integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== + dependencies: + regenerator-runtime "^0.12.0" + "@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" @@ -1606,45 +1644,45 @@ resolved "https://registry.yarnpkg.com/@types/async/-/async-2.0.49.tgz#92e33d13f74c895cb9a7f38ba97db8431ed14bc0" integrity sha512-Benr3i5odUkvpFkOpzGqrltGdbSs+EVCkEBGXbuR7uT0VzhXKIkhem6PDzHdx5EonA+rfbB3QvP6aDOw5+zp5Q== -"@types/babel-core@^6.25.5": - version "6.25.5" - resolved "https://registry.yarnpkg.com/@types/babel-core/-/babel-core-6.25.5.tgz#7598b1287c2cb5a8e9150d60e4d4a8f2dbe29982" - integrity sha512-pecvyMrc46zY0AFYXVZWNmm/gekr7f32OBYCd9baOiIpOTFtNN0ormeWpJaG7p+MEzncUvNtJdYql94dZYZGsw== - dependencies: - "@types/babel-generator" "*" - "@types/babel-template" "*" - "@types/babel-traverse" "*" - "@types/babel-types" "*" - "@types/babylon" "*" - -"@types/babel-generator@*": - version "6.25.2" - resolved "https://registry.yarnpkg.com/@types/babel-generator/-/babel-generator-6.25.2.tgz#fa13653ec2d34a4037be9c34dec32ae75bea04cc" - integrity sha512-W7PQkeDlYOqJblfNeqZARwj4W8nO+ZhQQZksU8+wbaKuHeUdIVUAdREO/Qb0FfNr3CY5Sq1gNtqsyFeZfS3iSw== - dependencies: - "@types/babel-types" "*" - -"@types/babel-template@*": - version "6.25.1" - resolved "https://registry.yarnpkg.com/@types/babel-template/-/babel-template-6.25.1.tgz#03e23a893c16bab2ec00200ab51feccf488cae78" - integrity sha512-teJYxh35PbBaf9OY6YwLSQ7pRiWRnHCHmlqwfVSfexOsqHUf6hpNZ4FG9PfgnpBM1VRzRJVQF3SqqOtkcNrBZQ== - dependencies: - "@types/babel-types" "*" - "@types/babylon" "*" - -"@types/babel-traverse@*": - version "6.25.4" - resolved "https://registry.yarnpkg.com/@types/babel-traverse/-/babel-traverse-6.25.4.tgz#269af6a25c80419b635c8fa29ae42b0d5ce2418c" - integrity sha512-+/670NaZE7qPvdh8EtGds32/2uHFKE5JeS+7ePH6nGwF8Wj8r671/RkTiJQP2k22nFntWEb9xQ11MFj7xEqI0g== - dependencies: - "@types/babel-types" "*" - "@types/babel-types@*", "@types/babel-types@^7.0.0": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/babel-types/-/babel-types-7.0.4.tgz#bfd5b0d0d1ba13e351dff65b6e52783b816826c8" integrity sha512-WiZhq3SVJHFRgRYLXvpf65XnV6ipVHhnNaNvE8yCimejrGglkg38kEj0JcizqwSHxmPSjcTlig/6JouxLGEhGw== -"@types/babylon@*", "@types/babylon@6.16.3", "@types/babylon@^6.16.2": +"@types/babel__core@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" + integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/babylon@6.16.3", "@types/babylon@^6.16.2": version "6.16.3" resolved "https://registry.yarnpkg.com/@types/babylon/-/babylon-6.16.3.tgz#c2937813a89fcb5e79a00062fc4a8b143e7237bb" integrity sha512-lyJ8sW1PbY3uwuvpOBZ9zMYKshMnQpXmeDHh8dj9j2nJm/xrW0FgB5gLSYOArj5X0IfaXnmhFoJnhS4KbqIMug== @@ -1816,10 +1854,10 @@ "@types/cheerio" "*" "@types/react" "*" -"@types/eslint@^4.16.2": - version "4.16.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.2.tgz#30f4f026019eb78a6ef12f276b75cd16ea2afb27" - integrity sha512-gCqhoFlyLic8Ux1OQt9cjlPbXk/dS7zPpofazBkie6SWCl+e1IEZBgLqyakm27nh0/uSZYW2TqkBusV9fLmztw== +"@types/eslint@^4.16.6": + version "4.16.6" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.6.tgz#96d4ecddbea618ab0b55eaf0dffedf387129b06c" + integrity sha512-GL7tGJig55FeclpOytU7nCCqtR143jBoC7AUdH0DO9xBSIFiNNUFCY/S3KNWsHeQJuU3hjw/OC1+kRTFNXqUZQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -2842,19 +2880,17 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" - integrity sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw== - dependencies: - acorn "^5.0.3" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== acorn-walk@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.0.1.tgz#c7827bdbb8e21aa97b609adfa225400d9ae348ba" integrity sha512-PqVQ8c6a3kyqdsUZlC7nljp3FFuxipBRHKu+7C1h8QygBFlzTaDX5HD383jej3Peed+1aDG8HwkfB1Z1HMNPkw== -acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.0, acorn@^5.6.2, acorn@^5.7.1: +acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.2, acorn@^5.7.1: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== @@ -2879,6 +2915,11 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + address@1.0.3, address@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" @@ -2961,7 +3002,7 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" integrity sha1-MU3QpLM2j609/NxU7eYXG4htrzw= -ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: +ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= @@ -2984,7 +3025,7 @@ ajv@^5.0.0, ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.0.1, ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.3, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.5: version "6.5.5" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1" integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg== @@ -2994,6 +3035,16 @@ ajv@^6.0.1, ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.3, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.9.1: + version "6.9.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b" + integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -3108,6 +3159,11 @@ ansi-escapes@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" integrity sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ== +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -3901,7 +3957,7 @@ axios@^0.18.0: follow-redirects "^1.3.0" is-buffer "^1.1.5" -axobject-query@^2.0.1: +axobject-query@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== @@ -3913,28 +3969,6 @@ b64@4.x.x: resolved "https://registry.yarnpkg.com/b64/-/b64-4.0.0.tgz#c37f587f0a383c7019e821120e8c3f58f0d22772" integrity sha512-EhmUQodKB0sdzPPrbIWbGqA5cQeTWxYrAgNeeT1rLZWtD3tbNTnphz8J4vkXI3cPgBNlXBjzEbzDzq0Nwi4f9A== -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -3944,60 +3978,10 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@6.26.3, babel-core@^6.26.3: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-core@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" - integrity sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g= - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.0" - debug "^2.6.8" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.7" - slash "^1.0.0" - source-map "^0.5.6" - -babel-eslint@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-9.0.0.tgz#7d9445f81ed9f60aff38115f838970df9f2b6220" - integrity sha512-itv1MwE3TMbY0QtNfeL7wzak1mV47Uy+n6HtSOO4Xd7rvmO+tsGQSgyOEEgo6Y2vHZKZphaoelNeSVj4vkLA1g== +babel-eslint@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== dependencies: "@babel/code-frame" "^7.0.0" "@babel/parser" "^7.0.0" @@ -4020,104 +4004,16 @@ babel-generator@^6.18.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-generator@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" - integrity sha1-rBriAHC3n248odMmlhMFN3TyDcU= - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.6" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-builder-react-jsx@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" - integrity sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - esutils "^2.0.2" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - babel-helper-evaluate-path@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA== -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babel-helper-flip-expressions@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" integrity sha1-NpZzahKKwYvCUlS19AoizrPB0/0= -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - babel-helper-is-nodes-equiv@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" @@ -4133,72 +4029,16 @@ babel-helper-mark-eval-scopes@^0.4.3: resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI= -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babel-helper-remove-or-void@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA= -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babel-helper-to-multiple-sequence-expressions@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-jest@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" - integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== - dependencies: - babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^23.2.0" - babel-jest@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" @@ -4209,14 +4049,15 @@ babel-jest@^24.1.0: chalk "^2.4.2" slash "^2.0.0" -babel-loader@7.1.5, babel-loader@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.5.tgz#e3ee0cd7394aa557e013b02d3e492bfd07aa6d68" - integrity sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw== +babel-loader@8.0.5, babel-loader@^8.0.5: + version "8.0.5" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" + integrity sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw== dependencies: - find-cache-dir "^1.0.0" + find-cache-dir "^2.0.0" loader-utils "^1.0.2" mkdirp "^0.5.1" + util.promisify "^1.0.0" babel-messages@^6.23.0: version "6.23.0" @@ -4225,40 +4066,24 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-add-module-exports@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" - integrity sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU= +babel-plugin-add-module-exports@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-1.0.0.tgz#72b5424d941a336c6a35357f373d8b8366263031" + integrity sha512-m0sMxPL4FaN2K69GQgaRJa4Ny15qKSdoknIcpN+gz+NaJlAW9pge/povs13tPYsKDboflrEQC+/3kfIsONBTaw== + optionalDependencies: + chokidar "^2.0.4" -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= +babel-plugin-inline-react-svg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-1.0.1.tgz#1457edae1035a12b3c5026ef28a1239edc71d2a2" + integrity sha512-vTsG/L2cUN4XRJdJ1scYXMSBlgAxkZm/tgo1Lo/FulbPADztEtVOPUNuNDeEoRHZCz9RC0ZHXdVSJ/GaqahF/Q== dependencies: - babel-runtime "^6.22.0" - -babel-plugin-inline-react-svg@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-0.5.4.tgz#bc818f351cd9d78f5b3bfa7cc1da5f83e7b4010a" - integrity sha512-Pr/J5kicFEpIvwooR3mytJWXfyGXoP4gp4QzTdN0jLoa7lU2OJVyhHMm17ekA3okxwbLaQehSc0kV/UVrj343w== - dependencies: - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babylon "^6.18.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/parser" "^7.0.0" lodash.isplainobject "^4.0.6" resolve "^1.8.1" svgo "^0.7.2" -babel-plugin-istanbul@^4.1.6: - version "4.1.6" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" - integrity sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ== - dependencies: - babel-plugin-syntax-object-rest-spread "^6.13.0" - find-up "^2.1.0" - istanbul-lib-instrument "^1.10.1" - test-exclude "^4.2.1" - babel-plugin-istanbul@^5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz#7981590f1956d75d67630ba46f0c22493588c893" @@ -4268,11 +4093,6 @@ babel-plugin-istanbul@^5.1.0: istanbul-lib-instrument "^3.0.0" test-exclude "^5.0.0" -babel-plugin-jest-hoist@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" - integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= - babel-plugin-jest-hoist@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" @@ -4360,10 +4180,10 @@ babel-plugin-minify-type-constructors@^0.4.3: dependencies: babel-helper-is-void-0 "^0.4.3" -babel-plugin-mock-imports@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/babel-plugin-mock-imports/-/babel-plugin-mock-imports-0.0.5.tgz#caa865f017d8972fe47772e0fb57f2924e5ce3c5" - integrity sha1-yqhl8BfYly/kd3Lg+1fykk5c48U= +babel-plugin-mock-imports@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-mock-imports/-/babel-plugin-mock-imports-1.0.1.tgz#1476ed4de911347d344fc81caab4beced80804b1" + integrity sha512-Nu4unCGKeqOfLlfnLPnv/pEHancdAGTqFqyArZ27gsKIiKxeZvMr87IHB8BxhMu3Bfc8fA8bx7hWt32aZbEwpQ== babel-plugin-react-docgen@^2.0.0: version "2.0.0" @@ -4373,78 +4193,10 @@ babel-plugin-react-docgen@^2.0.0: lodash "^4.17.10" react-docgen "^3.0.0-rc.1" -babel-plugin-require-context-hook@^1.0.0: +"babel-plugin-require-context-hook@npm:babel-plugin-require-context-hook-babel7@^1.0.0": version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-require-context-hook/-/babel-plugin-require-context-hook-1.0.0.tgz#3f0e7cce87c338f53639b948632fd4e73834632d" - integrity sha512-EMZD1563QUqLhzrqcThk759RhuNVX/ZJdrtGK6drwzgvnR+ARjWyXIHPbu+tUNaMGtPz/gQeAM2M6VUw2UiUeA== - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= - -babel-plugin-syntax-async-generators@^6.5.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - integrity sha1-a8lj67FuzLrmuStZbrfzXDQqi5o= - -babel-plugin-syntax-class-properties@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" - integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= - -babel-plugin-syntax-flow@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" - integrity sha1-TDqyCiryaqIM0lmVw5jE63AxDI0= - -babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - -babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - -babel-plugin-transform-async-generator-functions@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" - integrity sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-class-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" - integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= - dependencies: - babel-helper-function-name "^6.24.1" - babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-require-context-hook-babel7/-/babel-plugin-require-context-hook-babel7-1.0.0.tgz#1273d4cee7e343d0860966653759a45d727e815d" + integrity sha512-kez0BAN/cQoyO1Yu1nre1bQSYZEF93Fg7VQiBHFfMWuaZTy7vJSTT4FY68FwHTYG53Nyt0A7vpSObSVxwweQeQ== babel-plugin-transform-define@^1.3.1: version "1.3.1" @@ -4454,213 +4206,6 @@ babel-plugin-transform-define@^1.3.1: lodash "^4.17.11" traverse "0.6.6" -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" - integrity sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo= - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-flow-strip-types@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" - integrity sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988= - dependencies: - babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.22.0" - babel-plugin-transform-inline-consecutive-adds@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" @@ -4681,14 +4226,6 @@ babel-plugin-transform-minify-booleans@^6.9.4: resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg= -babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object-rest-spread@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" - babel-plugin-transform-property-literals@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" @@ -4696,49 +4233,10 @@ babel-plugin-transform-property-literals@^6.9.4: dependencies: esutils "^2.0.2" -babel-plugin-transform-react-display-name@^6.23.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" - integrity sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx-self@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" - integrity sha1-322AqdomEqEh5t3XVYvL7PBuY24= - dependencies: - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx-source@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" - integrity sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY= - dependencies: - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" - integrity sha1-hAoCjn30YN/DotKfDA2R9jduZqM= - dependencies: - babel-helper-builder-react-jsx "^6.24.1" - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-react-remove-prop-types@^0.4.14: - version "0.4.15" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.15.tgz#7ba830e77276a0e788cd58ea527b5f70396e12a7" - integrity sha512-bFxxYdkZBwTjTgtZEPTLqu9g8Ajz8x8uEP/O1iVuaZIz2RuxJ2gtx0EXDJRonC++KGsgsW/4Hqvk4KViEtE2nw== - -babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= - dependencies: - regenerator-transform "^0.10.0" +babel-plugin-transform-react-remove-prop-types@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" + integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== babel-plugin-transform-regexp-constructors@^0.4.3: version "0.4.3" @@ -4762,41 +4260,22 @@ babel-plugin-transform-remove-undefined@^0.5.0: dependencies: babel-helper-evaluate-path "^0.5.0" -babel-plugin-transform-runtime@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee" - integrity sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4= - dependencies: - babel-runtime "^6.22.0" - babel-plugin-transform-simplify-comparison-operators@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk= -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - babel-plugin-transform-undefined-to-void@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA= -babel-polyfill@6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.20.0.tgz#de4a371006139e20990aac0be367d398331204e7" - integrity sha1-3ko3EAYTniCZCqwL42fTmDMSBOc= - dependencies: - babel-runtime "^6.20.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" +babel-plugin-typescript-strip-namespaces@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-typescript-strip-namespaces/-/babel-plugin-typescript-strip-namespaces-1.1.1.tgz#160433b17e424b57cf72e3b4d8f08195ad28d7fd" + integrity sha512-dVB9caEANbEVwUylL8g3lsYU5JjaXE2KNIVLib3KVcGJF32QunxvQqP6kf+lzW/fyDed/zWD/e/hdyimyc/79Q== -babel-polyfill@6.26.0, babel-polyfill@^6.26.0: +babel-polyfill@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= @@ -4805,87 +4284,6 @@ babel-polyfill@6.26.0, babel-polyfill@^6.26.0: core-js "^2.5.0" regenerator-runtime "^0.10.5" -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - integrity sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk= - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" - -babel-preset-flow@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" - integrity sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0= - dependencies: - babel-plugin-transform-flow-strip-types "^6.22.0" - -babel-preset-jest@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" - integrity sha1-jsegOhOPABoaj7HoETZSvxpV2kY= - dependencies: - babel-plugin-jest-hoist "^23.2.0" - babel-plugin-syntax-object-rest-spread "^6.13.0" - babel-preset-jest@^24.1.0: version "24.1.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" @@ -4923,43 +4321,7 @@ babel-preset-minify@^0.5.0: babel-plugin-transform-undefined-to-void "^6.9.4" lodash.isplainobject "^4.0.6" -babel-preset-react@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" - integrity sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A= - dependencies: - babel-plugin-syntax-jsx "^6.3.13" - babel-plugin-transform-react-display-name "^6.23.0" - babel-plugin-transform-react-jsx "^6.24.1" - babel-plugin-transform-react-jsx-self "^6.22.0" - babel-plugin-transform-react-jsx-source "^6.22.0" - babel-preset-flow "^6.23.0" - -babel-preset-stage-3@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" - integrity sha1-g2raCp56f6N8sTj7kyb4eTSkg5U= - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-generator-functions "^6.24.1" - babel-plugin-transform-async-to-generator "^6.24.1" - babel-plugin-transform-exponentiation-operator "^6.24.1" - babel-plugin-transform-object-rest-spread "^6.22.0" - -babel-register@6.26.0, babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@6.x.x, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0, babel-runtime@^6.5.0: +babel-runtime@6.x.x, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0, babel-runtime@^6.5.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -4972,7 +4334,7 @@ babel-standalone@^6.26.0: resolved "https://registry.yarnpkg.com/babel-standalone/-/babel-standalone-6.26.0.tgz#15fb3d35f2c456695815ebf1ed96fe7f015b6886" integrity sha1-Ffs9NfLEVmlYFevx7Zb+fwFbaIY= -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.16.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= @@ -4983,7 +4345,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= @@ -5007,7 +4369,7 @@ babel-types@7.0.0-beta.3: lodash "^4.2.0" to-fast-properties "^2.0.0" -babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= @@ -5017,13 +4379,6 @@ babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24. lodash "^4.17.4" to-fast-properties "^1.0.3" -"babel7-plugin-add-module-exports@npm:babel-plugin-add-module-exports@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-1.0.0.tgz#72b5424d941a336c6a35357f373d8b8366263031" - integrity sha512-m0sMxPL4FaN2K69GQgaRJa4Ny15qKSdoknIcpN+gz+NaJlAW9pge/povs13tPYsKDboflrEQC+/3kfIsONBTaw== - optionalDependencies: - chokidar "^2.0.4" - babylon@7.0.0-beta.47: version "7.0.0-beta.47" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.47.tgz#6d1fa44f0abec41ab7c780481e62fd9aafbdea80" @@ -5554,14 +4909,6 @@ browserslist@4.1.1: electron-to-chromium "^1.3.62" node-releases "^1.0.0-alpha.11" -browserslist@^3.2.6: - version "3.2.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== - dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - browserslist@^4.0.1, browserslist@^4.3.4: version "4.4.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.4.1.tgz#42e828954b6b29a7a53e352277be429478a69062" @@ -5637,7 +4984,7 @@ buffer-fill@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= -buffer-from@^1.0.0, buffer-from@^1.1.0: +buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -5939,7 +5286,7 @@ caniuse-db@^1.0.30000539, caniuse-db@^1.0.30000597: resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000813.tgz#e0a1c603f8880ad787b2a35652b2733f32a5e29a" integrity sha1-4KHGA/iICteHsqNWUrJzPzKl4po= -caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000872, caniuse-lite@^1.0.30000929: +caniuse-lite@^1.0.30000872, caniuse-lite@^1.0.30000929: version "1.0.30000932" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000932.tgz#d01763e9ce77810962ca7391ff827b5949ce4272" integrity sha512-4bghJFItvzz8m0T3lLZbacmEY9X1Z2AtIzTr7s7byqZIOumASfr4ynDx7rtm0J85nDmx8vsgR6vnaSoeU8Oh0A== @@ -6176,6 +5523,11 @@ chardet@^0.5.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.5.0.tgz#fe3ac73c00c3d865ffcc02a0682e2c20b6a06029" integrity sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + checksum@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/checksum/-/checksum-0.1.1.tgz#dc6527d4c90be8560dbd1ed4cecf3297d528e9e9" @@ -6233,22 +5585,6 @@ chokidar@1.6.0: optionalDependencies: fsevents "^1.0.0" -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.3, chokidar@^2.0.4: version "2.1.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.2.tgz#9c23ea40b01638439e0513864d362aeacc5ad058" @@ -6558,11 +5894,6 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -closest-file-data@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/closest-file-data/-/closest-file-data-0.1.4.tgz#975f87c132f299d24a0375b9f63ca3fb88f72b3a" - integrity sha1-l1+HwTLymdJKA3W59jyj+4j3Kzo= - cmd-shim@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" @@ -7054,13 +6385,6 @@ convert-source-map@1.X, convert-source-map@^1.1.0, convert-source-map@^1.4.0, co resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" integrity sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU= -convert-source-map@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - convex-hull@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/convex-hull/-/convex-hull-1.0.3.tgz#20a3aa6ce87f4adea2ff7d17971c9fc1c67e1fff" @@ -7924,7 +7248,7 @@ debug@3.X, debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -8365,6 +7689,13 @@ doctrine@^2.0.0, doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + doctypes@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" @@ -8683,11 +8014,6 @@ electron-to-chromium@^1.3.103: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.108.tgz#2e79a6fcaa4b3e7c75abf871505bda8e268c910e" integrity sha512-/QI4hMpAh48a1Sea6PALGv+kuVne9A2EWGd8HrWHMdYhIzGtbhVVHh6heL5fAzGaDnZuPyrlWJRl8WPm4RyiQQ== -electron-to-chromium@^1.3.47: - version "1.3.82" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.82.tgz#7d13ae4437d2a783de3f4efba96b186c540b67b1" - integrity sha512-NI4nB2IWGcU4JVT1AE8kBb/dFor4zjLHMLsOROPahppeHrR0FG5uslxMmkp/thO1MvPjM2xhlKoY29/I60s0ew== - electron-to-chromium@^1.3.62: version "1.3.67" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.67.tgz#5e8f3ffac89b4b0402c7e1a565be06f3a109abbc" @@ -8723,10 +8049,10 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -emoji-regex@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" - integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ== +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== emojis-list@^2.0.0: version "2.1.0" @@ -8811,7 +8137,7 @@ engine.io@~3.2.0: engine.io-parser "~2.1.0" ws "~3.3.1" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: +enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== @@ -9170,14 +8496,14 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz#2c26d2cdcfa3a05f0642cd7e6e4ef3316cdabfa2" - integrity sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w== +eslint-config-prettier@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" + integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== dependencies: get-stdin "^6.0.0" -eslint-import-resolver-node@^0.3.1, eslint-import-resolver-node@^0.3.2: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -9201,62 +8527,62 @@ eslint-import-resolver-webpack@^0.10.1: resolve "^1.4.0" semver "^5.3.0" -eslint-module-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= +eslint-module-utils@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49" + integrity sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" -eslint-plugin-babel@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.2.0.tgz#3041a0c26aa3ca4a0e0f2aa11591f0396790d981" - integrity sha512-9pNH/e214SN3r2nEwwTLRI27jUN4+nuLMv1+qxfDv8Za9cJ3F+aPkNinYiVeUmAmiEtOttbS32yuwRG2DREvJg== +eslint-plugin-babel@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" + integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-import@^2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== +eslint-plugin-import@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== dependencies: contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.2.0" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.3.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.6.0" + resolve "^1.9.0" -eslint-plugin-jest@^21.26.2: - version "21.27.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz#2a795b7c3b5e707df48a953d651042bd01d7b0a8" - integrity sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw== +eslint-plugin-jest@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.3.0.tgz#a10f10dedfc92def774ec9bb5bfbd2fb8e1c96d2" + integrity sha512-P1mYVRNlOEoO5T9yTqOfucjOYf1ktmJ26NjwjH8sxpCFQa6IhBGr5TpKl3hcAAT29hOsRJVuMWmTsHoUVo9FoA== -eslint-plugin-jsx-a11y@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88" - integrity sha512-7gSSmwb3A+fQwtw0arguwMdOdzmKUgnUcbSNlo+GjKLAQFuC2EZxWqG9XHRI8VscBJD5a8raz3RuxQNFW+XJbw== +eslint-plugin-jsx-a11y@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" + integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== dependencies: aria-query "^3.0.0" array-includes "^3.0.3" ast-types-flow "^0.0.7" - axobject-query "^2.0.1" + axobject-query "^2.0.2" damerau-levenshtein "^1.0.4" - emoji-regex "^6.5.1" + emoji-regex "^7.0.2" has "^1.0.3" jsx-ast-utils "^2.0.1" -eslint-plugin-mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.2.0.tgz#d8786d9fff8cb8b5f6e4b61e40395d6568a5c4e2" - integrity sha512-4VTX/qIoxUFRnXLNm6bEhEJyfGnGagmQzV4TWXKzkZgIYyP2FSubEdCjEFTyS/dGwSVRWCWGX7jO7BK8R0kppg== +eslint-plugin-mocha@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz#cf3eb18ae0e44e433aef7159637095a7cb19b15b" + integrity sha512-3uwlJVLijjEmBeNyH60nzqgA1gacUWLUmcKV8PIGNvj1kwP/CTgAWQHn2ayyJVwziX+KETkr9opNwT1qD/RZ5A== dependencies: - ramda "^0.25.0" + ramda "^0.26.1" eslint-plugin-no-unsanitized@^3.0.2: version "3.0.2" @@ -9276,24 +8602,25 @@ eslint-plugin-prettier@^2.2.0: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-plugin-prettier@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad" - integrity sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og== +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== dependencies: - fast-diff "^1.1.1" - jest-docblock "^21.0.0" + prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.11.1: - version "7.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz#c01a7af6f17519457d6116aa94fc6d2ccad5443c" - integrity sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw== +eslint-plugin-react@^7.12.4: + version "7.12.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" + integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== dependencies: array-includes "^3.0.3" doctrine "^2.1.0" has "^1.0.3" jsx-ast-utils "^2.0.1" + object.fromentries "^2.0.0" prop-types "^15.6.2" + resolve "^1.9.0" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -9316,6 +8643,14 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.2.tgz#5f10cd6cabb1965bf479fa65745673439e21cb0e" + integrity sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-utils@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" @@ -9365,48 +8700,46 @@ eslint@^2.7.0: text-table "~0.2.0" user-home "^2.0.0" -eslint@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223" - integrity sha512-/eVYs9VVVboX286mBK7bbKnO1yamUy2UCRjiY6MryhQL2PaaXCExsCQ2aO83OeYRhU2eCU/FMFP+tVMoOrzNrA== +eslint@^5.15.1: + version "5.15.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.15.1.tgz#8266b089fd5391e0009a047050795b1d73664524" + integrity sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" + ajv "^6.9.1" chalk "^2.1.0" cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.2" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^4.0.0" + espree "^5.0.1" esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" + inquirer "^6.2.2" js-yaml "^3.12.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.5" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" - regexpp "^2.0.0" - require-uncached "^1.0.3" + regexpp "^2.0.1" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" - table "^4.0.3" + table "^5.2.3" text-table "^0.2.0" esm@^3.0.84: @@ -9422,13 +8755,14 @@ espree@^3.1.6: acorn "^5.5.0" acorn-jsx "^3.0.0" -espree@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" - integrity sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg== +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" @@ -9870,6 +9204,15 @@ external-editor@^3.0.0: iconv-lite "^0.4.22" tmp "^0.0.33" +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -9983,6 +9326,11 @@ fast-diff@^1.1.1: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-glob@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.0.4.tgz#a4b9f49e36175f5ef1a3456f580226a6e7abcc9e" @@ -10117,13 +9465,12 @@ file-entry-cache@^1.1.1: flat-cache "^1.2.1" object-assign "^4.0.1" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" file-loader@1.1.11: version "1.1.11" @@ -10390,6 +9737,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + flatted@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" @@ -10595,15 +9951,6 @@ fs-extra@5.0.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" - integrity sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" @@ -10648,7 +9995,7 @@ fs-mkdirp-stream@^1.0.0: graceful-fs "^4.1.11" through2 "^2.0.3" -fs-readdir-recursive@^1.0.0, fs-readdir-recursive@^1.1.0: +fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== @@ -11601,10 +10948,10 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -grunt-babel@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/grunt-babel/-/grunt-babel-7.0.0.tgz#13c90c01f154dec214e0eeb5d66ac7c70cedf2d3" - integrity sha512-AFilvH/iPbnIYhL4Wx36AJQCaVEvK55xh0tujAt1DIM5tuxYxRsgUPEpwijBU147B+as/ssGuY9/6JYfTiAWpw== +grunt-babel@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/grunt-babel/-/grunt-babel-8.0.0.tgz#92ef63aafadf938c488dc2f926ac9846e0c93d1b" + integrity sha512-WuiZFvGzcyzlEoPIcY1snI234ydDWeWWV5bpnB7PZsOLHcDsxWKnrR1rMWEUsbdVPPjvIirwFNsuo4CbJmsdFQ== grunt-cli@^1.2.0, grunt-cli@~1.2.0: version "1.2.0" @@ -11723,13 +11070,13 @@ grunt@1.0.3: path-is-absolute "~1.0.0" rimraf "~2.6.2" -gulp-babel@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-7.0.1.tgz#b9c8e29fa376b36c57989db820fc1c1715bb47cb" - integrity sha512-UqHS3AdxZyJCRxqnAX603Dj3k/Wx6hzcgmav3QcxvsIFq3Y8ZkU7iXd0O+JwD5ivqCc6o0r1S7tCB/xxLnuSNw== +gulp-babel@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0.tgz#e0da96f4f2ec4a88dd3a3030f476e38ab2126d87" + integrity sha512-oomaIqDXxFkg7lbpBou/gnUkX51/Y/M2ZfSjL2hdqXTAlSWZcgZtd2o0cOH0r/eE8LWD0+Q/PsLsr2DKOoqToQ== dependencies: plugin-error "^1.0.1" - replace-ext "0.0.1" + replace-ext "^1.0.0" through2 "^2.0.0" vinyl-sourcemaps-apply "^0.2.0" @@ -12228,13 +11575,10 @@ hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0, hoist-non-react- resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" +home-or-tmp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs= homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.1" @@ -12452,7 +11796,7 @@ icalendar@0.7.1: resolved "https://registry.yarnpkg.com/icalendar/-/icalendar-0.7.1.tgz#d0d3486795f8f1c5cf4f8cafac081b4b4e7a32ae" integrity sha1-0NNIZ5X48cXPT4yvrAgbS056Mq4= -iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -12562,6 +11906,14 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -12690,7 +12042,7 @@ inline-style@^2.0.0: dependencies: dashify "^0.1.0" -inquirer@6.2.0, inquirer@^6.1.0, inquirer@^6.2.0: +inquirer@6.2.0, inquirer@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== @@ -12825,6 +12177,25 @@ inquirer@^6.0.0: strip-ansi "^4.0.0" through "^2.3.6" +inquirer@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + insane@2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/insane/-/insane-2.5.0.tgz#3252baec85c53b108cdf731e7962b7ce9c5cff1f" @@ -13412,7 +12783,7 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-resolvable@^1.0.0, is-resolvable@^1.1.0: +is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== @@ -13613,7 +12984,7 @@ istanbul-instrumenter-loader@3.0.1: loader-utils "^1.1.0" schema-utils "^0.3.0" -istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: +istanbul-lib-coverage@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== @@ -13630,19 +13001,6 @@ istanbul-lib-hook@^2.0.3: dependencies: append-transform "^1.0.0" -istanbul-lib-instrument@^1.10.1: - version "1.10.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" - integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.18.0" - istanbul-lib-coverage "^1.2.1" - semver "^5.3.0" - istanbul-lib-instrument@^1.7.3: version "1.10.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" @@ -14444,7 +13802,7 @@ json3@3.3.2, json3@^3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= @@ -15741,11 +15099,6 @@ make-dir@^1.0.0, make-dir@^1.3.0: dependencies: pify "^3.0.0" -make-error@^1.1.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" - integrity sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g== - make-error@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" @@ -17430,7 +16783,7 @@ os-shim@^0.1.2: resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" integrity sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc= -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -17451,15 +16804,6 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - output-file-sync@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.1.tgz#f53118282f5f553c2799541792b723a4c71430c0" @@ -17658,6 +17002,13 @@ param-case@2.1.x, param-case@^2.1.0: dependencies: no-case "^2.2.0" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" @@ -17844,7 +17195,7 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1, path-is-absolute@~1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= @@ -17869,6 +17220,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" @@ -18046,13 +17402,6 @@ pixelmatch@4.0.2, pixelmatch@^4.0.0: dependencies: pngjs "^3.0.0" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -18129,11 +17478,6 @@ pluralize@^1.2.1: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" integrity sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU= -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - pn@^1.0.0, pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -18329,6 +17673,13 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" @@ -18373,7 +17724,7 @@ pretty-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -private@^0.1.6, private@^0.1.7, private@^0.1.8, private@~0.1.5: +private@^0.1.6, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -18850,10 +18201,10 @@ ramda@^0.21.0: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU= -ramda@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" - integrity sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ== +ramda@^0.26.1: + version "0.26.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" + integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== randexp@0.4.6: version "0.4.6" @@ -19919,7 +19270,7 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.10.0, regenerator-runtime@^0.10.5: +regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= @@ -19934,15 +19285,6 @@ regenerator-runtime@^0.12.0, regenerator-runtime@^0.12.1: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - regenerator-transform@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" @@ -19995,10 +19337,10 @@ regexp.prototype.flags@^1.2.0: dependencies: define-properties "^1.1.2" -regexpp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" - integrity sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA== +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^1.0.0: version "1.0.0" @@ -20009,15 +19351,6 @@ regexpu-core@^1.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - regexpu-core@^4.1.3, regexpu-core@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" @@ -20331,7 +19664,7 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-uncached@^1.0.2, require-uncached@^1.0.3: +require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= @@ -20432,7 +19765,7 @@ resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7: dependencies: path-parse "^1.0.5" -resolve@^1.3.2, resolve@^1.4.0, resolve@^1.6.0, resolve@^1.8.1: +resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== @@ -20446,6 +19779,13 @@ resolve@^1.5.0, resolve@^1.7.1: dependencies: path-parse "^1.0.5" +resolve@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + responselike@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -20512,18 +19852,18 @@ rimraf@2.4.3: dependencies: glob "^5.0.14" -rimraf@~2.2.6: - version "2.2.8" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" - integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= - -rimraf@~2.6.2: +rimraf@2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +rimraf@~2.2.6: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -20674,6 +20014,13 @@ rxjs@^6.2.1: dependencies: tslib "^1.9.0" +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" + integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -21278,11 +20625,13 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" slide@^1.1.5, slide@~1.1.3: @@ -21443,13 +20792,6 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - source-map-support@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" @@ -21466,6 +20808,14 @@ source-map-support@^0.5.6, source-map-support@~0.5.6: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@^0.5.9: + version "0.5.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" + integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -21889,6 +21239,15 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" + integrity sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.0.0" + string.prototype.matchall@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-3.0.0.tgz#66f4d8dd5c6c6cea4dffb55ec5f3184a8dd0dd59" @@ -22321,17 +21680,15 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -table@^4.0.3: - version "4.0.3" - resolved "http://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" - integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" tabtab@^1.3.2: version "1.3.2" @@ -22503,17 +21860,6 @@ terser@^3.8.1: source-map "~0.6.1" source-map-support "~0.5.6" -test-exclude@^4.2.1: - version "4.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" - integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - test-exclude@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" @@ -22963,46 +22309,11 @@ trunc-text@1.0.2: resolved "https://registry.yarnpkg.com/trunc-text/-/trunc-text-1.0.2.tgz#b582bb3ddea9c9adc25017d737c48ebdd2157406" integrity sha1-tYK7Pd6pya3CUBfXN8SOvdIVdAY= -ts-jest@^23.1.4: - version "23.1.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.1.4.tgz#66ac1d8d3fbf8f9a98432b11aa377aa850664b2b" - integrity sha512-9rCSxbWfoZxxeXnSoEIzRNr9hDIQ8iEJAWmSRsWhDHDT8OeuGfURhJQUE8jtJlkyEygs6rngH8RYtHz9cfjmEA== - dependencies: - closest-file-data "^0.1.4" - fs-extra "6.0.1" - json5 "^0.5.0" - lodash "^4.17.10" - -ts-loader@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.2.2.tgz#a707849b08ca754cc46f5c7053e79fe1c84caf0e" - integrity sha512-vM/TrEKXBqRYq5yLatsXyKFnYSpv53klmGtrILGlNqcMsxPVi8+e4yr1Agbu9oMZepx/4szDVn5QpFo83IQdQg== - dependencies: - chalk "^2.3.0" - enhanced-resolve "^4.0.0" - loader-utils "^1.0.2" - micromatch "^3.1.4" - semver "^5.0.1" - ts-log@2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.1.3.tgz#9e30aca1baffe7693a2e4142b8f07ecb01cb8340" integrity sha512-VIk9+hzE80UjhJcSANst8LGRBpfNh32y9d3LVDMtEqcEb1x0hB71IO0aObNcLJ5VpK5tKeF9uI4pwEco03SkwA== -ts-node@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" - integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== - dependencies: - arrify "^1.0.0" - buffer-from "^1.1.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.6" - yn "^2.0.0" - tslib@1.9.3, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -24115,7 +23426,7 @@ v8-compile-cache@^2.0.2: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c" integrity sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw== -v8flags@^2.0.2, v8flags@^2.1.1: +v8flags@^2.0.2: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= @@ -25167,6 +24478,13 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -25656,11 +24974,6 @@ yeoman-generator@1.1.1: user-home "^2.0.0" yeoman-environment "^1.1.0" -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= - yo@2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/yo/-/yo-2.0.5.tgz#2f747f5d279ab777e0167b0aa63d7b607507d73d" From 8b0d1206a8e01ddd9b04a9be0bc21e0e7453de62 Mon Sep 17 00:00:00 2001 From: Dmitry Lemeshko Date: Tue, 26 Mar 2019 22:15:16 +0100 Subject: [PATCH 20/25] FTR: fix 10 sec timeout in waitForDeleted (#33313) * use css selector instead of className, set implicit wait to 0 * set implicitWait to 2 sec * set default implicitWait to WAIT_FOR_EXISTS_TIME * set timeout to 1 sec, retry for query bar test * sleep 5 sec waiting zoom is finished * sleep is the only way to wait * run x-pack-ciGroup3 20x times * Revert "run x-pack-ciGroup3 20x times" This reverts commit 55482de330c8bc5872412dbcf767fab05bcb602f. --- test/functional/page_objects/home_page.js | 4 ++-- test/functional/page_objects/share_page.js | 2 +- test/functional/services/combo_box.js | 2 +- test/functional/services/find.js | 2 ++ .../web_element_wrapper/web_element_wrapper.js | 18 ++++++++---------- .../test/functional/page_objects/gis_page.js | 4 +++- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/test/functional/page_objects/home_page.js b/test/functional/page_objects/home_page.js index 7c0d2f7faba6..008a3dff69c0 100644 --- a/test/functional/page_objects/home_page.js +++ b/test/functional/page_objects/home_page.js @@ -60,9 +60,9 @@ export function HomePageProvider({ getService }) { async _waitForSampleDataLoadingAction(id) { const sampleDataCard = await testSubjects.find(`sampleDataSetCard${id}`); await retry.try(async () => { - // waitForDeletedByClassName needs to be inside retry because it will timeout at least once + // waitForDeletedByCssSelector needs to be inside retry because it will timeout at least once // before action is complete - await sampleDataCard.waitForDeletedByClassName('euiLoadingSpinner'); + await sampleDataCard.waitForDeletedByCssSelector('.euiLoadingSpinner'); }); } diff --git a/test/functional/page_objects/share_page.js b/test/functional/page_objects/share_page.js index 777482b55771..b9be3faae640 100644 --- a/test/functional/page_objects/share_page.js +++ b/test/functional/page_objects/share_page.js @@ -56,7 +56,7 @@ export function SharePageProvider({ getService, getPageObjects }) { async checkShortenUrl() { const shareForm = await testSubjects.find('shareUrlForm'); await PageObjects.visualize.checkCheckbox('useShortUrl'); - await shareForm.waitForDeletedByClassName('euiLoadingSpinner'); + await shareForm.waitForDeletedByCssSelector('.euiLoadingSpinner'); } async exportAsSavedObject() { diff --git a/test/functional/services/combo_box.js b/test/functional/services/combo_box.js index b60556bacfd9..33d0efc5b393 100644 --- a/test/functional/services/combo_box.js +++ b/test/functional/services/combo_box.js @@ -56,7 +56,7 @@ export function ComboBoxProvider({ getService }) { } async _waitForOptionsListLoading(comboBoxElement) { - await comboBoxElement.waitForDeletedByClassName('euiLoadingSpinner'); + await comboBoxElement.waitForDeletedByCssSelector('.euiLoadingSpinner'); } async getOptionsList(comboBoxSelector) { diff --git a/test/functional/services/find.js b/test/functional/services/find.js index f16765fd03f7..16802b5f2707 100644 --- a/test/functional/services/find.js +++ b/test/functional/services/find.js @@ -309,12 +309,14 @@ export async function FindProvider({ getService }) { } async waitForDeletedByCssSelector(selector, timeout = defaultFindTimeout) { log.debug(`Find.waitForDeletedByCssSelector('${selector}') with timeout=${timeout}`); + await this._withTimeout(1000); await driver.wait(async () => { const found = await driver.findElements(By.css(selector)); return found.length === 0; }, timeout, `The element ${selector} was still present when it should have disappeared.`); + await this._withTimeout(defaultFindTimeout); } async waitForAttributeToChange(selector, attribute, value) { diff --git a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.js b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.js index 8e96c3af0cc9..be9c88fda1aa 100644 --- a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.js +++ b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.js @@ -389,22 +389,20 @@ export class WebElementWrapper { } /** - * Waits for all elements inside this element matching the given CSS class name to be destroyed. + * Waits for all elements inside this element matching the given CSS selector to be destroyed. * * @param {string} className * @return {Promise} */ - async waitForDeletedByClassName(className) { - await this._driver.wait(() => { - return this._webElement.findElements(this._By.className(className)).then((children) => { - if (children.length <= 0) { - return true; - } - return false; - }); + async waitForDeletedByCssSelector(selector) { + await this._driver.manage().setTimeouts({ implicit: 1000 }); + await this._driver.wait(async () => { + const found = await this._webElement.findElements(this._By.css(selector)); + return found.length === 0; }, this._defaultFindTimeout, - `The element with ${className} className was still present when it should have disappeared.`); + `The element with ${selector} selector was still present after ${this._defaultFindTimeout} sec.`); + await this._driver.manage().setTimeouts({ implicit: this._defaultFindTimeout }); } /** diff --git a/x-pack/test/functional/page_objects/gis_page.js b/x-pack/test/functional/page_objects/gis_page.js index 122e6434301a..0f60d619f6d6 100644 --- a/x-pack/test/functional/page_objects/gis_page.js +++ b/x-pack/test/functional/page_objects/gis_page.js @@ -55,7 +55,7 @@ export function GisPageProvider({ getService, getPageObjects }) { log.debug('Wait for layers to load'); const tableOfContents = await testSubjects.find('mapLayerTOC'); await retry.try(async () => { - await tableOfContents.waitForDeletedByClassName('euiLoadingSpinner'); + await tableOfContents.waitForDeletedByCssSelector('.euiLoadingSpinner'); }); } @@ -170,6 +170,8 @@ export function GisPageProvider({ getService, getPageObjects }) { await testSubjects.setValue('zoomInput', zoom.toString()); await testSubjects.click('submitViewButton'); await this.waitForLayersToLoad(); + // there is no way to wait for canvas been reloaded + await PageObjects.common.sleep(5000); } async getView() { From 41fb553ee350d7245bf55092dc24e224fd78abb2 Mon Sep 17 00:00:00 2001 From: Sarah Hersh Date: Tue, 26 Mar 2019 17:53:35 -0400 Subject: [PATCH 21/25] edits to page headers (#33887) --- .../core/development-unit-tests.asciidoc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/development/core/development-unit-tests.asciidoc b/docs/development/core/development-unit-tests.asciidoc index 852d1fef6b32..a738e2cf372d 100644 --- a/docs/development/core/development-unit-tests.asciidoc +++ b/docs/development/core/development-unit-tests.asciidoc @@ -1,35 +1,37 @@ [[development-unit-tests]] === Unit Testing -We use unit tests to make sure that individual software units of Kibana perform as they were designed to. +We use unit tests to make sure that individual software units of {kib} perform as they were designed to. [float] -==== Current Frameworks +=== Current Frameworks -Kibana is migrating unit testing from `Mocha` to `Jest`. Legacy unit tests still exist in `Mocha` but all new unit tests should be written in `Jest`. +{kib} is migrating unit testing from `Mocha` to `Jest`. Legacy unit tests still exist in `Mocha` but all new unit tests should be written in `Jest`. [float] ==== Mocha (legacy) Mocha tests are contained in `__tests__` directories. -===== Running Mocha Unit Tests +*Running Mocha Unit Tests* ["source","shell"] ----------- yarn test:mocha ----------- +[float] ==== Jest Jest tests are stored in the same directory as source code files with the `.test.{js,ts,tsx}` suffix. -===== Running Jest Unit Tests +*Running Jest Unit Tests* ["source","shell"] ----------- yarn test:jest ----------- +[float] ===== Writing Jest Unit Tests In order to write those tests there are two main things you need to be aware of. @@ -39,8 +41,8 @@ test files with `babel-jest` both techniques are needed specially for the tests implemented on Typescript in order to benefit from the auto-inference types feature. - -====== Jest.mock vs Jest.doMock +[float] +===== Jest.mock vs Jest.doMock Both methods are essentially the same on their roots however the `jest.mock` calls will get hoisted to the top of the file and can only reference variables @@ -49,7 +51,8 @@ reference pretty much any variable we want, however we have to assure those refe variables are instantiated at the time we need them which lead us to the next section where we'll talk about our jest mock files pattern. -====== Jest Mock Files Pattern +[float] +===== Jest Mock Files Pattern Specially on typescript it is pretty common to have in unit tests `jest.doMock` calls which reference for example imported types. Any error From 7676f03bcac0917386e0050a4735e2f4f405bc79 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 26 Mar 2019 15:41:25 -0700 Subject: [PATCH 22/25] Fix plugin generator paths (#33728) --- .../sao_template/template/package_template.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/kbn-plugin-generator/sao_template/template/package_template.json b/packages/kbn-plugin-generator/sao_template/template/package_template.json index 7a6d0842a164..e70755efef7f 100644 --- a/packages/kbn-plugin-generator/sao_template/template/package_template.json +++ b/packages/kbn-plugin-generator/sao_template/template/package_template.json @@ -8,9 +8,9 @@ "templateVersion": "<%= templateVersion %>" }, "scripts": { - "preinstall": "node ../../kibana/preinstall_check", - "kbn": "node ../../kibana/scripts/kbn", - "es": "node ../../kibana/scripts/es", + "preinstall": "node ../../preinstall_check", + "kbn": "node ../../scripts/kbn", + "es": "node ../../scripts/es", "lint": "eslint .", "start": "plugin-helpers start", "test:server": "plugin-helpers test:server", @@ -19,14 +19,14 @@ }, <%_ if (generateTranslations) { _%> "dependencies": { - "@kbn/i18n": "link:../../kibana/packages/kbn-i18n" + "@kbn/i18n": "link:../../packages/kbn-i18n" }, <%_ } _%> "devDependencies": { - "@elastic/eslint-config-kibana": "link:../../kibana/packages/eslint-config-kibana", - "@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana", + "@elastic/eslint-config-kibana": "link:../../packages/eslint-config-kibana", + "@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana", "@kbn/expect": "1.0.0", - "@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers", + "@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers", "babel-eslint": "^10.0.1", "eslint": "^5.14.1", "eslint-plugin-babel": "^5.3.0", From d8c7e18bf150d599697676b5a4159d55e154fea8 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Tue, 26 Mar 2019 15:43:03 -0700 Subject: [PATCH 23/25] Instrument ILM with user action telemetry (#33089) * Track user actions for creating, updating, and deleting and index lifecycle policy. * Track user actions for attaching an index, attaching an index template, and detaching an index. * Track app load action. * Track usage of cold phase, warm phase, set priority, and freeze index. * Track retry step user action. * Track clicks on the policy name to edit it. * Refactor constants to be in root of public. * Add support to user actions API for comma-delimited action types. * Refactor rollups trackUserRequest to be easier to understand. * Use underscores instead of dashes for user action app names. * Switch from componentWillMount to componentDidMount/useEffect. - Standardize use of HashRouter within app.js to avoid calling useEffect when leaving the app. --- .../server/routes/api/user_action.ts | 13 ++-- .../apis/user_action/user_action.js | 22 +++++- .../common/constants/index.js | 17 +++++ .../common/constants/user_action.js | 37 +++++++++ .../index_lifecycle_management/index.js | 4 + .../index_lifecycle_management/public/app.js | 27 ++++--- .../constants.js => constants/index.js} | 0 .../cold_phase/cold_phase.container.js | 2 +- .../components/cold_phase/cold_phase.js | 2 +- .../delete_phase/delete_phase.container.js | 2 +- .../components/delete_phase/delete_phase.js | 2 +- .../hot_phase/hot_phase.container.js | 2 +- .../components/hot_phase/hot_phase.js | 2 +- .../edit_policy/components/min_age_input.js | 2 +- .../node_allocation/node_allocation.js | 2 +- .../components/set_priority_input.js | 2 +- .../warm_phase/warm_phase.container.js | 2 +- .../components/warm_phase/warm_phase.js | 2 +- .../sections/edit_policy/edit_policy.js | 2 +- .../components/policy_table/policy_table.js | 16 ++-- .../public/services/api.js | 25 ++++++- .../public/services/index.js | 1 + .../public/services/user_action.js | 75 +++++++++++++++++++ .../public/services/user_action.test.js | 74 ++++++++++++++++++ .../public/store/actions/lifecycle.js | 13 +++- .../public/store/actions/nodes.js | 2 +- .../public/store/actions/policies.js | 2 +- .../public/store/defaults/cold_phase.js | 2 +- .../public/store/defaults/delete_phase.js | 2 +- .../public/store/defaults/hot_phase.js | 2 +- .../public/store/defaults/warm_phase.js | 2 +- .../public/store/reducers/policies.js | 2 +- .../public/store/selectors/lifecycle.js | 2 +- .../public/store/selectors/policies.js | 2 +- .../server/usage/collector.js | 25 +++++++ .../server/usage/index.js | 7 ++ .../__jest__/components/index_table.test.js | 4 +- .../common/constants/user_action.js | 2 +- x-pack/plugins/index_management/public/app.js | 37 ++++----- .../public/register_routes.js | 5 +- x-pack/plugins/rollup/public/crud_app/app.js | 26 +++++-- .../plugins/rollup/public/crud_app/index.js | 5 +- .../crud_app/services/track_user_action.js | 12 ++- 43 files changed, 400 insertions(+), 89 deletions(-) create mode 100644 x-pack/plugins/index_lifecycle_management/common/constants/user_action.js rename x-pack/plugins/index_lifecycle_management/public/{store/constants.js => constants/index.js} (100%) create mode 100644 x-pack/plugins/index_lifecycle_management/public/services/user_action.js create mode 100644 x-pack/plugins/index_lifecycle_management/public/services/user_action.test.js create mode 100644 x-pack/plugins/index_lifecycle_management/server/usage/collector.js create mode 100644 x-pack/plugins/index_lifecycle_management/server/usage/index.js diff --git a/src/legacy/core_plugins/user_action/server/routes/api/user_action.ts b/src/legacy/core_plugins/user_action/server/routes/api/user_action.ts index f7d1067e8024..004f6e2b6953 100644 --- a/src/legacy/core_plugins/user_action/server/routes/api/user_action.ts +++ b/src/legacy/core_plugins/user_action/server/routes/api/user_action.ts @@ -25,20 +25,23 @@ export const registerUserActionRoute = (server: Server) => { * Increment a count on an object representing a specific user action. */ server.route({ - path: '/api/user_action/{appName}/{actionType}', + path: '/api/user_action/{appName}/{actionTypes}', method: 'POST', handler: async (request: any) => { - const { appName, actionType } = request.params; + const { appName, actionTypes } = request.params; try { const { getSavedObjectsRepository } = server.savedObjects; const { callWithInternalUser } = server.plugins.elasticsearch.getCluster('admin'); const internalRepository = getSavedObjectsRepository(callWithInternalUser); - const savedObjectId = `${appName}:${actionType}`; - // This object is created if it doesn't already exist. - await internalRepository.incrementCounter('user-action', savedObjectId, 'count'); + const incrementRequests = actionTypes.split(',').map((actionType: string) => { + const savedObjectId = `${appName}:${actionType}`; + // This object is created if it doesn't already exist. + return internalRepository.incrementCounter('user-action', savedObjectId, 'count'); + }); + await Promise.all(incrementRequests); return {}; } catch (error) { return new Boom('Something went wrong', { statusCode: error.status }); diff --git a/test/api_integration/apis/user_action/user_action.js b/test/api_integration/apis/user_action/user_action.js index db4485c8f14f..d0be6d648200 100644 --- a/test/api_integration/apis/user_action/user_action.js +++ b/test/api_integration/apis/user_action/user_action.js @@ -18,7 +18,6 @@ */ import expect from '@kbn/expect'; -import { get } from 'lodash'; export default function ({ getService }) { const supertest = getService('supertest'); @@ -35,9 +34,24 @@ export default function ({ getService }) { index: '.kibana', q: 'type:user-action', }).then(response => { - const doc = get(response, 'hits.hits[0]'); - expect(get(doc, '_source.user-action.count')).to.be(1); - expect(doc._id).to.be('user-action:myApp:myAction'); + const ids = response.hits.hits.map(({ _id }) => _id); + expect(ids.includes('user-action:myApp:myAction')); + }); + }); + + it('supports comma-delimited action types', async () => { + await supertest + .post('/api/user_action/myApp/myAction1,myAction2') + .set('kbn-xsrf', 'kibana') + .expect(200); + + return es.search({ + index: '.kibana', + q: 'type:user-action', + }).then(response => { + const ids = response.hits.hits.map(({ _id }) => _id); + expect(ids.includes('user-action:myApp:myAction1')); + expect(ids.includes('user-action:myApp:myAction2')); }); }); }); diff --git a/x-pack/plugins/index_lifecycle_management/common/constants/index.js b/x-pack/plugins/index_lifecycle_management/common/constants/index.js index 5525b2b86f4d..204bf87e0ae7 100644 --- a/x-pack/plugins/index_lifecycle_management/common/constants/index.js +++ b/x-pack/plugins/index_lifecycle_management/common/constants/index.js @@ -6,3 +6,20 @@ export const BASE_PATH = '/management/elasticsearch/index_lifecycle_management/'; export const PLUGIN_ID = 'index_lifecycle_management'; +export { + UA_APP_NAME, + USER_ACTIONS, + UA_APP_LOAD, + UA_POLICY_CREATE, + UA_POLICY_UPDATE, + UA_POLICY_DELETE, + UA_POLICY_ATTACH_INDEX, + UA_POLICY_ATTACH_INDEX_TEMPLATE, + UA_POLICY_DETACH_INDEX, + UA_CONFIG_COLD_PHASE, + UA_CONFIG_WARM_PHASE, + UA_CONFIG_SET_PRIORITY, + UA_CONFIG_FREEZE_INDEX, + UA_INDEX_RETRY_STEP, + UA_EDIT_CLICK, +} from './user_action'; diff --git a/x-pack/plugins/index_lifecycle_management/common/constants/user_action.js b/x-pack/plugins/index_lifecycle_management/common/constants/user_action.js new file mode 100644 index 000000000000..91f28e855b06 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/common/constants/user_action.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +export const UA_APP_NAME = 'index_lifecycle_management'; + +export const UA_APP_LOAD = 'app_load'; +export const UA_POLICY_CREATE = 'policy_create'; +export const UA_POLICY_UPDATE = 'policy_update'; +export const UA_POLICY_DELETE = 'policy_delete'; +export const UA_POLICY_ATTACH_INDEX = 'policy_attach_index'; +export const UA_POLICY_ATTACH_INDEX_TEMPLATE = 'policy_attach_index_template'; +export const UA_POLICY_DETACH_INDEX = 'policy_detach_index'; +export const UA_CONFIG_COLD_PHASE = 'config_cold_phase'; +export const UA_CONFIG_WARM_PHASE = 'config_warm_phase'; +export const UA_CONFIG_SET_PRIORITY = 'config_set_priority'; +export const UA_CONFIG_FREEZE_INDEX = 'config_freeze_index'; +export const UA_INDEX_RETRY_STEP = 'index_retry_step'; +export const UA_EDIT_CLICK = 'edit_click'; + +export const USER_ACTIONS = [ + UA_APP_LOAD, + UA_POLICY_CREATE, + UA_POLICY_UPDATE, + UA_POLICY_DELETE, + UA_POLICY_ATTACH_INDEX, + UA_POLICY_ATTACH_INDEX_TEMPLATE, + UA_POLICY_DETACH_INDEX, + UA_CONFIG_COLD_PHASE, + UA_CONFIG_WARM_PHASE, + UA_CONFIG_SET_PRIORITY, + UA_CONFIG_FREEZE_INDEX, + UA_INDEX_RETRY_STEP, + UA_EDIT_CLICK, +]; diff --git a/x-pack/plugins/index_lifecycle_management/index.js b/x-pack/plugins/index_lifecycle_management/index.js index fe1fc677e102..384293053c45 100644 --- a/x-pack/plugins/index_lifecycle_management/index.js +++ b/x-pack/plugins/index_lifecycle_management/index.js @@ -13,6 +13,8 @@ import { registerIndexRoutes } from './server/routes/api/index'; import { registerLicenseChecker } from './server/lib/register_license_checker'; import { PLUGIN_ID } from './common/constants'; import { indexLifecycleDataEnricher } from './index_lifecycle_data'; +import { registerIndexLifecycleManagementUsageCollector } from './server/usage'; + export function indexLifecycleManagement(kibana) { return new kibana.Plugin({ config: (Joi) => { @@ -52,6 +54,8 @@ export function indexLifecycleManagement(kibana) { registerPoliciesRoutes(server); registerLifecycleRoutes(server); registerIndexRoutes(server); + registerIndexLifecycleManagementUsageCollector(server); + if ( server.config().get('xpack.ilm.ui.enabled') && server.plugins.index_management && diff --git a/x-pack/plugins/index_lifecycle_management/public/app.js b/x-pack/plugins/index_lifecycle_management/public/app.js index e316d11017a1..b644ffdcf1df 100644 --- a/x-pack/plugins/index_lifecycle_management/public/app.js +++ b/x-pack/plugins/index_lifecycle_management/public/app.js @@ -4,18 +4,23 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { useEffect } from 'react'; import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'; +import { BASE_PATH, UA_APP_LOAD } from '../common/constants'; import { EditPolicy } from './sections/edit_policy'; import { PolicyTable } from './sections/policy_table'; -import { BASE_PATH } from '../common/constants'; +import { trackUserAction } from './services'; -export const App = () => ( - - - - - - - -); +export const App = () => { + useEffect(() => trackUserAction(UA_APP_LOAD), []); + + return ( + + + + + + + + ); +}; diff --git a/x-pack/plugins/index_lifecycle_management/public/store/constants.js b/x-pack/plugins/index_lifecycle_management/public/constants/index.js similarity index 100% rename from x-pack/plugins/index_lifecycle_management/public/store/constants.js rename to x-pack/plugins/index_lifecycle_management/public/constants/index.js diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.container.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.container.js index f6470e5c66d3..90c30d943f68 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.container.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.container.js @@ -17,7 +17,7 @@ import { PHASE_COLD, PHASE_HOT, PHASE_ROLLOVER_ENABLED -} from '../../../../store/constants'; +} from '../../../../constants'; export const ColdPhase = connect( (state) => ({ diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.js index ee8759f5f6b0..c95ef1ee75d4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/cold_phase/cold_phase.js @@ -22,7 +22,7 @@ import { PHASE_ENABLED, PHASE_REPLICA_COUNT, PHASE_FREEZE_ENABLED -} from '../../../../store/constants'; +} from '../../../../constants'; import { ErrableFormRow } from '../../form_errors'; import { MinAgeInput } from '../min_age_input'; import { LearnMoreLink, ActiveBadge, PhaseErrorMessage, OptionalLabel } from '../../../components'; diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.container.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.container.js index b7eb4164073c..f7933815d9f3 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.container.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.container.js @@ -8,7 +8,7 @@ import { connect } from 'react-redux'; import { DeletePhase as PresentationComponent } from './delete_phase'; import { getPhase } from '../../../../store/selectors'; import { setPhaseData } from '../../../../store/actions'; -import { PHASE_DELETE, PHASE_HOT, PHASE_ROLLOVER_ENABLED } from '../../../../store/constants'; +import { PHASE_DELETE, PHASE_HOT, PHASE_ROLLOVER_ENABLED } from '../../../../constants'; export const DeletePhase = connect( state => ({ diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.js index a10ae5ab6559..0e7663a6aef7 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/delete_phase/delete_phase.js @@ -19,7 +19,7 @@ import { import { PHASE_DELETE, PHASE_ENABLED, -} from '../../../../store/constants'; +} from '../../../../constants'; import { ActiveBadge, PhaseErrorMessage } from '../../../components'; export class DeletePhase extends PureComponent { diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.container.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.container.js index 0361d287cd40..e1ef58660525 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.container.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.container.js @@ -11,7 +11,7 @@ import { connect } from 'react-redux'; import { HotPhase as PresentationComponent } from './hot_phase'; import { getPhase } from '../../../../store/selectors'; import { setPhaseData } from '../../../../store/actions'; -import { PHASE_HOT, PHASE_WARM, WARM_PHASE_ON_ROLLOVER } from '../../../../store/constants'; +import { PHASE_HOT, PHASE_WARM, WARM_PHASE_ON_ROLLOVER } from '../../../../constants'; export const HotPhase = connect( state => ({ diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.js index ccdb2a6479b1..be1023e9042a 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/hot_phase/hot_phase.js @@ -27,7 +27,7 @@ import { PHASE_ROLLOVER_MAX_SIZE_STORED, PHASE_ROLLOVER_MAX_SIZE_STORED_UNITS, PHASE_ROLLOVER_ENABLED, -} from '../../../../store/constants'; +} from '../../../../constants'; import { SetPriorityInput } from '../set_priority_input'; import { ErrableFormRow } from '../../form_errors'; diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/min_age_input.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/min_age_input.js index d290a25d0636..d52bc147138a 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/min_age_input.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/min_age_input.js @@ -15,7 +15,7 @@ import { import { PHASE_ROLLOVER_MINIMUM_AGE, PHASE_ROLLOVER_MINIMUM_AGE_UNITS, -} from '../../../store/constants'; +} from '../../../constants'; import { ErrableFormRow } from '../form_errors'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; const MinAgeInputUi = props => { diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/node_allocation/node_allocation.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/node_allocation/node_allocation.js index 60f37c4be729..0a0f3bf9d35a 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/node_allocation/node_allocation.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/node_allocation/node_allocation.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import { EuiSelect, EuiButtonEmpty, EuiCallOut, EuiSpacer, EuiLoadingSpinner } from '@elastic/eui'; import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import { PHASE_NODE_ATTRS } from '../../../../store/constants'; +import { PHASE_NODE_ATTRS } from '../../../../constants'; import { ErrableFormRow } from '../../form_errors'; import { LearnMoreLink } from '../../../components/learn_more_link'; const learnMoreLinks = ( diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/set_priority_input.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/set_priority_input.js index af6534817195..3f4c32b05a2d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/set_priority_input.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/set_priority_input.js @@ -12,7 +12,7 @@ import { } from '@elastic/eui'; import { PHASE_INDEX_PRIORITY, -} from '../../../store/constants'; +} from '../../../constants'; import { ErrableFormRow } from '../form_errors'; import { FormattedMessage } from '@kbn/i18n/react'; export const SetPriorityInput = props => { diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.container.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.container.js index 5b66fcae24ec..4e68a51aee93 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.container.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.container.js @@ -13,7 +13,7 @@ import { getPhase, } from '../../../../store/selectors'; import { setPhaseData } from '../../../../store/actions'; -import { PHASE_WARM, PHASE_HOT, PHASE_ROLLOVER_ENABLED } from '../../../../store/constants'; +import { PHASE_WARM, PHASE_HOT, PHASE_ROLLOVER_ENABLED } from '../../../../constants'; export const WarmPhase = connect( state => ({ diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.js index d9c9d0930daf..b25e3db0ceda 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/components/warm_phase/warm_phase.js @@ -26,7 +26,7 @@ import { PHASE_PRIMARY_SHARD_COUNT, PHASE_REPLICA_COUNT, PHASE_SHRINK_ENABLED, -} from '../../../../store/constants'; +} from '../../../../constants'; import { SetPriorityInput } from '../set_priority_input'; import { NodeAllocation } from '../node_allocation'; import { ErrableFormRow } from '../../form_errors'; diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js index 9daa0926b571..8e9fcc281ad2 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/edit_policy/edit_policy.js @@ -36,7 +36,7 @@ import { PHASE_DELETE, PHASE_WARM, STRUCTURE_POLICY_NAME, -} from '../../store/constants'; +} from '../../constants'; import { findFirstError } from '../../services/find_errors'; import { NodeAttrsDetails } from './components/node_attrs_details'; import { PolicyJsonFlyout } from './components/policy_json_flyout'; diff --git a/x-pack/plugins/index_lifecycle_management/public/sections/policy_table/components/policy_table/policy_table.js b/x-pack/plugins/index_lifecycle_management/public/sections/policy_table/components/policy_table/policy_table.js index 891d608b6dd6..d31aae042fe0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/sections/policy_table/components/policy_table/policy_table.js +++ b/x-pack/plugins/index_lifecycle_management/public/sections/policy_table/components/policy_table/policy_table.js @@ -8,11 +8,7 @@ import React, { Component, Fragment } from 'react'; import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import { BASE_PATH } from '../../../../../common/constants'; -import { NoMatch } from '../no_match'; -import { getPolicyPath } from '../../../../services/navigation'; -import { flattenPanelTree } from '../../../../services/flatten_panel_tree'; -import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services'; + import { EuiBetaBadge, EuiButton, @@ -38,10 +34,17 @@ import { EuiPageBody, EuiPageContent, } from '@elastic/eui'; +import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services'; +import { getIndexListUri } from '../../../../../../index_management/public/services/navigation'; +import { BASE_PATH, UA_EDIT_CLICK } from '../../../../../common/constants'; +import { getPolicyPath } from '../../../../services/navigation'; +import { flattenPanelTree } from '../../../../services/flatten_panel_tree'; +import { trackUserAction } from '../../../../services'; +import { NoMatch } from '../no_match'; import { ConfirmDelete } from './confirm_delete'; import { AddPolicyToTemplateConfirmModal } from './add_policy_to_template_confirm_modal'; -import { getIndexListUri } from '../../../../../../index_management/public/services/navigation'; + const COLUMNS = { name: { label: i18n.translate('xpack.indexLifecycleMgmt.policyTable.headers.nameHeader', { @@ -176,6 +179,7 @@ export class PolicyTableUi extends Component { className="policyTable__link" data-test-subj="policyTablePolicyNameLink" href={getPolicyPath(value)} + onClick={() => trackUserAction(UA_EDIT_CLICK)} > {value} diff --git a/x-pack/plugins/index_lifecycle_management/public/services/api.js b/x-pack/plugins/index_lifecycle_management/public/services/api.js index a82cd3a0a754..334f986b659d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/services/api.js +++ b/x-pack/plugins/index_lifecycle_management/public/services/api.js @@ -4,12 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ import chrome from 'ui/chrome'; +import { + UA_POLICY_DELETE, + UA_POLICY_ATTACH_INDEX, + UA_POLICY_ATTACH_INDEX_TEMPLATE, + UA_POLICY_DETACH_INDEX, + UA_INDEX_RETRY_STEP, +} from '../../common/constants'; +import { trackUserAction } from './user_action'; let httpClient; export const setHttpClient = (client) => { httpClient = client; }; -const getHttpClient = () => { +export const getHttpClient = () => { return httpClient; }; const apiPrefix = chrome.addBasePath('/api/index_lifecycle_management'); @@ -44,6 +52,8 @@ export async function loadPolicies(withIndices, httpClient = getHttpClient()) { export async function deletePolicy(policyName, httpClient = getHttpClient()) { const response = await httpClient.delete(`${apiPrefix}/policies/${encodeURIComponent(policyName)}`); + // Only track successful actions. + trackUserAction(UA_POLICY_DELETE, httpClient); return response.data; } @@ -52,7 +62,6 @@ export async function saveLifecycle(lifecycle, httpClient = getHttpClient()) { return response.data; } - export async function getAffectedIndices(indexTemplateName, policyName, httpClient = getHttpClient()) { const path = policyName ? `${apiPrefix}/indices/affected/${indexTemplateName}/${encodeURIComponent(policyName)}` @@ -60,19 +69,31 @@ export async function getAffectedIndices(indexTemplateName, policyName, httpClie const response = await httpClient.get(path); return response.data; } + export const retryLifecycleForIndex = async (indexNames, httpClient = getHttpClient()) => { const response = await httpClient.post(`${apiPrefix}/index/retry`, { indexNames }); + // Only track successful actions. + trackUserAction(UA_INDEX_RETRY_STEP, httpClient); return response.data; }; + export const removeLifecycleForIndex = async (indexNames, httpClient = getHttpClient()) => { const response = await httpClient.post(`${apiPrefix}/index/remove`, { indexNames }); + // Only track successful actions. + trackUserAction(UA_POLICY_DETACH_INDEX, httpClient); return response.data; }; + export const addLifecyclePolicyToIndex = async (body, httpClient = getHttpClient()) => { const response = await httpClient.post(`${apiPrefix}/index/add`, body); + // Only track successful actions. + trackUserAction(UA_POLICY_ATTACH_INDEX, httpClient); return response.data; }; + export const addLifecyclePolicyToTemplate = async (body, httpClient = getHttpClient()) => { const response = await httpClient.post(`${apiPrefix}/template`, body); + // Only track successful actions. + trackUserAction(UA_POLICY_ATTACH_INDEX_TEMPLATE, httpClient); return response.data; }; diff --git a/x-pack/plugins/index_lifecycle_management/public/services/index.js b/x-pack/plugins/index_lifecycle_management/public/services/index.js index a82b581309d2..d1160c4af8db 100644 --- a/x-pack/plugins/index_lifecycle_management/public/services/index.js +++ b/x-pack/plugins/index_lifecycle_management/public/services/index.js @@ -6,3 +6,4 @@ export { filterItems } from './filter_items'; export { sortTable } from './sort_table'; +export { trackUserAction, getUserActionsForPhases } from './user_action'; diff --git a/x-pack/plugins/index_lifecycle_management/public/services/user_action.js b/x-pack/plugins/index_lifecycle_management/public/services/user_action.js new file mode 100644 index 000000000000..d45b2f1ce494 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/public/services/user_action.js @@ -0,0 +1,75 @@ +/* + * 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 { get } from 'lodash'; + +import { createUserActionUri } from '../../../../common/user_action'; + +import { + UA_APP_NAME, + UA_CONFIG_COLD_PHASE, + UA_CONFIG_WARM_PHASE, + UA_CONFIG_SET_PRIORITY, + UA_CONFIG_FREEZE_INDEX, +} from '../../common/constants'; + +import { + PHASE_HOT, + PHASE_WARM, + PHASE_COLD, + PHASE_INDEX_PRIORITY, +} from '../constants'; + +import { + defaultColdPhase, + defaultWarmPhase, + defaultHotPhase, +} from '../store/defaults'; + +import { getHttpClient } from './api'; + +export function trackUserAction(actionType, httpClient = getHttpClient()) { + const userActionUri = createUserActionUri(UA_APP_NAME, actionType); + httpClient.post(userActionUri); +} + +export function getUserActionsForPhases(phases) { + const possibleUserActions = [{ + action: UA_CONFIG_COLD_PHASE, + isExecuted: () => Boolean(phases[PHASE_COLD]), + }, { + action: UA_CONFIG_WARM_PHASE, + isExecuted: () => Boolean(phases[PHASE_WARM]), + }, { + action: UA_CONFIG_SET_PRIORITY, + isExecuted: () => { + const phaseToDefaultIndexPriorityMap = { + [PHASE_HOT]: defaultHotPhase[PHASE_INDEX_PRIORITY], + [PHASE_WARM]: defaultWarmPhase[PHASE_INDEX_PRIORITY], + [PHASE_COLD]: defaultColdPhase[PHASE_INDEX_PRIORITY], + }; + + // We only care about whether the user has interacted with the priority of *any* phase at all. + return [ PHASE_HOT, PHASE_WARM, PHASE_COLD ].some(phase => { + // If the priority is different than the default, we'll consider it a user interaction, + // even if the user has set it to undefined. + return phases[phase] && get(phases[phase], 'actions.set_priority.priority') !== phaseToDefaultIndexPriorityMap[phase]; + }); + }, + }, { + action: UA_CONFIG_FREEZE_INDEX, + isExecuted: () => phases[PHASE_COLD] && get(phases[PHASE_COLD], 'actions.freeze'), + }]; + + const executedUserActions = possibleUserActions.reduce((executed, { action, isExecuted }) => { + if (isExecuted()) { + executed.push(action); + } + return executed; + }, []); + + return executedUserActions; +} diff --git a/x-pack/plugins/index_lifecycle_management/public/services/user_action.test.js b/x-pack/plugins/index_lifecycle_management/public/services/user_action.test.js new file mode 100644 index 000000000000..a66a9140d9a6 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/public/services/user_action.test.js @@ -0,0 +1,74 @@ +/* + * 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 { + UA_CONFIG_COLD_PHASE, + UA_CONFIG_WARM_PHASE, + UA_CONFIG_SET_PRIORITY, + UA_CONFIG_FREEZE_INDEX, +} from '../../common/constants'; + +import { + defaultColdPhase, + defaultWarmPhase, +} from '../store/defaults'; + +import { + PHASE_INDEX_PRIORITY, +} from '../constants'; + +import { getUserActionsForPhases } from './user_action'; + +describe('getUserActionsForPhases', () => { + test('gets cold phase', () => { + expect(getUserActionsForPhases({ + cold: { + actions: { + set_priority: { + priority: defaultColdPhase[PHASE_INDEX_PRIORITY], + }, + }, + }, + })).toEqual([UA_CONFIG_COLD_PHASE]); + }); + + test('gets warm phase', () => { + expect(getUserActionsForPhases({ + warm: { + actions: { + set_priority: { + priority: defaultWarmPhase[PHASE_INDEX_PRIORITY], + }, + }, + }, + })).toEqual([UA_CONFIG_WARM_PHASE]); + }); + + test(`gets index priority if it's different than the default value`, () => { + expect(getUserActionsForPhases({ + warm: { + actions: { + set_priority: { + priority: defaultWarmPhase[PHASE_INDEX_PRIORITY] + 1, + }, + }, + }, + })).toEqual([UA_CONFIG_WARM_PHASE, UA_CONFIG_SET_PRIORITY]); + }); + + test('gets freeze index', () => { + expect(getUserActionsForPhases({ + cold: { + actions: { + freeze: {}, + set_priority: { + priority: defaultColdPhase[PHASE_INDEX_PRIORITY], + }, + }, + }, + })).toEqual([UA_CONFIG_COLD_PHASE, UA_CONFIG_FREEZE_INDEX]); + }); +}); diff --git a/x-pack/plugins/index_lifecycle_management/public/store/actions/lifecycle.js b/x-pack/plugins/index_lifecycle_management/public/store/actions/lifecycle.js index 9dcd1249de71..c7de1ba2e4ce 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/actions/lifecycle.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/actions/lifecycle.js @@ -5,9 +5,15 @@ */ import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; + +import { + UA_POLICY_CREATE, + UA_POLICY_UPDATE, +} from '../../../common/constants'; + import { showApiError } from '../../services/api_errors'; import { saveLifecycle as saveLifecycleApi } from '../../services/api'; - +import { trackUserAction, getUserActionsForPhases } from '../../services'; export const saveLifecyclePolicy = (lifecycle, isNew) => async () => { try { @@ -23,6 +29,11 @@ export const saveLifecyclePolicy = (lifecycle, isNew) => async () => { showApiError(err, title); return false; } + + const userActions = getUserActionsForPhases(lifecycle.phases); + userActions.push(isNew ? UA_POLICY_CREATE : UA_POLICY_UPDATE); + trackUserAction(userActions.join(',')); + const message = i18n.translate('xpack.indexLifecycleMgmt.editPolicy.successfulSaveMessage', { defaultMessage: '{verb} lifecycle policy "{lifecycleName}"', diff --git a/x-pack/plugins/index_lifecycle_management/public/store/actions/nodes.js b/x-pack/plugins/index_lifecycle_management/public/store/actions/nodes.js index a2a526e44298..bb1f63c61cb2 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/actions/nodes.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/actions/nodes.js @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { createAction } from 'redux-actions'; import { showApiError } from '../../services/api_errors'; import { loadNodes, loadNodeDetails } from '../../services/api'; -import { SET_SELECTED_NODE_ATTRS } from '../constants'; +import { SET_SELECTED_NODE_ATTRS } from '../../constants'; export const setSelectedNodeAttrs = createAction(SET_SELECTED_NODE_ATTRS); export const setSelectedPrimaryShardCount = createAction( diff --git a/x-pack/plugins/index_lifecycle_management/public/store/actions/policies.js b/x-pack/plugins/index_lifecycle_management/public/store/actions/policies.js index fb2384855d92..c089dfa7e752 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/actions/policies.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/actions/policies.js @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import { showApiError } from '../../services/api_errors'; import { createAction } from 'redux-actions'; import { loadPolicies } from '../../services/api'; -import { SET_PHASE_DATA } from '../constants'; +import { SET_PHASE_DATA } from '../../constants'; export const fetchedPolicies = createAction('FETCHED_POLICIES'); export const setSelectedPolicy = createAction('SET_SELECTED_POLICY'); export const unsetSelectedPolicy = createAction('UNSET_SELECTED_POLICY'); diff --git a/x-pack/plugins/index_lifecycle_management/public/store/defaults/cold_phase.js b/x-pack/plugins/index_lifecycle_management/public/store/defaults/cold_phase.js index 0a4f4e2206d6..0ff523a43867 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/defaults/cold_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/defaults/cold_phase.js @@ -12,7 +12,7 @@ import { PHASE_ROLLOVER_ALIAS, PHASE_FREEZE_ENABLED, PHASE_INDEX_PRIORITY, -} from '../constants'; +} from '../../constants'; export const defaultColdPhase = { [PHASE_ENABLED]: false, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/defaults/delete_phase.js b/x-pack/plugins/index_lifecycle_management/public/store/defaults/delete_phase.js index c449ba073fd2..901ac4f6a466 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/defaults/delete_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/defaults/delete_phase.js @@ -9,7 +9,7 @@ import { PHASE_ROLLOVER_MINIMUM_AGE, PHASE_ROLLOVER_MINIMUM_AGE_UNITS, PHASE_ROLLOVER_ALIAS, -} from '../constants'; +} from '../../constants'; export const defaultDeletePhase = { [PHASE_ENABLED]: false, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/defaults/hot_phase.js b/x-pack/plugins/index_lifecycle_management/public/store/defaults/hot_phase.js index 43ffc1b565e5..ba8897943525 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/defaults/hot_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/defaults/hot_phase.js @@ -12,7 +12,7 @@ import { PHASE_ROLLOVER_MAX_DOCUMENTS, PHASE_ROLLOVER_MAX_SIZE_STORED_UNITS, PHASE_INDEX_PRIORITY -} from '../constants'; +} from '../../constants'; export const defaultHotPhase = { [PHASE_ENABLED]: true, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/defaults/warm_phase.js b/x-pack/plugins/index_lifecycle_management/public/store/defaults/warm_phase.js index 8e55b5c72c4f..7e6dcd41f487 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/defaults/warm_phase.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/defaults/warm_phase.js @@ -16,7 +16,7 @@ import { PHASE_SHRINK_ENABLED, WARM_PHASE_ON_ROLLOVER, PHASE_INDEX_PRIORITY -} from '../constants'; +} from '../../constants'; export const defaultWarmPhase = { [PHASE_ENABLED]: false, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/reducers/policies.js b/x-pack/plugins/index_lifecycle_management/public/store/reducers/policies.js index 27b5304fec1f..8fc0bc1b7376 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/reducers/policies.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/reducers/policies.js @@ -27,7 +27,7 @@ import { PHASE_COLD, PHASE_DELETE, PHASE_ATTRIBUTES_THAT_ARE_NUMBERS, -} from '../constants'; +} from '../../constants'; import { defaultColdPhase, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/selectors/lifecycle.js b/x-pack/plugins/index_lifecycle_management/public/store/selectors/lifecycle.js index a25299d54675..b89e74781b34 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/selectors/lifecycle.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/selectors/lifecycle.js @@ -25,7 +25,7 @@ import { WARM_PHASE_ON_ROLLOVER, PHASE_INDEX_PRIORITY, PHASE_ROLLOVER_MAX_DOCUMENTS -} from '../constants'; +} from '../../constants'; import { getPhase, getPhases, diff --git a/x-pack/plugins/index_lifecycle_management/public/store/selectors/policies.js b/x-pack/plugins/index_lifecycle_management/public/store/selectors/policies.js index 30649e8a6204..31af91c12201 100644 --- a/x-pack/plugins/index_lifecycle_management/public/store/selectors/policies.js +++ b/x-pack/plugins/index_lifecycle_management/public/store/selectors/policies.js @@ -32,7 +32,7 @@ import { PHASE_FREEZE_ENABLED, PHASE_INDEX_PRIORITY, PHASE_ROLLOVER_MAX_DOCUMENTS -} from '../constants'; +} from '../../constants'; import { defaultEmptyDeletePhase, defaultEmptyColdPhase, diff --git a/x-pack/plugins/index_lifecycle_management/server/usage/collector.js b/x-pack/plugins/index_lifecycle_management/server/usage/collector.js new file mode 100644 index 000000000000..4fb067a2eaa9 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/server/usage/collector.js @@ -0,0 +1,25 @@ +/* + * 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 { fetchUserActions } from '../../../../server/lib/user_action'; +import { UA_APP_NAME, USER_ACTIONS } from '../../common/constants'; + +const INDEX_LIFECYCLE_MANAGEMENT_USAGE_TYPE = 'index_lifecycle_management'; + +export function registerIndexLifecycleManagementUsageCollector(server) { + const collector = server.usage.collectorSet.makeUsageCollector({ + type: INDEX_LIFECYCLE_MANAGEMENT_USAGE_TYPE, + fetch: async () => { + const userActions = await fetchUserActions(server, UA_APP_NAME, USER_ACTIONS); + + return { + user_actions: userActions, + }; + }, + }); + + server.usage.collectorSet.register(collector); +} diff --git a/x-pack/plugins/index_lifecycle_management/server/usage/index.js b/x-pack/plugins/index_lifecycle_management/server/usage/index.js new file mode 100644 index 000000000000..f0fec917cd56 --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/server/usage/index.js @@ -0,0 +1,7 @@ +/* + * 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. + */ + +export { registerIndexLifecycleManagementUsageCollector } from './collector'; diff --git a/x-pack/plugins/index_management/__jest__/components/index_table.test.js b/x-pack/plugins/index_management/__jest__/components/index_table.test.js index 9e795c38979e..fa7f82be5a2d 100644 --- a/x-pack/plugins/index_management/__jest__/components/index_table.test.js +++ b/x-pack/plugins/index_management/__jest__/components/index_table.test.js @@ -6,7 +6,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { App } from '../../public/app'; +import { AppWithoutRouter } from '../../public/app'; import { Provider } from 'react-redux'; import { loadIndicesSuccess } from '../../public/store/actions'; import { indexManagementStore } from '../../public/store'; @@ -123,7 +123,7 @@ describe('index table', () => { component = ( - + ); diff --git a/x-pack/plugins/index_management/common/constants/user_action.js b/x-pack/plugins/index_management/common/constants/user_action.js index 9f491e4918c4..47eda91edfed 100644 --- a/x-pack/plugins/index_management/common/constants/user_action.js +++ b/x-pack/plugins/index_management/common/constants/user_action.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export const UA_APP_NAME = 'index-management'; +export const UA_APP_NAME = 'index_management'; export const UA_APP_LOAD = 'app_load'; export const UA_UPDATE_SETTINGS = 'update_settings'; diff --git a/x-pack/plugins/index_management/public/app.js b/x-pack/plugins/index_management/public/app.js index 5446e20f1852..b7302f483629 100644 --- a/x-pack/plugins/index_management/public/app.js +++ b/x-pack/plugins/index_management/public/app.js @@ -4,26 +4,27 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Component } from 'react'; -import { Switch, Route, Redirect } from 'react-router-dom'; +import React, { useEffect } from 'react'; +import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'; import { BASE_PATH, UA_APP_LOAD } from '../common/constants'; import { IndexList } from './sections/index_list'; import { trackUserAction } from './services'; -export class App extends Component { - componentWillMount() { - trackUserAction(UA_APP_LOAD); - } +export const App = () => { + useEffect(() => trackUserAction(UA_APP_LOAD), []); - render() { - return ( -
    - - - - - -
    - ); - } -} + return ( + + + + ); +}; + +// Exoprt this so we can test it with a different router. +export const AppWithoutRouter = () => ( + + + + + +); diff --git a/x-pack/plugins/index_management/public/register_routes.js b/x-pack/plugins/index_management/public/register_routes.js index a926d64d3274..41787befd5c2 100644 --- a/x-pack/plugins/index_management/public/register_routes.js +++ b/x-pack/plugins/index_management/public/register_routes.js @@ -7,7 +7,6 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { Provider } from 'react-redux'; -import { HashRouter } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { setHttpClient } from './services/api'; import { setUrlService } from './services/navigation'; @@ -28,9 +27,7 @@ const renderReact = async (elem) => { render( - - - + , elem diff --git a/x-pack/plugins/rollup/public/crud_app/app.js b/x-pack/plugins/rollup/public/crud_app/app.js index 11ac412104db..2e6994a01d3e 100644 --- a/x-pack/plugins/rollup/public/crud_app/app.js +++ b/x-pack/plugins/rollup/public/crud_app/app.js @@ -6,14 +6,14 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Switch, Route, Redirect } from 'react-router-dom'; +import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'; import { UA_APP_LOAD } from '../../common'; import { CRUD_APP_BASE_PATH } from './constants'; import { registerRouter, setUserHasLeftApp, trackUserAction } from './services'; import { JobList, JobCreate } from './sections'; -export class App extends Component { +class ShareRouter extends Component { static contextTypes = { router: PropTypes.shape({ history: PropTypes.shape({ @@ -34,7 +34,13 @@ export class App extends Component { registerRouter(router); } - componentWillMount() { + render() { + return this.props.children; + } +} + +export class App extends Component { // eslint-disable-line react/no-multi-comp + componentDidMount() { trackUserAction(UA_APP_LOAD); } @@ -45,11 +51,15 @@ export class App extends Component { render() { return ( - - - - - + + + + + + + + + ); } } diff --git a/x-pack/plugins/rollup/public/crud_app/index.js b/x-pack/plugins/rollup/public/crud_app/index.js index b43592c8e228..28e9973d2151 100644 --- a/x-pack/plugins/rollup/public/crud_app/index.js +++ b/x-pack/plugins/rollup/public/crud_app/index.js @@ -8,7 +8,6 @@ import React from 'react'; import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; import { render, unmountComponentAtNode } from 'react-dom'; import { Provider } from 'react-redux'; -import { HashRouter } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; import { management } from 'ui/management'; @@ -33,9 +32,7 @@ const renderReact = async (elem) => { render( - - - + , elem diff --git a/x-pack/plugins/rollup/public/crud_app/services/track_user_action.js b/x-pack/plugins/rollup/public/crud_app/services/track_user_action.js index c2d588dd4d3a..1db7fe69095e 100644 --- a/x-pack/plugins/rollup/public/crud_app/services/track_user_action.js +++ b/x-pack/plugins/rollup/public/crud_app/services/track_user_action.js @@ -13,8 +13,16 @@ export function trackUserAction(actionType) { getHttp().post(userActionUri); } +/** + * Transparently return provided request Promise, while allowing us to track + * a successful completion of the request. + */ export function trackUserRequest(request, actionType) { // Only track successful actions. - request.then(() => trackUserAction(actionType)); - return request; + return request.then(response => { + trackUserAction(actionType); + // We return the response immediately without waiting for the tracking request to resolve, + // to avoid adding additional latency. + return response; + }); } From 3b020f055b161561c4b70495c31904cb1ed52703 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 27 Mar 2019 00:41:24 +0000 Subject: [PATCH 24/25] docs(NA): missing header for unit testing. (#33895) --- docs/development/core-development.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/development/core-development.asciidoc b/docs/development/core-development.asciidoc index ed04a6f12eae..447a4c6d2601 100644 --- a/docs/development/core-development.asciidoc +++ b/docs/development/core-development.asciidoc @@ -5,6 +5,7 @@ * <> * <> * <> +* <> * <> include::core/development-basepath.asciidoc[] From 33fa8c0c6b4a37b94d418e8604f80900c12805f8 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Tue, 26 Mar 2019 20:18:14 -0700 Subject: [PATCH 25/25] Add eslint rule for checking React Hooks best practices. (#33901) * Rename Console's useResizeChecker to applyResizeCheckerToEditors, to bypass greedy react-hooks lint rule. --- package.json | 1 + packages/eslint-config-kibana/.eslintrc.js | 3 +++ packages/eslint-config-kibana/package.json | 3 ++- .../console/public/src/controllers/sense_controller.js | 4 ++-- .../console/public/src/directives/sense_help_example.js | 4 ++-- .../console/public/src/directives/sense_history_viewer.js | 4 ++-- .../core_plugins/console/public/src/sense_editor_resize.js | 2 +- yarn.lock | 5 +++++ 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 3d3a64a56e67..5abfcdd651a8 100644 --- a/package.json +++ b/package.json @@ -346,6 +346,7 @@ "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", + "eslint-plugin-react-hooks": "^1.6.0", "faker": "1.1.0", "fetch-mock": "7.3.0", "geckodriver": "1.12.2", diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 9906f9cf8dfe..0b509d81c579 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { 'mocha', 'babel', 'react', + 'react-hooks', 'import', 'no-unsanitized', 'prefer-object-spread', @@ -127,6 +128,8 @@ module.exports = { arrow: true, }], 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'], + 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks + 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies 'jsx-a11y/accessible-emoji': 'error', 'jsx-a11y/alt-text': 'error', 'jsx-a11y/anchor-has-content': 'error', diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index c4a5a99e4c97..4be75ca2bcbe 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -24,6 +24,7 @@ "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.12.4" + "eslint-plugin-react": "^7.12.4", + "eslint-plugin-react-hooks": "^1.6.0" } } diff --git a/src/legacy/core_plugins/console/public/src/controllers/sense_controller.js b/src/legacy/core_plugins/console/public/src/controllers/sense_controller.js index 4d3757be9a6a..58fe1df256ad 100644 --- a/src/legacy/core_plugins/console/public/src/controllers/sense_controller.js +++ b/src/legacy/core_plugins/console/public/src/controllers/sense_controller.js @@ -17,7 +17,7 @@ * under the License. */ import 'ui/doc_title'; -import { useResizeChecker } from '../sense_editor_resize'; +import { applyResizeCheckerToEditors } from '../sense_editor_resize'; import $ from 'jquery'; import { initializeInput } from '../input'; import { initializeOutput } from '../output'; @@ -30,7 +30,7 @@ const module = require('ui/modules').get('app/sense'); module.run(function (Private, $rootScope) { module.setupResizeCheckerForRootEditors = ($el, ...editors) => { - return useResizeChecker($rootScope, $el, ...editors); + return applyResizeCheckerToEditors($rootScope, $el, ...editors); }; }); diff --git a/src/legacy/core_plugins/console/public/src/directives/sense_help_example.js b/src/legacy/core_plugins/console/public/src/directives/sense_help_example.js index 6a7cbff4df3d..d4e4632a45df 100644 --- a/src/legacy/core_plugins/console/public/src/directives/sense_help_example.js +++ b/src/legacy/core_plugins/console/public/src/directives/sense_help_example.js @@ -19,7 +19,7 @@ const SenseEditor = require('../sense_editor/editor'); const exampleText = require('raw-loader!./helpExample.txt').trim(); -import { useResizeChecker } from '../sense_editor_resize'; +import { applyResizeCheckerToEditors } from '../sense_editor_resize'; require('ui/modules') .get('app/sense') @@ -29,7 +29,7 @@ require('ui/modules') link: function ($scope, $el) { $el.text(exampleText); $scope.editor = new SenseEditor($el); - useResizeChecker($scope, $el, $scope.editor); + applyResizeCheckerToEditors($scope, $el, $scope.editor); $scope.editor.setReadOnly(true); $scope.editor.$blockScrolling = Infinity; diff --git a/src/legacy/core_plugins/console/public/src/directives/sense_history_viewer.js b/src/legacy/core_plugins/console/public/src/directives/sense_history_viewer.js index 9502a10f0a36..d7ad736335f5 100644 --- a/src/legacy/core_plugins/console/public/src/directives/sense_history_viewer.js +++ b/src/legacy/core_plugins/console/public/src/directives/sense_history_viewer.js @@ -19,7 +19,7 @@ const SenseEditor = require('../sense_editor/editor'); -import { useResizeChecker } from '../sense_editor_resize'; +import { applyResizeCheckerToEditors } from '../sense_editor_resize'; require('ui/modules') .get('app/sense') @@ -33,7 +33,7 @@ require('ui/modules') const viewer = new SenseEditor($el); viewer.setReadOnly(true); viewer.renderer.setShowPrintMargin(false); - useResizeChecker($scope, $el, viewer); + applyResizeCheckerToEditors($scope, $el, viewer); require('../settings').applyCurrentSettings(viewer); $scope.$watch('req', function (req) { diff --git a/src/legacy/core_plugins/console/public/src/sense_editor_resize.js b/src/legacy/core_plugins/console/public/src/sense_editor_resize.js index eff840254a86..6b950a394db1 100644 --- a/src/legacy/core_plugins/console/public/src/sense_editor_resize.js +++ b/src/legacy/core_plugins/console/public/src/sense_editor_resize.js @@ -19,7 +19,7 @@ import { ResizeChecker } from 'ui/resize_checker'; -export function useResizeChecker($scope, $el, ...editors) { +export function applyResizeCheckerToEditors($scope, $el, ...editors) { const checker = new ResizeChecker($el); checker.on('resize', () => editors.forEach(e => e.resize())); $scope.$on('$destroy', () => checker.destroy()); diff --git a/yarn.lock b/yarn.lock index 18dccaaa691c..848c82f95a4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8609,6 +8609,11 @@ eslint-plugin-prettier@^3.0.1: dependencies: prettier-linter-helpers "^1.0.0" +eslint-plugin-react-hooks@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f" + integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag== + eslint-plugin-react@^7.12.4: version "7.12.4" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c"