Skip to content

Commit

Permalink
types: fix vest.IsolateTest types in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Sep 24, 2023
1 parent d05f731 commit 4260f59
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -119,7 +120,7 @@ describe('Stateful async tests', () => {
}));

it('Should discard of re-tested async tests', async () => {
const tests: Array<vest.IsolateTest> = [];
const tests: Array<TIsolateTest> = [];
const control = jest.fn();
const suite = vest.create(() => {
tests.push(
Expand Down
5 changes: 3 additions & 2 deletions packages/vest/src/core/test/__tests__/memo.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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++;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 7 additions & 6 deletions packages/vest/src/core/test/__tests__/runAsyncTest.test.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -94,7 +95,7 @@ describe('runAsyncTest', () => {
const cb2 = jest.fn();
const cb3 = jest.fn();

const testObject: Array<vest.IsolateTest> = [];
const testObject: Array<TIsolateTest> = [];

const suite = vest.create(() => {
testObject.push(
Expand Down Expand Up @@ -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);
Expand All @@ -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('');
Expand All @@ -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();
Expand Down

2 comments on commit 4260f59

@vercel
Copy link

@vercel vercel bot commented on 4260f59 Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vest – ./website

vest-git-latest-ealush.vercel.app
vest-ealush.vercel.app
vest.vercel.app
www.vestjs.dev
vestjs.dev

@vercel
Copy link

@vercel vercel bot commented on 4260f59 Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vest-next – ./website

vest-next-ealush.vercel.app
vest-next-git-latest-ealush.vercel.app
vest-next.vercel.app
vest-website.vercel.app

Please sign in to comment.