diff --git a/packages/vest/src/hooks/__tests__/__snapshots__/each.test.ts.snap b/packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/each.test.ts.snap similarity index 100% rename from packages/vest/src/hooks/__tests__/__snapshots__/each.test.ts.snap rename to packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/each.test.ts.snap diff --git a/packages/vest/src/hooks/__tests__/skipWhen.test.ts b/packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/skipWhen.test.ts similarity index 100% rename from packages/vest/src/hooks/__tests__/skipWhen.test.ts rename to packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/skipWhen.test.ts index 26e89a859..f0884a9fc 100644 --- a/packages/vest/src/hooks/__tests__/skipWhen.test.ts +++ b/packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/skipWhen.test.ts @@ -1,7 +1,7 @@ -import { dummyTest } from '../../../testUtils/testDummy'; - import * as vest from 'vest'; +import { dummyTest } from '../../../testUtils/testDummy'; + describe('skipWhen', () => { let fn = jest.fn(); beforeEach(() => { diff --git a/packages/vest/src/hooks/__tests__/each.test.ts b/packages/vest/src/core/isolate/isolates/__tests__/each.test.ts similarity index 100% rename from packages/vest/src/hooks/__tests__/each.test.ts rename to packages/vest/src/core/isolate/isolates/__tests__/each.test.ts diff --git a/packages/vest/src/hooks/__tests__/group.test.ts b/packages/vest/src/core/isolate/isolates/__tests__/group.test.ts similarity index 99% rename from packages/vest/src/hooks/__tests__/group.test.ts rename to packages/vest/src/core/isolate/isolates/__tests__/group.test.ts index eb1354083..e942691ba 100644 --- a/packages/vest/src/hooks/__tests__/group.test.ts +++ b/packages/vest/src/core/isolate/isolates/__tests__/group.test.ts @@ -2,7 +2,7 @@ import { enforce } from 'enforce'; import faker from 'faker'; import _ from 'lodash'; -import { dummyTest } from '../../../testUtils/testDummy'; +import { dummyTest } from '../../../../../testUtils/testDummy'; import VestTest from 'VestTest'; import group from 'group'; diff --git a/packages/vest/src/hooks/each.ts b/packages/vest/src/core/isolate/isolates/each.ts similarity index 100% rename from packages/vest/src/hooks/each.ts rename to packages/vest/src/core/isolate/isolates/each.ts diff --git a/packages/vest/src/hooks/group.ts b/packages/vest/src/core/isolate/isolates/group.ts similarity index 100% rename from packages/vest/src/hooks/group.ts rename to packages/vest/src/core/isolate/isolates/group.ts diff --git a/packages/vest/src/hooks/skipWhen.ts b/packages/vest/src/core/isolate/isolates/skipWhen.ts similarity index 100% rename from packages/vest/src/hooks/skipWhen.ts rename to packages/vest/src/core/isolate/isolates/skipWhen.ts diff --git a/packages/vest/src/produce/__tests__/done.test.ts b/packages/vest/src/core/suite/produce/__tests__/done.test.ts similarity index 99% rename from packages/vest/src/produce/__tests__/done.test.ts rename to packages/vest/src/core/suite/produce/__tests__/done.test.ts index 091612f03..80ba6ad82 100644 --- a/packages/vest/src/produce/__tests__/done.test.ts +++ b/packages/vest/src/core/suite/produce/__tests__/done.test.ts @@ -1,6 +1,6 @@ import wait from 'wait'; -import { dummyTest } from '../../../testUtils/testDummy'; +import { dummyTest } from '../../../../../testUtils/testDummy'; import * as vest from 'vest'; diff --git a/packages/vest/src/produce/__tests__/isValid.test.ts b/packages/vest/src/core/suite/produce/__tests__/isValid.test.ts similarity index 100% rename from packages/vest/src/produce/__tests__/isValid.test.ts rename to packages/vest/src/core/suite/produce/__tests__/isValid.test.ts diff --git a/packages/vest/src/produce/__tests__/nonMatchingSeverityProfile.test.ts b/packages/vest/src/core/suite/produce/__tests__/nonMatchingSeverityProfile.test.ts similarity index 99% rename from packages/vest/src/produce/__tests__/nonMatchingSeverityProfile.test.ts rename to packages/vest/src/core/suite/produce/__tests__/nonMatchingSeverityProfile.test.ts index 54020eace..9d22db365 100644 --- a/packages/vest/src/produce/__tests__/nonMatchingSeverityProfile.test.ts +++ b/packages/vest/src/core/suite/produce/__tests__/nonMatchingSeverityProfile.test.ts @@ -1,6 +1,7 @@ -import VestTest from 'VestTest'; import nonMatchingSeverityProfile from 'nonMatchingSeverityProfile'; +import VestTest from 'VestTest'; + describe('nonMatchingSeverityProfile', () => { let testObject: VestTest; diff --git a/packages/vest/src/produce/__tests__/produce.test.ts b/packages/vest/src/core/suite/produce/__tests__/produce.test.ts similarity index 96% rename from packages/vest/src/produce/__tests__/produce.test.ts rename to packages/vest/src/core/suite/produce/__tests__/produce.test.ts index 1497c742a..ecaac2080 100644 --- a/packages/vest/src/produce/__tests__/produce.test.ts +++ b/packages/vest/src/core/suite/produce/__tests__/produce.test.ts @@ -1,10 +1,10 @@ -import itWithContext from '../../../testUtils/itWithContext'; -import { dummyTest } from '../../../testUtils/testDummy'; -import { setTestObjects } from '../../../testUtils/testObjects'; - import { produceFullResult } from 'produce'; import { produceDraft } from 'produceDraft'; +import itWithContext from '../../../../../testUtils/itWithContext'; +import { dummyTest } from '../../../../../testUtils/testDummy'; +import { setTestObjects } from '../../../../../testUtils/testObjects'; + const methods = { produceDraft, produceFullResult, diff --git a/packages/vest/src/produce/genTestsSummary.ts b/packages/vest/src/core/suite/produce/genTestsSummary.ts similarity index 100% rename from packages/vest/src/produce/genTestsSummary.ts rename to packages/vest/src/core/suite/produce/genTestsSummary.ts diff --git a/packages/vest/src/produce/getFailures/__tests__/__snapshots__/collectFailureMessages.test.ts.snap b/packages/vest/src/core/suite/produce/getFailures/__tests__/__snapshots__/collectFailureMessages.test.ts.snap similarity index 100% rename from packages/vest/src/produce/getFailures/__tests__/__snapshots__/collectFailureMessages.test.ts.snap rename to packages/vest/src/core/suite/produce/getFailures/__tests__/__snapshots__/collectFailureMessages.test.ts.snap diff --git a/packages/vest/src/produce/getFailures/__tests__/collectFailureMessages.test.ts b/packages/vest/src/core/suite/produce/getFailures/__tests__/collectFailureMessages.test.ts similarity index 100% rename from packages/vest/src/produce/getFailures/__tests__/collectFailureMessages.test.ts rename to packages/vest/src/core/suite/produce/getFailures/__tests__/collectFailureMessages.test.ts diff --git a/packages/vest/src/produce/getFailures/__tests__/getFailures.test.ts b/packages/vest/src/core/suite/produce/getFailures/__tests__/getFailures.test.ts similarity index 95% rename from packages/vest/src/produce/getFailures/__tests__/getFailures.test.ts rename to packages/vest/src/core/suite/produce/getFailures/__tests__/getFailures.test.ts index 58843e8c7..9ff205292 100644 --- a/packages/vest/src/produce/getFailures/__tests__/getFailures.test.ts +++ b/packages/vest/src/core/suite/produce/getFailures/__tests__/getFailures.test.ts @@ -1,10 +1,10 @@ -import itWithContext from '../../../../testUtils/itWithContext'; -import { dummyTest } from '../../../../testUtils/testDummy'; -import { setTestObjects } from '../../../../testUtils/testObjects'; - import { produceFullResult } from 'produce'; import { produceDraft } from 'produceDraft'; +import itWithContext from '../../../../../../testUtils/itWithContext'; +import { dummyTest } from '../../../../../../testUtils/testDummy'; +import { setTestObjects } from '../../../../../../testUtils/testObjects'; + const methods = { produceDraft, produceFullResult, diff --git a/packages/vest/src/produce/getFailures/__tests__/getFailuresByGroup.test.ts b/packages/vest/src/core/suite/produce/getFailures/__tests__/getFailuresByGroup.test.ts similarity index 96% rename from packages/vest/src/produce/getFailures/__tests__/getFailuresByGroup.test.ts rename to packages/vest/src/core/suite/produce/getFailures/__tests__/getFailuresByGroup.test.ts index bad042538..3acdd4599 100644 --- a/packages/vest/src/produce/getFailures/__tests__/getFailuresByGroup.test.ts +++ b/packages/vest/src/core/suite/produce/getFailures/__tests__/getFailuresByGroup.test.ts @@ -1,10 +1,10 @@ -import itWithContext from '../../../../testUtils/itWithContext'; -import { dummyTest } from '../../../../testUtils/testDummy'; -import { setTestObjects } from '../../../../testUtils/testObjects'; - import { produceFullResult } from 'produce'; import { produceDraft } from 'produceDraft'; +import itWithContext from '../../../../../../testUtils/itWithContext'; +import { dummyTest } from '../../../../../../testUtils/testDummy'; +import { setTestObjects } from '../../../../../../testUtils/testObjects'; + const methods = { produceDraft, produceFullResult, diff --git a/packages/vest/src/produce/getFailures/collectFailureMessages.ts b/packages/vest/src/core/suite/produce/getFailures/collectFailureMessages.ts similarity index 100% rename from packages/vest/src/produce/getFailures/collectFailureMessages.ts rename to packages/vest/src/core/suite/produce/getFailures/collectFailureMessages.ts diff --git a/packages/vest/src/produce/getFailures/getFailures.ts b/packages/vest/src/core/suite/produce/getFailures/getFailures.ts similarity index 100% rename from packages/vest/src/produce/getFailures/getFailures.ts rename to packages/vest/src/core/suite/produce/getFailures/getFailures.ts diff --git a/packages/vest/src/produce/getFailures/getFailuresArrayOrObject.ts b/packages/vest/src/core/suite/produce/getFailures/getFailuresArrayOrObject.ts similarity index 100% rename from packages/vest/src/produce/getFailures/getFailuresArrayOrObject.ts rename to packages/vest/src/core/suite/produce/getFailures/getFailuresArrayOrObject.ts diff --git a/packages/vest/src/produce/getFailures/getFailuresByGroup.ts b/packages/vest/src/core/suite/produce/getFailures/getFailuresByGroup.ts similarity index 100% rename from packages/vest/src/produce/getFailures/getFailuresByGroup.ts rename to packages/vest/src/core/suite/produce/getFailures/getFailuresByGroup.ts diff --git a/packages/vest/src/produce/hasFailures/__tests__/hasFailures.test.ts b/packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailures.test.ts similarity index 95% rename from packages/vest/src/produce/hasFailures/__tests__/hasFailures.test.ts rename to packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailures.test.ts index 1289ab71b..2f69ff8a7 100644 --- a/packages/vest/src/produce/hasFailures/__tests__/hasFailures.test.ts +++ b/packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailures.test.ts @@ -1,11 +1,11 @@ import faker from 'faker'; -import itWithContext from '../../../../testUtils/itWithContext'; -import { dummyTest } from '../../../../testUtils/testDummy'; +import itWithContext from '../../../../../../testUtils/itWithContext'; +import { dummyTest } from '../../../../../../testUtils/testDummy'; import { setTestObjects, emptyTestObjects, -} from '../../../../testUtils/testObjects'; +} from '../../../../../../testUtils/testObjects'; import { produceFullResult } from 'produce'; import { produceDraft } from 'produceDraft'; diff --git a/packages/vest/src/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts b/packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts similarity index 95% rename from packages/vest/src/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts rename to packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts index b3514dd04..cf069a1e7 100644 --- a/packages/vest/src/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts +++ b/packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailuresByGroup.test.ts @@ -1,13 +1,12 @@ import faker from 'faker'; +import { hasErrorsByGroup, hasWarningsByGroup } from 'hasFailuresByGroup'; -import itWithContext from '../../../../testUtils/itWithContext'; -import { dummyTest } from '../../../../testUtils/testDummy'; +import itWithContext from '../../../../../../testUtils/itWithContext'; +import { dummyTest } from '../../../../../../testUtils/testDummy'; import { emptyTestObjects, setTestObjects, -} from '../../../../testUtils/testObjects'; - -import { hasErrorsByGroup, hasWarningsByGroup } from 'hasFailuresByGroup'; +} from '../../../../../../testUtils/testObjects'; const fieldName = faker.random.word(); const groupName = faker.lorem.word(); diff --git a/packages/vest/src/produce/hasFailures/__tests__/hasFailuresLogic.test.ts b/packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailuresLogic.test.ts similarity index 100% rename from packages/vest/src/produce/hasFailures/__tests__/hasFailuresLogic.test.ts rename to packages/vest/src/core/suite/produce/hasFailures/__tests__/hasFailuresLogic.test.ts diff --git a/packages/vest/src/produce/hasFailures/hasFailures.ts b/packages/vest/src/core/suite/produce/hasFailures/hasFailures.ts similarity index 100% rename from packages/vest/src/produce/hasFailures/hasFailures.ts rename to packages/vest/src/core/suite/produce/hasFailures/hasFailures.ts diff --git a/packages/vest/src/produce/hasFailures/hasFailuresByGroup.ts b/packages/vest/src/core/suite/produce/hasFailures/hasFailuresByGroup.ts similarity index 100% rename from packages/vest/src/produce/hasFailures/hasFailuresByGroup.ts rename to packages/vest/src/core/suite/produce/hasFailures/hasFailuresByGroup.ts diff --git a/packages/vest/src/produce/hasFailures/hasFailuresLogic.ts b/packages/vest/src/core/suite/produce/hasFailures/hasFailuresLogic.ts similarity index 100% rename from packages/vest/src/produce/hasFailures/hasFailuresLogic.ts rename to packages/vest/src/core/suite/produce/hasFailures/hasFailuresLogic.ts diff --git a/packages/vest/src/produce/isValid.ts b/packages/vest/src/core/suite/produce/isValid.ts similarity index 100% rename from packages/vest/src/produce/isValid.ts rename to packages/vest/src/core/suite/produce/isValid.ts diff --git a/packages/vest/src/produce/matchingFieldName.ts b/packages/vest/src/core/suite/produce/matchingFieldName.ts similarity index 100% rename from packages/vest/src/produce/matchingFieldName.ts rename to packages/vest/src/core/suite/produce/matchingFieldName.ts diff --git a/packages/vest/src/produce/nonMatchingSeverityProfile.ts b/packages/vest/src/core/suite/produce/nonMatchingSeverityProfile.ts similarity index 100% rename from packages/vest/src/produce/nonMatchingSeverityProfile.ts rename to packages/vest/src/core/suite/produce/nonMatchingSeverityProfile.ts diff --git a/packages/vest/src/produce/produce.ts b/packages/vest/src/core/suite/produce/produce.ts similarity index 100% rename from packages/vest/src/produce/produce.ts rename to packages/vest/src/core/suite/produce/produce.ts diff --git a/packages/vest/src/produce/produceDraft.ts b/packages/vest/src/core/suite/produce/produceDraft.ts similarity index 100% rename from packages/vest/src/produce/produceDraft.ts rename to packages/vest/src/core/suite/produce/produceDraft.ts diff --git a/packages/vest/src/produce/runCallbacks.ts b/packages/vest/src/core/suite/produce/runCallbacks.ts similarity index 100% rename from packages/vest/src/produce/runCallbacks.ts rename to packages/vest/src/core/suite/produce/runCallbacks.ts diff --git a/packages/vest/src/hooks/__tests__/__snapshots__/skipWhen.test.ts.snap b/packages/vest/src/hooks/__tests__/__snapshots__/skipWhen.test.ts.snap deleted file mode 100644 index 35d6f3c47..000000000 --- a/packages/vest/src/hooks/__tests__/__snapshots__/skipWhen.test.ts.snap +++ /dev/null @@ -1,87 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`skipWhen Should pass result draft to the functional condition 1`] = ` -Object { - "errorCount": 0, - "getErrors": [Function], - "getErrorsByGroup": [Function], - "getWarnings": [Function], - "getWarningsByGroup": [Function], - "groups": Object {}, - "hasErrors": [Function], - "hasErrorsByGroup": [Function], - "hasWarnings": [Function], - "hasWarningsByGroup": [Function], - "isValid": [Function], - "suiteName": undefined, - "testCount": 0, - "tests": Object {}, - "warnCount": 0, -} -`; - -exports[`skipWhen Should pass result draft to the functional condition 2`] = ` -Object { - "errorCount": 1, - "getErrors": [Function], - "getErrorsByGroup": [Function], - "getWarnings": [Function], - "getWarningsByGroup": [Function], - "groups": Object {}, - "hasErrors": [Function], - "hasErrorsByGroup": [Function], - "hasWarnings": [Function], - "hasWarningsByGroup": [Function], - "isValid": [Function], - "suiteName": undefined, - "testCount": 1, - "tests": Object { - "f1": Object { - "errorCount": 1, - "errors": Array [ - "msg", - ], - "testCount": 1, - "warnCount": 0, - }, - }, - "warnCount": 0, -} -`; - -exports[`skipWhen Should pass result draft to the functional condition 3`] = ` -Object { - "errorCount": 2, - "getErrors": [Function], - "getErrorsByGroup": [Function], - "getWarnings": [Function], - "getWarningsByGroup": [Function], - "groups": Object {}, - "hasErrors": [Function], - "hasErrorsByGroup": [Function], - "hasWarnings": [Function], - "hasWarningsByGroup": [Function], - "isValid": [Function], - "suiteName": undefined, - "testCount": 2, - "tests": Object { - "f1": Object { - "errorCount": 1, - "errors": Array [ - "msg", - ], - "testCount": 1, - "warnCount": 0, - }, - "f2": Object { - "errorCount": 1, - "errors": Array [ - "msg", - ], - "testCount": 1, - "warnCount": 0, - }, - }, - "warnCount": 0, -} -`; diff --git a/tsconfig.json b/tsconfig.json index 77f6bc3f8..b433fb7e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -117,6 +117,9 @@ "ctx": ["./packages/vest/src/core/ctx/ctx.ts"], "testCursor": ["./packages/vest/src/core/ctx/testCursor.ts"], "isolate": ["./packages/vest/src/core/isolate/isolate.ts"], + "each": ["./packages/vest/src/core/isolate/isolates/each.ts"], + "group": ["./packages/vest/src/core/isolate/isolates/group.ts"], + "skipWhen": ["./packages/vest/src/core/isolate/isolates/skipWhen.ts"], "IsolateTypes": ["./packages/vest/src/core/isolate/IsolateTypes.ts"], "createStateRef": ["./packages/vest/src/core/state/createStateRef.ts"], "stateHooks": ["./packages/vest/src/core/state/stateHooks.ts"], @@ -124,6 +127,44 @@ "hasRemainingTests": [ "./packages/vest/src/core/suite/hasRemainingTests.ts" ], + "genTestsSummary": [ + "./packages/vest/src/core/suite/produce/genTestsSummary.ts" + ], + "collectFailureMessages": [ + "./packages/vest/src/core/suite/produce/getFailures/collectFailureMessages.ts" + ], + "getFailures": [ + "./packages/vest/src/core/suite/produce/getFailures/getFailures.ts" + ], + "getFailuresArrayOrObject": [ + "./packages/vest/src/core/suite/produce/getFailures/getFailuresArrayOrObject.ts" + ], + "getFailuresByGroup": [ + "./packages/vest/src/core/suite/produce/getFailures/getFailuresByGroup.ts" + ], + "hasFailures": [ + "./packages/vest/src/core/suite/produce/hasFailures/hasFailures.ts" + ], + "hasFailuresByGroup": [ + "./packages/vest/src/core/suite/produce/hasFailures/hasFailuresByGroup.ts" + ], + "hasFailuresLogic": [ + "./packages/vest/src/core/suite/produce/hasFailures/hasFailuresLogic.ts" + ], + "isValid": ["./packages/vest/src/core/suite/produce/isValid.ts"], + "matchingFieldName": [ + "./packages/vest/src/core/suite/produce/matchingFieldName.ts" + ], + "nonMatchingSeverityProfile": [ + "./packages/vest/src/core/suite/produce/nonMatchingSeverityProfile.ts" + ], + "produce": ["./packages/vest/src/core/suite/produce/produce.ts"], + "produceDraft": [ + "./packages/vest/src/core/suite/produce/produceDraft.ts" + ], + "runCallbacks": [ + "./packages/vest/src/core/suite/produce/runCallbacks.ts" + ], "key": ["./packages/vest/src/core/test/key.ts"], "cancelOverriddenPendingTest": [ "./packages/vest/src/core/test/lib/cancelOverriddenPendingTest.ts" @@ -159,39 +200,10 @@ "enforce@schema": ["./packages/vest/src/exports/enforce@schema.ts"], "parser": ["./packages/vest/src/exports/parser.ts"], "promisify": ["./packages/vest/src/exports/promisify.ts"], - "each": ["./packages/vest/src/hooks/each.ts"], "exclusive": ["./packages/vest/src/hooks/exclusive.ts"], - "group": ["./packages/vest/src/hooks/group.ts"], "hookErrors": ["./packages/vest/src/hooks/hookErrors.ts"], "optionalTests": ["./packages/vest/src/hooks/optionalTests.ts"], - "skipWhen": ["./packages/vest/src/hooks/skipWhen.ts"], "warn": ["./packages/vest/src/hooks/warn.ts"], - "genTestsSummary": ["./packages/vest/src/produce/genTestsSummary.ts"], - "collectFailureMessages": [ - "./packages/vest/src/produce/getFailures/collectFailureMessages.ts" - ], - "getFailures": ["./packages/vest/src/produce/getFailures/getFailures.ts"], - "getFailuresArrayOrObject": [ - "./packages/vest/src/produce/getFailures/getFailuresArrayOrObject.ts" - ], - "getFailuresByGroup": [ - "./packages/vest/src/produce/getFailures/getFailuresByGroup.ts" - ], - "hasFailures": ["./packages/vest/src/produce/hasFailures/hasFailures.ts"], - "hasFailuresByGroup": [ - "./packages/vest/src/produce/hasFailures/hasFailuresByGroup.ts" - ], - "hasFailuresLogic": [ - "./packages/vest/src/produce/hasFailures/hasFailuresLogic.ts" - ], - "isValid": ["./packages/vest/src/produce/isValid.ts"], - "matchingFieldName": ["./packages/vest/src/produce/matchingFieldName.ts"], - "nonMatchingSeverityProfile": [ - "./packages/vest/src/produce/nonMatchingSeverityProfile.ts" - ], - "produce": ["./packages/vest/src/produce/produce.ts"], - "produceDraft": ["./packages/vest/src/produce/produceDraft.ts"], - "runCallbacks": ["./packages/vest/src/produce/runCallbacks.ts"], "vest.d": ["./packages/vest/src/typings/vest.d.ts"], "vest": ["./packages/vest/src/vest.ts"], "vestTypes": ["./packages/vest/src/vestTypes.ts"]