From 4260f597d40c994424d7361ff3d460c227827208 Mon Sep 17 00:00:00 2001 From: Evyatar Date: Sun, 24 Sep 2023 13:03:05 +0200 Subject: [PATCH] types: fix vest.IsolateTest types in tests --- .../__tests__/integration.stateful-async.test.ts | 3 ++- packages/vest/src/core/test/__tests__/memo.test.ts | 5 +++-- .../__tests__/merging_of_previous_test_runs.test.ts | 3 ++- .../src/core/test/__tests__/runAsyncTest.test.ts | 13 +++++++------ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/vest/src/__tests__/integration.stateful-async.test.ts b/packages/vest/src/__tests__/integration.stateful-async.test.ts index 354af8171..a30fa266d 100644 --- a/packages/vest/src/__tests__/integration.stateful-async.test.ts +++ b/packages/vest/src/__tests__/integration.stateful-async.test.ts @@ -3,6 +3,7 @@ import wait from 'wait'; import { dummyTest } from '../testUtils/testDummy'; import { TestPromise } from '../testUtils/testPromise'; +import { TIsolateTest } from 'IsolateTest'; import { Modes } from 'Modes'; import { TFieldName, TGroupName } from 'SuiteResultTypes'; import { VestTest } from 'VestTest'; @@ -119,7 +120,7 @@ describe('Stateful async tests', () => { })); it('Should discard of re-tested async tests', async () => { - const tests: Array = []; + const tests: Array = []; const control = jest.fn(); const suite = vest.create(() => { tests.push( diff --git a/packages/vest/src/core/test/__tests__/memo.test.ts b/packages/vest/src/core/test/__tests__/memo.test.ts index 053428e18..7d8d1e761 100644 --- a/packages/vest/src/core/test/__tests__/memo.test.ts +++ b/packages/vest/src/core/test/__tests__/memo.test.ts @@ -1,9 +1,10 @@ -import { VestTest } from 'VestTest'; import wait from 'wait'; import { TestPromise } from '../../../testUtils/testPromise'; +import { TIsolateTest } from 'IsolateTest'; import { Modes } from 'Modes'; +import { VestTest } from 'VestTest'; import promisify from 'promisify'; import * as vest from 'vest'; import { test as vestTest, enforce } from 'vest'; @@ -118,7 +119,7 @@ describe('test.memo', () => { describe('Test is canceled', () => { it('Should refresh', async () => { let count = 0; - const tests: vest.IsolateTest[] = []; + const tests: TIsolateTest[] = []; const suite = vest.create(() => { count++; diff --git a/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts b/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts index 0b9510818..6edde051c 100644 --- a/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts +++ b/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts @@ -2,13 +2,14 @@ import { TTestSuite, TVestMock } from '../../../testUtils/TVestMock'; import mockThrowError from '../../../testUtils/mockThrowError'; import { dummyTest } from '../../../testUtils/testDummy'; +import { TIsolateTest } from 'IsolateTest'; import { Modes } from 'Modes'; import * as vest from 'vest'; describe('Merging of previous test runs', () => { let suite: TTestSuite; let counter = 0; - let testContainer: vest.IsolateTest[][] = []; + let testContainer: TIsolateTest[][] = []; beforeEach(() => { counter = 0; diff --git a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts index c3a4b17ae..59705a8c1 100644 --- a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts +++ b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts @@ -1,14 +1,15 @@ -import { VestTest } from 'VestTest'; import wait from 'wait'; import { asVestTest } from '../../../testUtils/asVestTest'; +import { TIsolateTest } from 'IsolateTest'; +import { VestTest } from 'VestTest'; import * as vest from 'vest'; describe('runAsyncTest', () => { describe('State Updates', () => { it('Should remove pending status from test object', async () => { - let testObject: void | vest.IsolateTest = undefined; + let testObject: void | TIsolateTest = undefined; const suite = vest.create(() => { testObject = vest.test('field_1', async () => { await wait(100); @@ -94,7 +95,7 @@ describe('runAsyncTest', () => { const cb2 = jest.fn(); const cb3 = jest.fn(); - const testObject: Array = []; + const testObject: Array = []; const suite = vest.create(() => { testObject.push( @@ -123,7 +124,7 @@ describe('runAsyncTest', () => { describe('Final test status', () => { describe('When passing', () => { it('Should set the test status to passing', async () => { - let testObject: void | vest.IsolateTest = undefined; + let testObject: void | TIsolateTest = undefined; const suite = vest.create(() => { testObject = vest.test('field_1', async () => { await wait(100); @@ -140,7 +141,7 @@ describe('runAsyncTest', () => { }); describe('When failing', () => { it('Should set the test status to failing', async () => { - let testObject: void | vest.IsolateTest = undefined; + let testObject: void | TIsolateTest = undefined; const suite = vest.create(() => { testObject = vest.test('field_1', async () => { throw new Error(''); @@ -157,7 +158,7 @@ describe('runAsyncTest', () => { }); describe('When warning', () => { it('Should set the test status to failing', async () => { - let testObject: void | vest.IsolateTest = undefined; + let testObject: void | TIsolateTest = undefined; const suite = vest.create(() => { testObject = vest.test('field_1', async () => { vest.warn();