vest 5.0.2-dev-d315d9 → 6.0.0-next-7526f5

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.
Files changed (148) hide show
  1. package/dist/cjs/classnames.development.js +20 -1
  2. package/dist/cjs/classnames.production.js +1 -1
  3. package/dist/cjs/parser.development.js +21 -2
  4. package/dist/cjs/parser.production.js +1 -1
  5. package/dist/cjs/promisify.development.js +18 -1
  6. package/dist/cjs/promisify.production.js +1 -1
  7. package/dist/cjs/vest.development.js +597 -534
  8. package/dist/cjs/vest.production.js +1 -1
  9. package/dist/es/classnames.development.js +20 -1
  10. package/dist/es/classnames.production.js +1 -1
  11. package/dist/es/parser.development.js +21 -2
  12. package/dist/es/parser.production.js +1 -1
  13. package/dist/es/promisify.development.js +18 -1
  14. package/dist/es/promisify.production.js +1 -1
  15. package/dist/es/vest.development.js +595 -533
  16. package/dist/es/vest.production.js +1 -1
  17. package/dist/umd/classnames.development.js +20 -1
  18. package/dist/umd/classnames.production.js +1 -1
  19. package/dist/umd/parser.development.js +24 -5
  20. package/dist/umd/parser.production.js +1 -1
  21. package/dist/umd/promisify.development.js +18 -1
  22. package/dist/umd/promisify.production.js +1 -1
  23. package/dist/umd/vest.development.js +597 -534
  24. package/dist/umd/vest.production.js +1 -1
  25. package/package.json +5 -5
  26. package/testUtils/TVestMock.ts +3 -1
  27. package/testUtils/suiteDummy.ts +4 -2
  28. package/types/classnames.d.ts +42 -26
  29. package/types/classnames.d.ts.map +1 -1
  30. package/types/parser.d.ts +42 -26
  31. package/types/parser.d.ts.map +1 -1
  32. package/types/promisify.d.ts +42 -26
  33. package/types/promisify.d.ts.map +1 -1
  34. package/types/vest.d.ts +150 -92
  35. package/types/vest.d.ts.map +1 -1
  36. package/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap +0 -71
  37. package/src/__tests__/__snapshots__/integration.base.test.ts.snap +0 -71
  38. package/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap +0 -243
  39. package/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap +0 -376
  40. package/src/__tests__/integration.async-tests.test.ts +0 -90
  41. package/src/__tests__/integration.base.test.ts +0 -45
  42. package/src/__tests__/integration.exclusive.test.ts +0 -88
  43. package/src/__tests__/integration.stateful-async.test.ts +0 -137
  44. package/src/__tests__/integration.stateful-tests.test.ts +0 -155
  45. package/src/__tests__/isolate.test.ts +0 -288
  46. package/src/__tests__/state_refill.test.ts +0 -41
  47. package/src/core/SuiteWalker/SuiteWalker.ts +0 -64
  48. package/src/core/SuiteWalker/__tests__/hasRemainingTests.test.ts +0 -130
  49. package/src/core/VestBus/VestBus.ts +0 -78
  50. package/src/core/context/PersistedContext.ts +0 -243
  51. package/src/core/context/SuiteContext.ts +0 -74
  52. package/src/core/isolate/IsolateTest/IsolateTest.ts +0 -213
  53. package/src/core/isolate/IsolateTest/IsolateTestReconciler.ts +0 -156
  54. package/src/core/isolate/IsolateTest/IsolateTestStateMachine.ts +0 -69
  55. package/src/core/isolate/IsolateTest/SimpleStateMachine.ts +0 -43
  56. package/src/core/isolate/IsolateTest/TestWalker.ts +0 -77
  57. package/src/core/isolate/IsolateTypes.ts +0 -10
  58. package/src/core/isolate/isIsolate.ts +0 -6
  59. package/src/core/isolate/isolate.ts +0 -110
  60. package/src/core/isolate/reconciler/Reconciler/Reconciler.ts +0 -123
  61. package/src/core/isolate/reconciler/cancelOverriddenPendingTest.ts +0 -15
  62. package/src/core/isolate/reconciler/isSameProfileTest.ts +0 -12
  63. package/src/core/isolate/walker.ts +0 -127
  64. package/src/core/test/TestTypes.ts +0 -3
  65. package/src/core/test/__tests__/IsolateTest.test.ts +0 -152
  66. package/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap +0 -39
  67. package/src/core/test/__tests__/__snapshots__/memo.test.ts.snap +0 -101
  68. package/src/core/test/__tests__/__snapshots__/test.test.ts.snap +0 -231
  69. package/src/core/test/__tests__/key.test.ts +0 -195
  70. package/src/core/test/__tests__/memo.test.ts +0 -218
  71. package/src/core/test/__tests__/merging_of_previous_test_runs.test.ts +0 -341
  72. package/src/core/test/__tests__/runAsyncTest.test.ts +0 -175
  73. package/src/core/test/__tests__/test.test.ts +0 -226
  74. package/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts +0 -52
  75. package/src/core/test/helpers/asVestTest.ts +0 -9
  76. package/src/core/test/helpers/matchingFieldName.ts +0 -16
  77. package/src/core/test/helpers/matchingGroupName.ts +0 -12
  78. package/src/core/test/helpers/nonMatchingSeverityProfile.ts +0 -14
  79. package/src/core/test/helpers/shouldUseErrorMessage.ts +0 -9
  80. package/src/core/test/test.memo.ts +0 -81
  81. package/src/core/test/test.ts +0 -64
  82. package/src/core/test/testLevelFlowControl/runTest.ts +0 -86
  83. package/src/core/test/testLevelFlowControl/verifyTestRun.ts +0 -32
  84. package/src/core/test/testObjectIsolate.ts +0 -11
  85. package/src/errors/ErrorStrings.ts +0 -4
  86. package/src/exports/__tests__/classnames.test.ts +0 -92
  87. package/src/exports/__tests__/parser.test.ts +0 -441
  88. package/src/exports/__tests__/promisify.test.ts +0 -77
  89. package/src/exports/classnames.ts +0 -35
  90. package/src/exports/enforce@compose.ts +0 -1
  91. package/src/exports/enforce@compounds.ts +0 -1
  92. package/src/exports/enforce@schema.ts +0 -1
  93. package/src/exports/parser.ts +0 -63
  94. package/src/exports/promisify.ts +0 -18
  95. package/src/hooks/__tests__/__snapshots__/include.test.ts.snap +0 -794
  96. package/src/hooks/__tests__/eager.test.ts +0 -130
  97. package/src/hooks/__tests__/exclusive.test.ts +0 -578
  98. package/src/hooks/__tests__/include.test.ts +0 -431
  99. package/src/hooks/__tests__/optional.test.ts +0 -83
  100. package/src/hooks/__tests__/warn.test.ts +0 -42
  101. package/src/hooks/exclusive.ts +0 -179
  102. package/src/hooks/include.ts +0 -54
  103. package/src/hooks/mode.ts +0 -47
  104. package/src/hooks/optional/OptionalTypes.ts +0 -31
  105. package/src/hooks/optional/optional.ts +0 -69
  106. package/src/hooks/warn.ts +0 -19
  107. package/src/isolates/__tests__/__snapshots__/each.test.ts.snap +0 -3
  108. package/src/isolates/__tests__/__snapshots__/group.test.ts.snap +0 -114
  109. package/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap +0 -443
  110. package/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap +0 -99
  111. package/src/isolates/__tests__/each.test.ts +0 -35
  112. package/src/isolates/__tests__/group.test.ts +0 -362
  113. package/src/isolates/__tests__/omitWhen.test.ts +0 -246
  114. package/src/isolates/__tests__/skipWhen.test.ts +0 -163
  115. package/src/isolates/each.ts +0 -30
  116. package/src/isolates/group.ts +0 -9
  117. package/src/isolates/omitWhen.ts +0 -41
  118. package/src/isolates/skipWhen.ts +0 -42
  119. package/src/suite/__tests__/__snapshots__/create.test.ts.snap +0 -67
  120. package/src/suite/__tests__/create.test.ts +0 -109
  121. package/src/suite/__tests__/remove.test.ts +0 -50
  122. package/src/suite/__tests__/resetField.test.ts +0 -74
  123. package/src/suite/createSuite.ts +0 -94
  124. package/src/suite/runCallbacks.ts +0 -28
  125. package/src/suiteResult/Severity.ts +0 -15
  126. package/src/suiteResult/SuiteResultTypes.ts +0 -42
  127. package/src/suiteResult/__tests__/done.test.ts +0 -334
  128. package/src/suiteResult/__tests__/produce.test.ts +0 -163
  129. package/src/suiteResult/done/deferDoneCallback.ts +0 -28
  130. package/src/suiteResult/done/shouldSkipDoneRegistration.ts +0 -20
  131. package/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap +0 -89
  132. package/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts +0 -124
  133. package/src/suiteResult/selectors/__tests__/getFailures.test.ts +0 -158
  134. package/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts +0 -199
  135. package/src/suiteResult/selectors/__tests__/hasFailures.test.ts +0 -141
  136. package/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts +0 -185
  137. package/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts +0 -88
  138. package/src/suiteResult/selectors/__tests__/isValid.test.ts +0 -359
  139. package/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts +0 -480
  140. package/src/suiteResult/selectors/collectFailures.ts +0 -43
  141. package/src/suiteResult/selectors/hasFailuresByTestObjects.ts +0 -62
  142. package/src/suiteResult/selectors/produceSuiteSummary.ts +0 -135
  143. package/src/suiteResult/selectors/shouldAddValidProperty.ts +0 -148
  144. package/src/suiteResult/selectors/suiteSelectors.ts +0 -199
  145. package/src/suiteResult/suiteResult.ts +0 -15
  146. package/src/suiteResult/suiteRunResult.ts +0 -43
  147. package/src/vest.ts +0 -36
  148. package/tsconfig.json +0 -90
@@ -3,8 +3,27 @@
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["NO_ACTIVE_ISOLATE"] = "Not within an active isolate";
13
+ ErrorStrings["PROMISIFY_REQUIRE_FUNCTION"] = "Vest.Promisify must be called with a function";
14
+ ErrorStrings["PARSER_EXPECT_RESULT_OBJECT"] = "Vest parser: expected argument at position 0 to be Vest's result object.";
15
+ ErrorStrings["WARN_MUST_BE_CALLED_FROM_TEST"] = "Warn must be called from within the body of a test function";
16
+ ErrorStrings["EACH_CALLBACK_MUST_BE_A_FUNCTION"] = "Each must be called with a function";
17
+ ErrorStrings["INVALID_PARAM_PASSED_TO_FUNCTION"] = "Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}";
18
+ ErrorStrings["ENCOUNTERED_THE_SAME_KEY_TWICE"] = "Encountered the same test key \"{key}\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.";
19
+ 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.";
20
+ 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}.";
21
+ })(ErrorStrings || (ErrorStrings = {}));
22
+
23
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
+ // @ts-ignore - Need to understand why Vest is not being recognized
6
25
  function parse(summary) {
7
- vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
26
+ vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), ErrorStrings.PARSER_EXPECT_RESULT_OBJECT);
8
27
  const sel = vest.suiteSelectors(summary);
9
28
  const testedStorage = {};
10
29
  const selectors = {
@@ -1 +1 @@
1
- "use strict";var t=require("vest-utils"),s=require("vest");module.exports=function(e,n={}){const i=function(e){t.invariant(e&&t.hasOwnProperty(e,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");const n=s.suiteSelectors(e),i={},r={invalid:n.hasErrors,tested:function(s){return t.isNullish(s)?t.isPositive(e.testCount):t.hasOwnProperty(i,s)?i[s]:(o(s),r.tested(s))},untested:function(s){return!(t.isPositive(e.testCount)&&r.tested(s))},valid:n.isValid,warning:n.hasWarnings};return r;function o(s){i[s]=t.hasOwnProperty(e.tests,s)&&t.isPositive(e.tests[s].testCount)}}(e);return function(s){const e=[];for(const r in n){const o=r;t.isFunction(i[o])&&i[o](s)&&e.push(n[o])}return e.join(" ")}};
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.NO_ACTIVE_ISOLATE="Not within an active isolate",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.ENCOUNTERED_THE_SAME_KEY_TWICE='Encountered the same test key "{key}" twice. This may lead to tests overriding each other\'s results, or to tests being unexpectedly omitted.',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||(e={})),module.exports=function(n,i={}){const o=function(n){t.invariant(n&&t.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=s.suiteSelectors(n),o={},r={invalid:i.hasErrors,tested:function(e){return t.isNullish(e)?t.isPositive(n.testCount):t.hasOwnProperty(o,e)?o[e]:(a(e),r.tested(e))},untested:function(e){return!(t.isPositive(n.testCount)&&r.tested(e))},valid:i.isValid,warning:i.hasWarnings};return r;function a(e){o[e]=t.hasOwnProperty(n.tests,e)&&t.isPositive(n.tests[e].testCount)}}(n);return function(e){const s=[];for(const n in i){const r=n;t.isFunction(o[r])&&o[r](e)&&s.push(i[r])}return s.join(" ")}};
@@ -2,11 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vestUtils = require('vest-utils');
6
5
  var vest = require('vest');
6
+ var vestUtils = require('vest-utils');
7
+
8
+ var ErrorStrings;
9
+ (function (ErrorStrings) {
10
+ ErrorStrings["HOOK_CALLED_OUTSIDE"] = "hook called outside of a running suite.";
11
+ ErrorStrings["EXPECTED_VEST_TEST"] = "Expected value to be an instance of IsolateTest";
12
+ ErrorStrings["FIELD_NAME_REQUIRED"] = "Field name must be passed";
13
+ ErrorStrings["SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION"] = "Suite must be initialized with a function";
14
+ ErrorStrings["NO_ACTIVE_ISOLATE"] = "Not within an active isolate";
15
+ ErrorStrings["PROMISIFY_REQUIRE_FUNCTION"] = "Vest.Promisify must be called with a function";
16
+ ErrorStrings["PARSER_EXPECT_RESULT_OBJECT"] = "Vest parser: expected argument at position 0 to be Vest's result object.";
17
+ ErrorStrings["WARN_MUST_BE_CALLED_FROM_TEST"] = "Warn must be called from within the body of a test function";
18
+ ErrorStrings["EACH_CALLBACK_MUST_BE_A_FUNCTION"] = "Each must be called with a function";
19
+ ErrorStrings["INVALID_PARAM_PASSED_TO_FUNCTION"] = "Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}";
20
+ ErrorStrings["ENCOUNTERED_THE_SAME_KEY_TWICE"] = "Encountered the same test key \"{key}\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.";
21
+ 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.";
22
+ 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}.";
23
+ })(ErrorStrings || (ErrorStrings = {}));
7
24
 
25
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
+ // @ts-ignore - Need to understand why Vest is not being recognized
8
27
  function parse(summary) {
9
- vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), "Vest parser: expected argument at position 0 to be Vest's result object.");
28
+ vestUtils.invariant(summary && vestUtils.hasOwnProperty(summary, 'valid'), ErrorStrings.PARSER_EXPECT_RESULT_OBJECT);
10
29
  const sel = vest.suiteSelectors(summary);
11
30
  const testedStorage = {};
12
31
  const selectors = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("vest-utils"),e=require("vest");exports.parse=function(s){t.invariant(s&&t.hasOwnProperty(s,"valid"),"Vest parser: expected argument at position 0 to be Vest's result object.");const r=e.suiteSelectors(s),i={},n={invalid:r.hasErrors,tested:function(e){if(t.isNullish(e))return t.isPositive(s.testCount);if(t.hasOwnProperty(i,e))return i[e];return o(e),n.tested(e)},untested:function(e){return!(t.isPositive(s.testCount)&&n.tested(e))},valid:r.isValid,warning:r.hasWarnings};return n;function o(e){i[e]=t.hasOwnProperty(s.tests,e)&&t.isPositive(s.tests[e].testCount)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});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.NO_ACTIVE_ISOLATE="Not within an active isolate",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.ENCOUNTERED_THE_SAME_KEY_TWICE='Encountered the same test key "{key}" twice. This may lead to tests overriding each other\'s results, or to tests being unexpectedly omitted.',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||(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,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["NO_ACTIVE_ISOLATE"] = "Not within an active isolate";
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["ENCOUNTERED_THE_SAME_KEY_TWICE"] = "Encountered the same test key \"{key}\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.";
18
+ 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.";
19
+ 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}.";
20
+ })(ErrorStrings || (ErrorStrings = {}));
21
+
5
22
  function promisify(validatorFn) {
6
23
  return (...args) => {
7
- vestUtils.invariant(vestUtils.isFunction(validatorFn), 'promisify: Expected validatorFn to be a function.');
24
+ vestUtils.invariant(vestUtils.isFunction(validatorFn), ErrorStrings.PROMISIFY_REQUIRE_FUNCTION);
8
25
  return new Promise(resolve => validatorFn(...args).done(resolve));
9
26
  };
10
27
  }
@@ -1 +1 @@
1
- "use strict";var e=require("vest-utils");module.exports=function(i){return(...t)=>(e.invariant(e.isFunction(i),"promisify: Expected validatorFn to be a function."),new Promise((e=>i(...t).done(e))))};
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.NO_ACTIVE_ISOLATE="Not within an active isolate",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.ENCOUNTERED_THE_SAME_KEY_TWICE='Encountered the same test key "{key}" twice. This may lead to tests overriding each other\'s results, or to tests being unexpectedly omitted.',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||(e={})),module.exports=function(s){return(...n)=>(t.invariant(t.isFunction(s),e.PROMISIFY_REQUIRE_FUNCTION),new Promise((e=>s(...n).done(e))))};