From 779ab6b336877cb27a49f1f98c2406d03ec8f4ab Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Wed, 11 Nov 2020 10:26:54 +0100 Subject: [PATCH] Use existing fake mocha types --- .../fake_mocha_types.d.ts | 7 ++++ .../lib/snapshots/decorate_snapshot_ui.ts | 2 +- .../lib/snapshots/mocha_types.ts | 36 ------------------- 3 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 packages/kbn-test/src/functional_test_runner/lib/snapshots/mocha_types.ts diff --git a/packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts b/packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts index 12390a95a4961a..35b4b85e4d22a2 100644 --- a/packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts +++ b/packages/kbn-test/src/functional_test_runner/fake_mocha_types.d.ts @@ -28,10 +28,17 @@ import EventEmitter from 'events'; export interface Suite { suites: Suite[]; tests: Test[]; + title: string; + file?: string; + parent?: Suite; } export interface Test { fullTitle(): string; + title: string; + file?: string; + parent?: Suite; + isPassed: () => boolean; } export interface Runner extends EventEmitter { diff --git a/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts b/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts index 23a8f4de06b2f8..cb9a22bd01f207 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/snapshots/decorate_snapshot_ui.ts @@ -29,7 +29,7 @@ import prettier from 'prettier'; import babelTraverse from '@babel/traverse'; import { flatten, once } from 'lodash'; import { Lifecycle } from 'packages/kbn-test/types/ftr'; -import { Suite, Test } from './mocha_types'; +import { Mocha, Suite, Test } from '../../fake_mocha_types'; type ISnapshotState = InstanceType; diff --git a/packages/kbn-test/src/functional_test_runner/lib/snapshots/mocha_types.ts b/packages/kbn-test/src/functional_test_runner/lib/snapshots/mocha_types.ts deleted file mode 100644 index 0dac54890d9faf..00000000000000 --- a/packages/kbn-test/src/functional_test_runner/lib/snapshots/mocha_types.ts +++ /dev/null @@ -1,36 +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. - */ - -// Define the Mocha types we need, as importing them causes -// conflicts with Jest global types - -export interface Suite { - title: string; - file?: string; - suites: Suite[]; - tests: Test[]; - parent?: Suite; -} - -export interface Test { - title: string; - file?: string; - parent?: Suite; - isPassed: () => boolean; -}