vest 5.0.2-dev-d315d9 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -2
- package/SuiteSerializer/package.json +9 -0
- package/dist/cjs/SuiteSerializer.development.js +19 -0
- package/dist/cjs/SuiteSerializer.js +6 -0
- package/dist/cjs/SuiteSerializer.production.js +1 -0
- package/dist/cjs/classnames.development.js +19 -1
- package/dist/cjs/classnames.js +0 -1
- package/dist/cjs/classnames.production.js +1 -1
- package/dist/cjs/compose.js +2 -3
- package/dist/cjs/compounds.js +2 -3
- package/dist/cjs/date.js +6 -0
- package/dist/cjs/email.js +6 -0
- package/dist/cjs/enforce/compose.development.js +1 -5
- package/dist/cjs/enforce/compose.production.js +1 -1
- package/dist/cjs/enforce/compounds.development.js +3 -6
- package/dist/cjs/enforce/compounds.production.js +1 -1
- package/dist/cjs/enforce/date.development.js +26 -0
- package/dist/cjs/enforce/date.production.js +1 -0
- package/dist/cjs/enforce/email.development.js +26 -0
- package/dist/cjs/enforce/email.production.js +1 -0
- package/dist/cjs/enforce/isURL.development.js +26 -0
- package/dist/cjs/enforce/isURL.production.js +1 -0
- package/dist/cjs/enforce/schema.development.js +3 -6
- package/dist/cjs/enforce/schema.production.js +1 -1
- package/dist/cjs/isURL.js +6 -0
- package/dist/cjs/parser.development.js +20 -4
- package/dist/cjs/parser.js +0 -1
- package/dist/cjs/parser.production.js +1 -1
- package/dist/cjs/promisify.development.js +18 -1
- package/dist/cjs/promisify.js +0 -1
- package/dist/cjs/promisify.production.js +1 -1
- package/dist/cjs/schema.js +2 -3
- package/dist/cjs/vest.development.js +1466 -1554
- package/dist/cjs/vest.js +0 -1
- package/dist/cjs/vest.production.js +1 -1
- package/dist/es/SuiteSerializer.development.js +17 -0
- package/dist/es/SuiteSerializer.production.js +1 -0
- package/dist/es/classnames.development.js +19 -1
- package/dist/es/classnames.production.js +1 -1
- package/dist/es/enforce/date.development.js +2 -0
- package/dist/es/enforce/date.production.js +1 -0
- package/dist/es/enforce/email.development.js +2 -0
- package/dist/es/enforce/email.production.js +1 -0
- package/dist/es/enforce/isURL.development.js +2 -0
- package/dist/es/enforce/isURL.production.js +1 -0
- package/dist/es/parser.development.js +20 -2
- package/dist/es/parser.production.js +1 -1
- package/dist/es/promisify.development.js +18 -1
- package/dist/es/promisify.production.js +1 -1
- package/dist/es/vest.development.js +1476 -1562
- package/dist/es/vest.production.js +1 -1
- package/dist/umd/SuiteSerializer.development.js +23 -0
- package/dist/umd/SuiteSerializer.production.js +1 -0
- package/dist/umd/classnames.development.js +19 -1
- package/dist/umd/classnames.production.js +1 -1
- package/dist/umd/enforce/compose.development.js +1 -7
- package/dist/umd/enforce/compose.production.js +1 -1
- package/dist/umd/enforce/compounds.development.js +3 -6
- package/dist/umd/enforce/compounds.production.js +1 -1
- package/dist/umd/enforce/date.development.js +30 -0
- package/dist/umd/enforce/date.production.js +1 -0
- package/dist/umd/enforce/email.development.js +30 -0
- package/dist/umd/enforce/email.production.js +1 -0
- package/dist/umd/enforce/isURL.development.js +30 -0
- package/dist/umd/enforce/isURL.production.js +1 -0
- package/dist/umd/enforce/schema.development.js +3 -6
- package/dist/umd/enforce/schema.production.js +1 -1
- package/dist/umd/parser.development.js +23 -7
- package/dist/umd/parser.production.js +1 -1
- package/dist/umd/promisify.development.js +18 -1
- package/dist/umd/promisify.production.js +1 -1
- package/dist/umd/vest.development.js +1480 -1569
- package/dist/umd/vest.production.js +1 -1
- package/enforce/date/package.json +9 -0
- package/enforce/email/package.json +9 -0
- package/enforce/isURL/package.json +9 -0
- package/package.json +254 -132
- package/types/SuiteSerializer.d.ts +201 -0
- package/types/SuiteSerializer.d.ts.map +1 -0
- package/types/classnames.d.ts +91 -33
- package/types/classnames.d.ts.map +1 -1
- package/types/enforce/date.d.ts +2 -0
- package/types/enforce/date.d.ts.map +1 -0
- package/types/enforce/email.d.ts +2 -0
- package/types/enforce/email.d.ts.map +1 -0
- package/types/enforce/isURL.d.ts +2 -0
- package/types/enforce/isURL.d.ts.map +1 -0
- package/types/parser.d.ts +86 -31
- package/types/parser.d.ts.map +1 -1
- package/types/promisify.d.ts +82 -28
- package/types/promisify.d.ts.map +1 -1
- package/types/vest.d.ts +275 -208
- package/types/vest.d.ts.map +1 -1
- package/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap +0 -71
- package/src/__tests__/__snapshots__/integration.base.test.ts.snap +0 -71
- package/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap +0 -243
- package/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap +0 -376
- package/src/__tests__/integration.async-tests.test.ts +0 -90
- package/src/__tests__/integration.base.test.ts +0 -45
- package/src/__tests__/integration.exclusive.test.ts +0 -88
- package/src/__tests__/integration.stateful-async.test.ts +0 -137
- package/src/__tests__/integration.stateful-tests.test.ts +0 -155
- package/src/__tests__/isolate.test.ts +0 -288
- package/src/__tests__/state_refill.test.ts +0 -41
- package/src/core/SuiteWalker/SuiteWalker.ts +0 -64
- package/src/core/SuiteWalker/__tests__/hasRemainingTests.test.ts +0 -130
- package/src/core/VestBus/VestBus.ts +0 -78
- package/src/core/context/PersistedContext.ts +0 -243
- package/src/core/context/SuiteContext.ts +0 -74
- package/src/core/isolate/IsolateTest/IsolateTest.ts +0 -213
- package/src/core/isolate/IsolateTest/IsolateTestReconciler.ts +0 -156
- package/src/core/isolate/IsolateTest/IsolateTestStateMachine.ts +0 -69
- package/src/core/isolate/IsolateTest/SimpleStateMachine.ts +0 -43
- package/src/core/isolate/IsolateTest/TestWalker.ts +0 -77
- package/src/core/isolate/IsolateTypes.ts +0 -10
- package/src/core/isolate/isIsolate.ts +0 -6
- package/src/core/isolate/isolate.ts +0 -110
- package/src/core/isolate/reconciler/Reconciler/Reconciler.ts +0 -123
- package/src/core/isolate/reconciler/cancelOverriddenPendingTest.ts +0 -15
- package/src/core/isolate/reconciler/isSameProfileTest.ts +0 -12
- package/src/core/isolate/walker.ts +0 -127
- package/src/core/test/TestTypes.ts +0 -3
- package/src/core/test/__tests__/IsolateTest.test.ts +0 -152
- package/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap +0 -39
- package/src/core/test/__tests__/__snapshots__/memo.test.ts.snap +0 -101
- package/src/core/test/__tests__/__snapshots__/test.test.ts.snap +0 -231
- package/src/core/test/__tests__/key.test.ts +0 -195
- package/src/core/test/__tests__/memo.test.ts +0 -218
- package/src/core/test/__tests__/merging_of_previous_test_runs.test.ts +0 -341
- package/src/core/test/__tests__/runAsyncTest.test.ts +0 -175
- package/src/core/test/__tests__/test.test.ts +0 -226
- package/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts +0 -52
- package/src/core/test/helpers/asVestTest.ts +0 -9
- package/src/core/test/helpers/matchingFieldName.ts +0 -16
- package/src/core/test/helpers/matchingGroupName.ts +0 -12
- package/src/core/test/helpers/nonMatchingSeverityProfile.ts +0 -14
- package/src/core/test/helpers/shouldUseErrorMessage.ts +0 -9
- package/src/core/test/test.memo.ts +0 -81
- package/src/core/test/test.ts +0 -64
- package/src/core/test/testLevelFlowControl/runTest.ts +0 -86
- package/src/core/test/testLevelFlowControl/verifyTestRun.ts +0 -32
- package/src/core/test/testObjectIsolate.ts +0 -11
- package/src/errors/ErrorStrings.ts +0 -4
- package/src/exports/__tests__/classnames.test.ts +0 -92
- package/src/exports/__tests__/parser.test.ts +0 -441
- package/src/exports/__tests__/promisify.test.ts +0 -77
- package/src/exports/classnames.ts +0 -35
- package/src/exports/enforce@compose.ts +0 -1
- package/src/exports/enforce@compounds.ts +0 -1
- package/src/exports/enforce@schema.ts +0 -1
- package/src/exports/parser.ts +0 -63
- package/src/exports/promisify.ts +0 -18
- package/src/hooks/__tests__/__snapshots__/include.test.ts.snap +0 -794
- package/src/hooks/__tests__/eager.test.ts +0 -130
- package/src/hooks/__tests__/exclusive.test.ts +0 -578
- package/src/hooks/__tests__/include.test.ts +0 -431
- package/src/hooks/__tests__/optional.test.ts +0 -83
- package/src/hooks/__tests__/warn.test.ts +0 -42
- package/src/hooks/exclusive.ts +0 -179
- package/src/hooks/include.ts +0 -54
- package/src/hooks/mode.ts +0 -47
- package/src/hooks/optional/OptionalTypes.ts +0 -31
- package/src/hooks/optional/optional.ts +0 -69
- package/src/hooks/warn.ts +0 -19
- package/src/isolates/__tests__/__snapshots__/each.test.ts.snap +0 -3
- package/src/isolates/__tests__/__snapshots__/group.test.ts.snap +0 -114
- package/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap +0 -443
- package/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap +0 -99
- package/src/isolates/__tests__/each.test.ts +0 -35
- package/src/isolates/__tests__/group.test.ts +0 -362
- package/src/isolates/__tests__/omitWhen.test.ts +0 -246
- package/src/isolates/__tests__/skipWhen.test.ts +0 -163
- package/src/isolates/each.ts +0 -30
- package/src/isolates/group.ts +0 -9
- package/src/isolates/omitWhen.ts +0 -41
- package/src/isolates/skipWhen.ts +0 -42
- package/src/suite/__tests__/__snapshots__/create.test.ts.snap +0 -67
- package/src/suite/__tests__/create.test.ts +0 -109
- package/src/suite/__tests__/remove.test.ts +0 -50
- package/src/suite/__tests__/resetField.test.ts +0 -74
- package/src/suite/createSuite.ts +0 -94
- package/src/suite/runCallbacks.ts +0 -28
- package/src/suiteResult/Severity.ts +0 -15
- package/src/suiteResult/SuiteResultTypes.ts +0 -42
- package/src/suiteResult/__tests__/done.test.ts +0 -334
- package/src/suiteResult/__tests__/produce.test.ts +0 -163
- package/src/suiteResult/done/deferDoneCallback.ts +0 -28
- package/src/suiteResult/done/shouldSkipDoneRegistration.ts +0 -20
- package/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap +0 -89
- package/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts +0 -124
- package/src/suiteResult/selectors/__tests__/getFailures.test.ts +0 -158
- package/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts +0 -199
- package/src/suiteResult/selectors/__tests__/hasFailures.test.ts +0 -141
- package/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts +0 -185
- package/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts +0 -88
- package/src/suiteResult/selectors/__tests__/isValid.test.ts +0 -359
- package/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts +0 -480
- package/src/suiteResult/selectors/collectFailures.ts +0 -43
- package/src/suiteResult/selectors/hasFailuresByTestObjects.ts +0 -62
- package/src/suiteResult/selectors/produceSuiteSummary.ts +0 -135
- package/src/suiteResult/selectors/shouldAddValidProperty.ts +0 -148
- package/src/suiteResult/selectors/suiteSelectors.ts +0 -199
- package/src/suiteResult/suiteResult.ts +0 -15
- package/src/suiteResult/suiteRunResult.ts +0 -43
- package/src/vest.ts +0 -36
- package/testUtils/TVestMock.ts +0 -5
- package/testUtils/__tests__/partition.test.ts +0 -21
- package/testUtils/mockThrowError.ts +0 -16
- package/testUtils/partition.ts +0 -13
- package/testUtils/suiteDummy.ts +0 -109
- package/testUtils/testDummy.ts +0 -157
- package/testUtils/testPromise.ts +0 -3
- package/tsconfig.json +0 -90
package/README.md
CHANGED
|
@@ -1,3 +1,95 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vest - Declarative validations framework
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[Vest Documentation](https://vestjs.dev)
|
|
6
|
+
|
|
7
|
+
[](https://discord.gg/WmADZpJnSe) [](https://github.com/ealush/vest) [](https://vestjs.dev/vest-5-is-ready) [](https://www.npmjs.com/package/vest) [](https://www.npmjs.com/package/vest) [](https://bundlephobia.com/package/vest) [](https://github.com/ealush/vest/actions)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Vest is a declarative validations framework designed to simplify the process of writing and maintaining form validations for your web application. Inspired by popular unit testing libraries such as Mocha and Jest, Vest allows developers to describe their validation requirements using a suite-like syntax, separating validation logic from feature logic to create more maintainable and readable code.
|
|
12
|
+
|
|
13
|
+
Vest's framework-agnostic approach means that it can be used with any UI framework, or without any framework at all. With Vest, you can reduce code bloat, improve feature readability and maintainability, and enhance the user experience of your web application.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
test('username', 'Username is required', () => {
|
|
17
|
+
enforce(data.username).isNotBlank();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('username', 'Username must be at least 3 chars', () => {
|
|
21
|
+
enforce(data.username).longerThanOrEquals(3);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('username', 'Username already taken', async () => {
|
|
25
|
+
await doesUserExist(data.username);
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
npm i vest
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Motivation
|
|
36
|
+
|
|
37
|
+
Building web applications often involves writing complex forms that require validation. As the complexity of these forms increases, so does the complexity of the validation logic required to ensure data is accurate and complete.
|
|
38
|
+
|
|
39
|
+
At this point, developers may start to experience issues with code bloat, poor maintainability, and difficulty in managing validation logic across different features of an application. This can lead to bugs, errors, and a poor user experience.
|
|
40
|
+
|
|
41
|
+
Vest was designed to address these issues by providing a simple, intuitive way to write form validation that is easy to learn, scalable, and extensible. By separating validation logic from feature logic, Vest helps developers create maintainable code that is easy to update, debug, and refactor.
|
|
42
|
+
|
|
43
|
+
With Vest, developers can reduce the complexity and increase the readability of their code, leading to more efficient development cycles, fewer bugs, and a better user experience overall.
|
|
44
|
+
|
|
45
|
+
# Why Vest?
|
|
46
|
+
|
|
47
|
+
Writing form validations can be time-consuming and complex, especially as your web application grows and evolves over time. Vest simplifies the process by providing a set of powerful tools that take care of the annoying parts for you, such as managing validation state and handling async validations.
|
|
48
|
+
|
|
49
|
+
Vest's declarative syntax is also designed to be easy to learn, especially for developers who are already familiar with unit testing frameworks. With Vest, you can leverage your existing knowledge to write effective form validations quickly and easily.
|
|
50
|
+
|
|
51
|
+
### 💡 Easy to Learn
|
|
52
|
+
|
|
53
|
+
Vest adopts the syntax and style of unit testing frameworks, so you can leverage the knowledge you already have to write your form validations.
|
|
54
|
+
|
|
55
|
+
### 🎨 Framework Agnostic
|
|
56
|
+
|
|
57
|
+
Vest is framework-agnostic, which means you can use it with any UI framework out there.
|
|
58
|
+
|
|
59
|
+
### 🧠 Takes Care of the Annoying Parts
|
|
60
|
+
|
|
61
|
+
Vest manages its validation state, handles async validations, and much more, so you don't have to.
|
|
62
|
+
|
|
63
|
+
### 🧩 Extendable
|
|
64
|
+
|
|
65
|
+
You can easily add new kinds of validations to Vest according to your needs.
|
|
66
|
+
|
|
67
|
+
### ♻️ Reusable Validation Logic
|
|
68
|
+
|
|
69
|
+
Validation logic in Vest can be shared across multiple features in your app, making it easy to maintain and refactor your codebase.
|
|
70
|
+
|
|
71
|
+
### 🧬 Supports Declarative Syntax
|
|
72
|
+
|
|
73
|
+
Vest's declarative syntax makes it easy to describe your form or feature structure and write clear, concise validations.
|
|
74
|
+
|
|
75
|
+
### 🧪 Promotes Testing and Debugging
|
|
76
|
+
|
|
77
|
+
By separating validation logic from feature logic, Vest makes it easier to test and debug your code, which can save you time and reduce errors.
|
|
78
|
+
|
|
79
|
+
# Getting Started
|
|
80
|
+
|
|
81
|
+
[Vest Documentation](https://vestjs.dev)
|
|
82
|
+
|
|
83
|
+
Here are some code sandboxes to get you started:
|
|
84
|
+
|
|
85
|
+
- [React](https://codesandbox.io/s/react-vest-5-gdc698?file=/src/suite.js)
|
|
86
|
+
- [Vue](https://codesandbox.io/s/vue-vest-5-d1g236?file=/src/suite.js)
|
|
87
|
+
- [Svelte](https://codesandbox.io/s/svelte-vest-5-imnq9z?file=/suite.js)
|
|
88
|
+
- [Vanilla](https://codesandbox.io/s/vest-vanilla-js-vest-5-3v4pqk?file=/src/suite.js)
|
|
89
|
+
- [Angular](https://github.com/wardbell/ngc-validate) (by @wardbell)
|
|
90
|
+
|
|
91
|
+
# Contribute
|
|
92
|
+
|
|
93
|
+
Information describing how to contribute can be found here:
|
|
94
|
+
|
|
95
|
+
https://github.com/ealush/vest/blob/latest/CONTRIBUTING.md
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../dist/cjs/SuiteSerializer.js",
|
|
3
|
+
"module": "../dist/es/SuiteSerializer.production.js",
|
|
4
|
+
"unpkg": "../dist/umd/SuiteSerializer.production.js",
|
|
5
|
+
"jsdelivr": "../dist/umd/SuiteSerializer.production.js",
|
|
6
|
+
"name": "SuiteSerializer",
|
|
7
|
+
"types": "../types/SuiteSerializer.d.ts",
|
|
8
|
+
"private": true
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vestjsRuntime = require('vestjs-runtime');
|
|
4
|
+
|
|
5
|
+
class SuiteSerializer {
|
|
6
|
+
static serialize(suite) {
|
|
7
|
+
const dump = Object.assign(Object.assign({}, suite.dump()), { output: undefined });
|
|
8
|
+
return vestjsRuntime.IsolateSerializer.serialize(dump);
|
|
9
|
+
}
|
|
10
|
+
static deserialize(serialized) {
|
|
11
|
+
return vestjsRuntime.IsolateSerializer.deserialize(serialized);
|
|
12
|
+
}
|
|
13
|
+
static resume(suite, root) {
|
|
14
|
+
const suiteRoot = SuiteSerializer.deserialize(root);
|
|
15
|
+
suite.resume(suiteRoot);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.SuiteSerializer = SuiteSerializer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("vestjs-runtime");class i{static serialize(i){const s=Object.assign(Object.assign({},i.dump()),{output:void 0});return e.IsolateSerializer.serialize(s)}static deserialize(i){return e.IsolateSerializer.deserialize(i)}static resume(e,s){const r=i.deserialize(s);e.resume(r)}}exports.SuiteSerializer=i;
|
|
@@ -3,12 +3,30 @@
|
|
|
3
3
|
var vestUtils = require('vest-utils');
|
|
4
4
|
var vest = require('vest');
|
|
5
5
|
|
|
6
|
+
var ErrorStrings;
|
|
7
|
+
(function (ErrorStrings) {
|
|
8
|
+
ErrorStrings["HOOK_CALLED_OUTSIDE"] = "hook called outside of a running suite.";
|
|
9
|
+
ErrorStrings["EXPECTED_VEST_TEST"] = "Expected value to be an instance of IsolateTest";
|
|
10
|
+
ErrorStrings["FIELD_NAME_REQUIRED"] = "Field name must be passed";
|
|
11
|
+
ErrorStrings["SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION"] = "Suite must be initialized with a function";
|
|
12
|
+
ErrorStrings["PROMISIFY_REQUIRE_FUNCTION"] = "Vest.Promisify must be called with a function";
|
|
13
|
+
ErrorStrings["PARSER_EXPECT_RESULT_OBJECT"] = "Vest parser: expected argument at position 0 to be Vest's result object.";
|
|
14
|
+
ErrorStrings["WARN_MUST_BE_CALLED_FROM_TEST"] = "Warn must be called from within the body of a test function";
|
|
15
|
+
ErrorStrings["EACH_CALLBACK_MUST_BE_A_FUNCTION"] = "Each must be called with a function";
|
|
16
|
+
ErrorStrings["INVALID_PARAM_PASSED_TO_FUNCTION"] = "Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}";
|
|
17
|
+
ErrorStrings["TESTS_CALLED_IN_DIFFERENT_ORDER"] = "Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.";
|
|
18
|
+
ErrorStrings["UNEXPECTED_TEST_REGISTRATION_ERROR"] = "Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.";
|
|
19
|
+
ErrorStrings["UNEXPECTED_TEST_RUN_ERROR"] = "Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.";
|
|
20
|
+
ErrorStrings["INCLUDE_SELF"] = "Trying to call include.when on the same field.";
|
|
21
|
+
})(ErrorStrings || (ErrorStrings = {}));
|
|
22
|
+
|
|
6
23
|
function parse(summary) {
|
|
7
|
-
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'),
|
|
24
|
+
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), ErrorStrings.PARSER_EXPECT_RESULT_OBJECT);
|
|
8
25
|
const sel = vest.suiteSelectors(summary);
|
|
9
26
|
const testedStorage = {};
|
|
10
27
|
const selectors = {
|
|
11
28
|
invalid: sel.hasErrors,
|
|
29
|
+
pending: sel.isPending,
|
|
12
30
|
tested: isTested,
|
|
13
31
|
untested: isUntested,
|
|
14
32
|
valid: sel.isValid,
|
package/dist/cjs/classnames.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("vest-utils"),s=require("vest")
|
|
1
|
+
"use strict";var e,t=require("vest-utils"),s=require("vest");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),module.exports=function(n,i={}){const r=function(n){t.invariant(n&&t.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=s.suiteSelectors(n),r={},o={invalid:i.hasErrors,pending:i.isPending,tested:function(e){return t.isNullish(e)?t.isPositive(n.testCount):t.hasOwnProperty(r,e)?r[e]:(a(e),o.tested(e))},untested:function(e){return!(t.isPositive(n.testCount)&&o.tested(e))},valid:i.isValid,warning:i.hasWarnings};return o;function a(e){r[e]=t.hasOwnProperty(n.tests,e)&&t.isPositive(n.tests[e].testCount)}}(n);return function(e){const s=[];for(const n in i){const o=n;t.isFunction(r[o])&&r[o](e)&&s.push(i[o])}return s.join(" ")}};
|
package/dist/cjs/compose.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
|
|
3
2
|
if (process.env.NODE_ENV === 'production') {
|
|
4
|
-
module.exports = require('./compose.production.js');
|
|
3
|
+
module.exports = require('./enforce/compose.production.js');
|
|
5
4
|
} else {
|
|
6
|
-
module.exports = require('./compose.development.js');
|
|
5
|
+
module.exports = require('./enforce/compose.development.js');
|
|
7
6
|
}
|
package/dist/cjs/compounds.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
|
|
3
2
|
if (process.env.NODE_ENV === 'production') {
|
|
4
|
-
module.exports = require('./compounds.production.js');
|
|
3
|
+
module.exports = require('./enforce/compounds.production.js');
|
|
5
4
|
} else {
|
|
6
|
-
module.exports = require('./compounds.development.js');
|
|
5
|
+
module.exports = require('./enforce/compounds.development.js');
|
|
7
6
|
}
|
package/dist/cjs/date.js
ADDED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var compose = require('n4s/compose');
|
|
4
4
|
|
|
5
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
5
|
|
|
7
|
-
var compose__default = /*#__PURE__*/_interopDefaultLegacy(compose);
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
module.exports = compose__default["default"];
|
|
7
|
+
module.exports = compose;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("n4s/compose");module.exports=e;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var compounds = require('n4s/compounds');
|
|
6
4
|
|
|
7
|
-
function
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
9
6
|
var n = Object.create(null);
|
|
10
7
|
if (e) {
|
|
11
8
|
Object.keys(e).forEach(function (k) {
|
|
@@ -18,11 +15,11 @@ function _interopNamespace(e) {
|
|
|
18
15
|
}
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
|
-
n
|
|
18
|
+
n.default = e;
|
|
22
19
|
return Object.freeze(n);
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
var compounds__namespace = /*#__PURE__*/
|
|
22
|
+
var compounds__namespace = /*#__PURE__*/_interopNamespaceDefault(compounds);
|
|
26
23
|
|
|
27
24
|
|
|
28
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){
|
|
1
|
+
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/compounds"));exports.compounds=t;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var date = require('n4s/date');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var date__namespace = /*#__PURE__*/_interopNamespaceDefault(date);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.date = date__namespace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/date"));exports.date=t;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var email = require('n4s/email');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var email__namespace = /*#__PURE__*/_interopNamespaceDefault(email);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.email = email__namespace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/email"));exports.email=t;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var isURL = require('n4s/isURL');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var isURL__namespace = /*#__PURE__*/_interopNamespaceDefault(isURL);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.isURL = isURL__namespace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/isURL"));exports.isURL=t;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var schema = require('n4s/schema');
|
|
6
4
|
|
|
7
|
-
function
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
9
6
|
var n = Object.create(null);
|
|
10
7
|
if (e) {
|
|
11
8
|
Object.keys(e).forEach(function (k) {
|
|
@@ -18,11 +15,11 @@ function _interopNamespace(e) {
|
|
|
18
15
|
}
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
|
-
n
|
|
18
|
+
n.default = e;
|
|
22
19
|
return Object.freeze(n);
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
var schema__namespace = /*#__PURE__*/
|
|
22
|
+
var schema__namespace = /*#__PURE__*/_interopNamespaceDefault(schema);
|
|
26
23
|
|
|
27
24
|
|
|
28
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){
|
|
1
|
+
"use strict";function e(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var t=e(require("n4s/schema"));exports.schema=t;
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vestUtils = require('vest-utils');
|
|
6
3
|
var vest = require('vest');
|
|
4
|
+
var vestUtils = require('vest-utils');
|
|
5
|
+
|
|
6
|
+
var ErrorStrings;
|
|
7
|
+
(function (ErrorStrings) {
|
|
8
|
+
ErrorStrings["HOOK_CALLED_OUTSIDE"] = "hook called outside of a running suite.";
|
|
9
|
+
ErrorStrings["EXPECTED_VEST_TEST"] = "Expected value to be an instance of IsolateTest";
|
|
10
|
+
ErrorStrings["FIELD_NAME_REQUIRED"] = "Field name must be passed";
|
|
11
|
+
ErrorStrings["SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION"] = "Suite must be initialized with a function";
|
|
12
|
+
ErrorStrings["PROMISIFY_REQUIRE_FUNCTION"] = "Vest.Promisify must be called with a function";
|
|
13
|
+
ErrorStrings["PARSER_EXPECT_RESULT_OBJECT"] = "Vest parser: expected argument at position 0 to be Vest's result object.";
|
|
14
|
+
ErrorStrings["WARN_MUST_BE_CALLED_FROM_TEST"] = "Warn must be called from within the body of a test function";
|
|
15
|
+
ErrorStrings["EACH_CALLBACK_MUST_BE_A_FUNCTION"] = "Each must be called with a function";
|
|
16
|
+
ErrorStrings["INVALID_PARAM_PASSED_TO_FUNCTION"] = "Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}";
|
|
17
|
+
ErrorStrings["TESTS_CALLED_IN_DIFFERENT_ORDER"] = "Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.";
|
|
18
|
+
ErrorStrings["UNEXPECTED_TEST_REGISTRATION_ERROR"] = "Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.";
|
|
19
|
+
ErrorStrings["UNEXPECTED_TEST_RUN_ERROR"] = "Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.";
|
|
20
|
+
ErrorStrings["INCLUDE_SELF"] = "Trying to call include.when on the same field.";
|
|
21
|
+
})(ErrorStrings || (ErrorStrings = {}));
|
|
7
22
|
|
|
8
23
|
function parse(summary) {
|
|
9
|
-
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'),
|
|
24
|
+
vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), ErrorStrings.PARSER_EXPECT_RESULT_OBJECT);
|
|
10
25
|
const sel = vest.suiteSelectors(summary);
|
|
11
26
|
const testedStorage = {};
|
|
12
27
|
const selectors = {
|
|
13
28
|
invalid: sel.hasErrors,
|
|
29
|
+
pending: sel.isPending,
|
|
14
30
|
tested: isTested,
|
|
15
31
|
untested: isUntested,
|
|
16
32
|
valid: sel.isValid,
|
package/dist/cjs/parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e,t=require("vest"),s=require("vest-utils");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),exports.parse=function(n){s.invariant(n&&s.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=t.suiteSelectors(n),r={},o={invalid:i.hasErrors,pending:i.isPending,tested:function(e){if(s.isNullish(e))return s.isPositive(n.testCount);if(s.hasOwnProperty(r,e))return r[e];return a(e),o.tested(e)},untested:function(e){return!(s.isPositive(n.testCount)&&o.tested(e))},valid:i.isValid,warning:i.hasWarnings};return o;function a(e){r[e]=s.hasOwnProperty(n.tests,e)&&s.isPositive(n.tests[e].testCount)}};
|
|
@@ -2,9 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
var vestUtils = require('vest-utils');
|
|
4
4
|
|
|
5
|
+
var ErrorStrings;
|
|
6
|
+
(function (ErrorStrings) {
|
|
7
|
+
ErrorStrings["HOOK_CALLED_OUTSIDE"] = "hook called outside of a running suite.";
|
|
8
|
+
ErrorStrings["EXPECTED_VEST_TEST"] = "Expected value to be an instance of IsolateTest";
|
|
9
|
+
ErrorStrings["FIELD_NAME_REQUIRED"] = "Field name must be passed";
|
|
10
|
+
ErrorStrings["SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION"] = "Suite must be initialized with a function";
|
|
11
|
+
ErrorStrings["PROMISIFY_REQUIRE_FUNCTION"] = "Vest.Promisify must be called with a function";
|
|
12
|
+
ErrorStrings["PARSER_EXPECT_RESULT_OBJECT"] = "Vest parser: expected argument at position 0 to be Vest's result object.";
|
|
13
|
+
ErrorStrings["WARN_MUST_BE_CALLED_FROM_TEST"] = "Warn must be called from within the body of a test function";
|
|
14
|
+
ErrorStrings["EACH_CALLBACK_MUST_BE_A_FUNCTION"] = "Each must be called with a function";
|
|
15
|
+
ErrorStrings["INVALID_PARAM_PASSED_TO_FUNCTION"] = "Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}";
|
|
16
|
+
ErrorStrings["TESTS_CALLED_IN_DIFFERENT_ORDER"] = "Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.";
|
|
17
|
+
ErrorStrings["UNEXPECTED_TEST_REGISTRATION_ERROR"] = "Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.";
|
|
18
|
+
ErrorStrings["UNEXPECTED_TEST_RUN_ERROR"] = "Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.";
|
|
19
|
+
ErrorStrings["INCLUDE_SELF"] = "Trying to call include.when on the same field.";
|
|
20
|
+
})(ErrorStrings || (ErrorStrings = {}));
|
|
21
|
+
|
|
5
22
|
function promisify(validatorFn) {
|
|
6
23
|
return (...args) => {
|
|
7
|
-
vestUtils.invariant(vestUtils.isFunction(validatorFn),
|
|
24
|
+
vestUtils.invariant(vestUtils.isFunction(validatorFn), ErrorStrings.PROMISIFY_REQUIRE_FUNCTION);
|
|
8
25
|
return new Promise(resolve => validatorFn(...args).done(resolve));
|
|
9
26
|
};
|
|
10
27
|
}
|
package/dist/cjs/promisify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("vest-utils")
|
|
1
|
+
"use strict";var e,t=require("vest-utils");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),module.exports=function(s){return(...n)=>(t.invariant(t.isFunction(s),e.PROMISIFY_REQUIRE_FUNCTION),new Promise((e=>s(...n).done(e))))};
|
package/dist/cjs/schema.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
|
|
3
2
|
if (process.env.NODE_ENV === 'production') {
|
|
4
|
-
module.exports = require('./schema.production.js');
|
|
3
|
+
module.exports = require('./enforce/schema.production.js');
|
|
5
4
|
} else {
|
|
6
|
-
module.exports = require('./schema.development.js');
|
|
5
|
+
module.exports = require('./enforce/schema.development.js');
|
|
7
6
|
}
|