diff --git a/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts b/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts index 2946b64f0..2fa068a0a 100644 --- a/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts +++ b/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts @@ -12,7 +12,7 @@ import { TFieldName, TGroupName } from 'SuiteResultTypes'; import { TestFn, AsyncTest, TestResult } from 'TestTypes'; import { shouldUseErrorAsMessage } from 'shouldUseErrorMessage'; -export type IsolateTestInput = { +type IsolateTestInput = { message?: string; groupName?: string; fieldName: TFieldName; diff --git a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts index ade530cf5..111cf1782 100644 --- a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts +++ b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts @@ -1,6 +1,7 @@ import wait from 'wait'; -import { asVestTest } from 'asVestTest'; +import { asVestTest } from '../../../../testUtils/asVestTest'; + import * as vest from 'vest'; describe('runAsyncTest', () => { diff --git a/packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts b/packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts index 7e01337a3..ce7a15601 100644 --- a/packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts +++ b/packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts @@ -25,23 +25,23 @@ export function useVerifyTestRun( return testObject; } -export function useShouldOmit(testObject: IsolateTest): boolean { +function useShouldOmit(testObject: IsolateTest): boolean { return ( useWithinActiveOmitWhen() || useIsOptionalFiedApplied(testObject.fieldName) ); } -export function skipTestAndReturn(testNode: IsolateTest): IsolateTest { +function skipTestAndReturn(testNode: IsolateTest): IsolateTest { testNode.skip(); return testNode; } -export function omitTestAndReturn(testNode: IsolateTest): IsolateTest { +function omitTestAndReturn(testNode: IsolateTest): IsolateTest { testNode.omit(); return testNode; } -export function useForceSkipIfInSkipWhen(testNode: IsolateTest): IsolateTest { +function useForceSkipIfInSkipWhen(testNode: IsolateTest): IsolateTest { // We're forcing skipping the pending test // if we're directly within a skipWhen block // This mostly means that we're probably giving diff --git a/packages/vest/src/hooks/__tests__/warn.test.ts b/packages/vest/src/hooks/__tests__/warn.test.ts index 493779639..33676b9c7 100644 --- a/packages/vest/src/hooks/__tests__/warn.test.ts +++ b/packages/vest/src/hooks/__tests__/warn.test.ts @@ -1,14 +1,12 @@ import { faker } from '@faker-js/faker'; +import { asVestTest } from '../../../testUtils/asVestTest'; + import { ErrorStrings } from 'ErrorStrings'; import * as vest from 'vest'; const { create, test, warn } = vest; -function asVestTest(t: unknown): vest.IsolateTest { - return t as vest.IsolateTest; -} - describe('warn hook', () => { describe('When currentTest exists', () => { it('Should set warns to true', () => { diff --git a/packages/vest/src/suiteResult/selectors/hasFailuresByTestObjects.ts b/packages/vest/src/suiteResult/selectors/hasFailuresByTestObjects.ts index d1860ba0e..e6182a50e 100644 --- a/packages/vest/src/suiteResult/selectors/hasFailuresByTestObjects.ts +++ b/packages/vest/src/suiteResult/selectors/hasFailuresByTestObjects.ts @@ -15,7 +15,7 @@ export function hasErrorsByTestObjects(fieldName?: TFieldName): boolean { return hasFailuresByTestObjects(Severity.ERRORS, fieldName); } -export function hasFailuresByTestObjects( +function hasFailuresByTestObjects( severityKey: Severity, fieldName?: TFieldName ): boolean { diff --git a/packages/vest/src/core/test/helpers/asVestTest.ts b/packages/vest/testUtils/asVestTest.ts similarity index 100% rename from packages/vest/src/core/test/helpers/asVestTest.ts rename to packages/vest/testUtils/asVestTest.ts diff --git a/packages/vest/tsconfig.json b/packages/vest/tsconfig.json index abe62c71c..12c47e1de 100644 --- a/packages/vest/tsconfig.json +++ b/packages/vest/tsconfig.json @@ -119,7 +119,6 @@ ], "matchingGroupName": ["./src/core/test/helpers/matchingGroupName.ts"], "matchingFieldName": ["./src/core/test/helpers/matchingFieldName.ts"], - "asVestTest": ["./src/core/test/helpers/asVestTest.ts"], "nonMatchingSeverityProfile.test": [ "./src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts" ],