vest 6.2.7 → 6.3.0

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 (65) hide show
  1. package/bench/granular/enforce.bench.ts +1 -1
  2. package/dist/exports/classnames.cjs +2 -2
  3. package/dist/exports/classnames.mjs +2 -2
  4. package/dist/exports/debounce.cjs +1 -1
  5. package/dist/exports/debounce.mjs +1 -1
  6. package/dist/exports/memo.cjs +1 -1
  7. package/dist/exports/memo.mjs +1 -1
  8. package/dist/exports/parser.cjs +2 -2
  9. package/dist/exports/parser.mjs +2 -2
  10. package/dist/{parser-DBzFVv6R.mjs → parser-BDHdwZo7.mjs} +2 -2
  11. package/dist/{parser-DBzFVv6R.mjs.map → parser-BDHdwZo7.mjs.map} +1 -1
  12. package/dist/{parser-DOg_t1JJ.cjs → parser-DagIUS0b.cjs} +2 -2
  13. package/dist/{parser-DOg_t1JJ.cjs.map → parser-DagIUS0b.cjs.map} +1 -1
  14. package/dist/{vest-CHy2qeni.cjs → vest-B-NiE6Di.cjs} +25 -13
  15. package/dist/vest-B-NiE6Di.cjs.map +1 -0
  16. package/dist/{vest-DegYfrt0.mjs → vest-C_ndMBdJ.mjs} +26 -14
  17. package/dist/vest-C_ndMBdJ.mjs.map +1 -0
  18. package/dist/vest.cjs +1 -1
  19. package/dist/vest.mjs +1 -1
  20. package/package.json +9 -6
  21. package/src/core/Runtime.ts +10 -3
  22. package/src/core/VestBus/VestBus.ts +3 -15
  23. package/src/core/context/SuiteContext.ts +2 -2
  24. package/src/core/isolate/IsolateTest/IsolateTestReconciler.ts +4 -7
  25. package/src/core/test/TestTypes.ts +2 -0
  26. package/src/core/test/test.ts +9 -5
  27. package/src/core/test/validateTestParams.ts +3 -3
  28. package/src/isolates/omitWhen.ts +10 -4
  29. package/src/isolates/skipWhen.ts +7 -1
  30. package/src/suite/SuiteTypes.ts +2 -1
  31. package/src/suite/__tests__/getStandardSchema.test.ts +13 -0
  32. package/src/suite/__tests__/recordValidation.test.ts +113 -0
  33. package/src/suite/__tests__/schema.runtime.test.ts +16 -0
  34. package/src/suite/__tests__/schema.types.test.ts +49 -0
  35. package/src/suite/createSuite.ts +4 -4
  36. package/src/suite/getStandardSchema.ts +1 -1
  37. package/src/suite/getTypedMethods.ts +8 -3
  38. package/src/suite/useCreateSuiteRunner.ts +2 -7
  39. package/types/{IsolateSuite-CEwV1R-t.d.cts → IsolateSuite-D5Qr0Oyg.d.mts} +6 -5
  40. package/types/IsolateSuite-D5Qr0Oyg.d.mts.map +1 -0
  41. package/types/{IsolateSuite-ujWLWVKC.d.mts → IsolateSuite-t022G3ua.d.cts} +6 -5
  42. package/types/IsolateSuite-t022G3ua.d.cts.map +1 -0
  43. package/types/exports/SuiteSerializer.d.cts +1 -1
  44. package/types/exports/SuiteSerializer.d.mts +1 -1
  45. package/types/exports/classnames.d.cts +2 -2
  46. package/types/exports/classnames.d.mts +2 -2
  47. package/types/exports/debounce.d.cts +1 -1
  48. package/types/exports/debounce.d.mts +1 -1
  49. package/types/exports/memo.d.cts +1 -1
  50. package/types/exports/memo.d.mts +1 -1
  51. package/types/exports/parser.d.cts +2 -2
  52. package/types/exports/parser.d.mts +2 -2
  53. package/types/{parser-7BQP6Et1.d.cts → parser-BdKHE6ga.d.cts} +2 -2
  54. package/types/{parser-7BQP6Et1.d.cts.map → parser-BdKHE6ga.d.cts.map} +1 -1
  55. package/types/{parser-UUrcQjJc.d.mts → parser-BmCaKcyw.d.mts} +2 -2
  56. package/types/{parser-UUrcQjJc.d.mts.map → parser-BmCaKcyw.d.mts.map} +1 -1
  57. package/types/vest.d.cts +21 -9
  58. package/types/vest.d.cts.map +1 -1
  59. package/types/vest.d.mts +21 -9
  60. package/types/vest.d.mts.map +1 -1
  61. package/types/vest.d.ts +21 -9
  62. package/dist/vest-CHy2qeni.cjs.map +0 -1
  63. package/dist/vest-DegYfrt0.mjs.map +0 -1
  64. package/types/IsolateSuite-CEwV1R-t.d.cts.map +0 -1
  65. package/types/IsolateSuite-ujWLWVKC.d.mts.map +0 -1
@@ -8,7 +8,7 @@ const suiteEnforceSimple = create(() => {
8
8
  });
9
9
 
10
10
  const suiteEnforceChain = create(() => {
11
- enforce(10).isNumber().greaterThan(0).lessThan(20).equals(10).matches(/10/);
11
+ enforce(10).isNumber().greaterThan(0).lessThan(20).equals(10).isEven();
12
12
  });
13
13
 
14
14
  const suiteEnforceTemplate = create(() => {
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('../chunk-CbDLau6x.cjs');
2
- require('../vest-CHy2qeni.cjs');
2
+ require('../vest-B-NiE6Di.cjs');
3
3
  require('../IsolateTestStateMachine-BBP3PZx3.cjs');
4
- const require_parser = require('../parser-DOg_t1JJ.cjs');
4
+ const require_parser = require('../parser-DagIUS0b.cjs');
5
5
  let vest_utils = require("vest-utils");
6
6
 
7
7
  //#region src/exports/classnames.ts
@@ -1,6 +1,6 @@
1
- import "../vest-DegYfrt0.mjs";
1
+ import "../vest-C_ndMBdJ.mjs";
2
2
  import "../IsolateTestStateMachine-BejZsTRI.mjs";
3
- import { t as parse } from "../parser-DBzFVv6R.mjs";
3
+ import { t as parse } from "../parser-BDHdwZo7.mjs";
4
4
  import { isFunction, makeBrand } from "vest-utils";
5
5
 
6
6
  //#region src/exports/classnames.ts
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('../chunk-CbDLau6x.cjs');
2
- const require_vest = require('../vest-CHy2qeni.cjs');
2
+ const require_vest = require('../vest-B-NiE6Di.cjs');
3
3
  require('../IsolateTestStateMachine-BBP3PZx3.cjs');
4
4
  let vest_utils = require("vest-utils");
5
5
  let vestjs_runtime = require("vestjs-runtime");
@@ -1,4 +1,4 @@
1
- import { b as SuiteContext, f as getTestFromAbortSignal, p as registerReconciler } from "../vest-DegYfrt0.mjs";
1
+ import { b as SuiteContext, f as getTestFromAbortSignal, p as registerReconciler } from "../vest-C_ndMBdJ.mjs";
2
2
  import "../IsolateTestStateMachine-BejZsTRI.mjs";
3
3
  import { isPromise } from "vest-utils";
4
4
  import { Isolate, IsolateSelectors } from "vestjs-runtime";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('../chunk-CbDLau6x.cjs');
2
- const require_vest = require('../vest-CHy2qeni.cjs');
2
+ const require_vest = require('../vest-B-NiE6Di.cjs');
3
3
  require('../IsolateTestStateMachine-BBP3PZx3.cjs');
4
4
  let vest_utils = require("vest-utils");
5
5
  let vestjs_runtime = require("vestjs-runtime");
@@ -1,4 +1,4 @@
1
- import { p as registerReconciler, v as VestTest, y as createVestIsolate } from "../vest-DegYfrt0.mjs";
1
+ import { p as registerReconciler, v as VestTest, y as createVestIsolate } from "../vest-C_ndMBdJ.mjs";
2
2
  import "../IsolateTestStateMachine-BejZsTRI.mjs";
3
3
  import { cache, isNullish, makeResult, unwrap } from "vest-utils";
4
4
  import { IsolateSelectors, Walker } from "vestjs-runtime";
@@ -1,5 +1,5 @@
1
- require('../vest-CHy2qeni.cjs');
1
+ require('../vest-B-NiE6Di.cjs');
2
2
  require('../IsolateTestStateMachine-BBP3PZx3.cjs');
3
- const require_parser = require('../parser-DOg_t1JJ.cjs');
3
+ const require_parser = require('../parser-DagIUS0b.cjs');
4
4
 
5
5
  exports.parse = require_parser.parse;
@@ -1,5 +1,5 @@
1
- import "../vest-DegYfrt0.mjs";
1
+ import "../vest-C_ndMBdJ.mjs";
2
2
  import "../IsolateTestStateMachine-BejZsTRI.mjs";
3
- import { t as parse } from "../parser-DBzFVv6R.mjs";
3
+ import { t as parse } from "../parser-BDHdwZo7.mjs";
4
4
 
5
5
  export { parse };
@@ -1,4 +1,4 @@
1
- import { S as ErrorStrings, _ as suiteSelectors } from "./vest-DegYfrt0.mjs";
1
+ import { S as ErrorStrings, _ as suiteSelectors } from "./vest-C_ndMBdJ.mjs";
2
2
  import { hasOwnProperty, invariant, isNullish, isPositive, makeBrand } from "vest-utils";
3
3
 
4
4
  //#region src/exports/parser.ts
@@ -33,4 +33,4 @@ function parse(summary) {
33
33
 
34
34
  //#endregion
35
35
  export { parse as t };
36
- //# sourceMappingURL=parser-DBzFVv6R.mjs.map
36
+ //# sourceMappingURL=parser-BDHdwZo7.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser-DBzFVv6R.mjs","names":["testedStorage: Record<string, boolean>"],"sources":["../src/exports/parser.ts"],"sourcesContent":["import {\n hasOwnProperty,\n invariant,\n isNullish,\n isPositive,\n makeBrand,\n} from 'vest-utils';\n\nimport { ErrorStrings } from '../errors/ErrorStrings';\nimport {\n SuiteResult,\n SuiteSummary,\n TFieldName,\n TGroupName,\n TSchema,\n} from '../suiteResult/SuiteResultTypes';\nimport { suiteSelectors } from '../vest';\n\nexport function parse<\n F extends TFieldName,\n G extends TGroupName,\n S extends TSchema,\n>(summary: SuiteSummary<F, G> | SuiteResult<F, G, S>): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT,\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F | string): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n const safeFieldName = makeBrand<TFieldName>(fieldName);\n\n if (hasOwnProperty(testedStorage, safeFieldName)) {\n return testedStorage[safeFieldName];\n }\n\n addFieldToTestedStorage(safeFieldName);\n\n return selectors.tested(safeFieldName as F);\n }\n\n function addFieldToTestedStorage(fieldName: TFieldName): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F | string): boolean {\n const safeFieldName = fieldName\n ? makeBrand<TFieldName>(fieldName)\n : undefined;\n\n return !(\n isPositive(summary.testCount) &&\n selectors.tested(safeFieldName as F | undefined)\n );\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F | string): boolean;\n tested(fieldName?: F | string): boolean;\n invalid(fieldName?: F | string): boolean;\n untested(fieldName?: F | string): boolean;\n warning(fieldName?: F | string): boolean;\n pending(fieldName?: F | string): boolean;\n};\n"],"mappings":";;;;AAkBA,SAAgB,MAId,SAAyE;AACzE,WACE,WAAW,eAAe,SAAS,QAAQ,EAC3C,aAAa,4BACd;CAED,MAAM,MAAM,eAAe,QAAQ;CAEnC,MAAMA,gBAAyC,EAAE;CAEjD,MAAM,YAAY;EAChB,SAAS,IAAI;EACb,SAAS,IAAI;EACb,QAAQ;EACR,UAAU;EACV,OAAO,IAAI;EACX,SAAS,IAAI;EACd;AAED,QAAO;CAGP,SAAS,SAAS,WAAiC;AACjD,MAAI,UAAU,UAAU,CACtB,QAAO,WAAW,QAAQ,UAAU;EAGtC,MAAM,gBAAgB,UAAsB,UAAU;AAEtD,MAAI,eAAe,eAAe,cAAc,CAC9C,QAAO,cAAc;AAGvB,0BAAwB,cAAc;AAEtC,SAAO,UAAU,OAAO,cAAmB;;CAG7C,SAAS,wBAAwB,WAA6B;AAC5D,gBAAc,aACZ,eAAe,QAAQ,OAAO,UAAU,IACxC,WAAW,QAAQ,MAAM,WAAW,UAAU;;CAGlD,SAAS,WAAW,WAAiC;EACnD,MAAM,gBAAgB,YAClB,UAAsB,UAAU,GAChC;AAEJ,SAAO,EACL,WAAW,QAAQ,UAAU,IAC7B,UAAU,OAAO,cAA+B"}
1
+ {"version":3,"file":"parser-BDHdwZo7.mjs","names":["testedStorage: Record<string, boolean>"],"sources":["../src/exports/parser.ts"],"sourcesContent":["import {\n hasOwnProperty,\n invariant,\n isNullish,\n isPositive,\n makeBrand,\n} from 'vest-utils';\n\nimport { ErrorStrings } from '../errors/ErrorStrings';\nimport {\n SuiteResult,\n SuiteSummary,\n TFieldName,\n TGroupName,\n TSchema,\n} from '../suiteResult/SuiteResultTypes';\nimport { suiteSelectors } from '../vest';\n\nexport function parse<\n F extends TFieldName,\n G extends TGroupName,\n S extends TSchema,\n>(summary: SuiteSummary<F, G> | SuiteResult<F, G, S>): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT,\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F | string): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n const safeFieldName = makeBrand<TFieldName>(fieldName);\n\n if (hasOwnProperty(testedStorage, safeFieldName)) {\n return testedStorage[safeFieldName];\n }\n\n addFieldToTestedStorage(safeFieldName);\n\n return selectors.tested(safeFieldName as F);\n }\n\n function addFieldToTestedStorage(fieldName: TFieldName): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F | string): boolean {\n const safeFieldName = fieldName\n ? makeBrand<TFieldName>(fieldName)\n : undefined;\n\n return !(\n isPositive(summary.testCount) &&\n selectors.tested(safeFieldName as F | undefined)\n );\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F | string): boolean;\n tested(fieldName?: F | string): boolean;\n invalid(fieldName?: F | string): boolean;\n untested(fieldName?: F | string): boolean;\n warning(fieldName?: F | string): boolean;\n pending(fieldName?: F | string): boolean;\n};\n"],"mappings":";;;;AAkBA,SAAgB,MAId,SAAyE;AACzE,WACE,WAAW,eAAe,SAAS,QAAQ,EAC3C,aAAa,4BACd;CAED,MAAM,MAAM,eAAe,QAAQ;CAEnC,MAAMA,gBAAyC,EAAE;CAEjD,MAAM,YAAY;EAChB,SAAS,IAAI;EACb,SAAS,IAAI;EACb,QAAQ;EACR,UAAU;EACV,OAAO,IAAI;EACX,SAAS,IAAI;EACd;AAED,QAAO;CAGP,SAAS,SAAS,WAAiC;AACjD,MAAI,UAAU,UAAU,CACtB,QAAO,WAAW,QAAQ,UAAU;EAGtC,MAAM,gBAAgB,UAAsB,UAAU;AAEtD,MAAI,eAAe,eAAe,cAAc,CAC9C,QAAO,cAAc;AAGvB,0BAAwB,cAAc;AAEtC,SAAO,UAAU,OAAO,cAAmB;;CAG7C,SAAS,wBAAwB,WAA6B;AAC5D,gBAAc,aACZ,eAAe,QAAQ,OAAO,UAAU,IACxC,WAAW,QAAQ,MAAM,WAAW,UAAU;;CAGlD,SAAS,WAAW,WAAiC;EACnD,MAAM,gBAAgB,YAClB,UAAsB,UAAU,GAChC;AAEJ,SAAO,EACL,WAAW,QAAQ,UAAU,IAC7B,UAAU,OAAO,cAA+B"}
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_vest = require('./vest-CHy2qeni.cjs');
2
+ const require_vest = require('./vest-B-NiE6Di.cjs');
3
3
  let vest_utils = require("vest-utils");
4
4
 
5
5
  //#region src/exports/parser.ts
@@ -39,4 +39,4 @@ Object.defineProperty(exports, 'parse', {
39
39
  return parse;
40
40
  }
41
41
  });
42
- //# sourceMappingURL=parser-DOg_t1JJ.cjs.map
42
+ //# sourceMappingURL=parser-DagIUS0b.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser-DOg_t1JJ.cjs","names":["ErrorStrings","suiteSelectors","testedStorage: Record<string, boolean>"],"sources":["../src/exports/parser.ts"],"sourcesContent":["import {\n hasOwnProperty,\n invariant,\n isNullish,\n isPositive,\n makeBrand,\n} from 'vest-utils';\n\nimport { ErrorStrings } from '../errors/ErrorStrings';\nimport {\n SuiteResult,\n SuiteSummary,\n TFieldName,\n TGroupName,\n TSchema,\n} from '../suiteResult/SuiteResultTypes';\nimport { suiteSelectors } from '../vest';\n\nexport function parse<\n F extends TFieldName,\n G extends TGroupName,\n S extends TSchema,\n>(summary: SuiteSummary<F, G> | SuiteResult<F, G, S>): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT,\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F | string): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n const safeFieldName = makeBrand<TFieldName>(fieldName);\n\n if (hasOwnProperty(testedStorage, safeFieldName)) {\n return testedStorage[safeFieldName];\n }\n\n addFieldToTestedStorage(safeFieldName);\n\n return selectors.tested(safeFieldName as F);\n }\n\n function addFieldToTestedStorage(fieldName: TFieldName): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F | string): boolean {\n const safeFieldName = fieldName\n ? makeBrand<TFieldName>(fieldName)\n : undefined;\n\n return !(\n isPositive(summary.testCount) &&\n selectors.tested(safeFieldName as F | undefined)\n );\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F | string): boolean;\n tested(fieldName?: F | string): boolean;\n invalid(fieldName?: F | string): boolean;\n untested(fieldName?: F | string): boolean;\n warning(fieldName?: F | string): boolean;\n pending(fieldName?: F | string): boolean;\n};\n"],"mappings":";;;;;AAkBA,SAAgB,MAId,SAAyE;AACzE,2BACE,0CAA0B,SAAS,QAAQ,EAC3CA,0BAAa,4BACd;CAED,MAAM,MAAMC,4BAAe,QAAQ;CAEnC,MAAMC,gBAAyC,EAAE;CAEjD,MAAM,YAAY;EAChB,SAAS,IAAI;EACb,SAAS,IAAI;EACb,QAAQ;EACR,UAAU;EACV,OAAO,IAAI;EACX,SAAS,IAAI;EACd;AAED,QAAO;CAGP,SAAS,SAAS,WAAiC;AACjD,gCAAc,UAAU,CACtB,mCAAkB,QAAQ,UAAU;EAGtC,MAAM,0CAAsC,UAAU;AAEtD,qCAAmB,eAAe,cAAc,CAC9C,QAAO,cAAc;AAGvB,0BAAwB,cAAc;AAEtC,SAAO,UAAU,OAAO,cAAmB;;CAG7C,SAAS,wBAAwB,WAA6B;AAC5D,gBAAc,4CACG,QAAQ,OAAO,UAAU,+BAC7B,QAAQ,MAAM,WAAW,UAAU;;CAGlD,SAAS,WAAW,WAAiC;EACnD,MAAM,gBAAgB,sCACI,UAAU,GAChC;AAEJ,SAAO,6BACM,QAAQ,UAAU,IAC7B,UAAU,OAAO,cAA+B"}
1
+ {"version":3,"file":"parser-DagIUS0b.cjs","names":["ErrorStrings","suiteSelectors","testedStorage: Record<string, boolean>"],"sources":["../src/exports/parser.ts"],"sourcesContent":["import {\n hasOwnProperty,\n invariant,\n isNullish,\n isPositive,\n makeBrand,\n} from 'vest-utils';\n\nimport { ErrorStrings } from '../errors/ErrorStrings';\nimport {\n SuiteResult,\n SuiteSummary,\n TFieldName,\n TGroupName,\n TSchema,\n} from '../suiteResult/SuiteResultTypes';\nimport { suiteSelectors } from '../vest';\n\nexport function parse<\n F extends TFieldName,\n G extends TGroupName,\n S extends TSchema,\n>(summary: SuiteSummary<F, G> | SuiteResult<F, G, S>): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT,\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F | string): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n const safeFieldName = makeBrand<TFieldName>(fieldName);\n\n if (hasOwnProperty(testedStorage, safeFieldName)) {\n return testedStorage[safeFieldName];\n }\n\n addFieldToTestedStorage(safeFieldName);\n\n return selectors.tested(safeFieldName as F);\n }\n\n function addFieldToTestedStorage(fieldName: TFieldName): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F | string): boolean {\n const safeFieldName = fieldName\n ? makeBrand<TFieldName>(fieldName)\n : undefined;\n\n return !(\n isPositive(summary.testCount) &&\n selectors.tested(safeFieldName as F | undefined)\n );\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F | string): boolean;\n tested(fieldName?: F | string): boolean;\n invalid(fieldName?: F | string): boolean;\n untested(fieldName?: F | string): boolean;\n warning(fieldName?: F | string): boolean;\n pending(fieldName?: F | string): boolean;\n};\n"],"mappings":";;;;;AAkBA,SAAgB,MAId,SAAyE;AACzE,2BACE,0CAA0B,SAAS,QAAQ,EAC3CA,0BAAa,4BACd;CAED,MAAM,MAAMC,4BAAe,QAAQ;CAEnC,MAAMC,gBAAyC,EAAE;CAEjD,MAAM,YAAY;EAChB,SAAS,IAAI;EACb,SAAS,IAAI;EACb,QAAQ;EACR,UAAU;EACV,OAAO,IAAI;EACX,SAAS,IAAI;EACd;AAED,QAAO;CAGP,SAAS,SAAS,WAAiC;AACjD,gCAAc,UAAU,CACtB,mCAAkB,QAAQ,UAAU;EAGtC,MAAM,0CAAsC,UAAU;AAEtD,qCAAmB,eAAe,cAAc,CAC9C,QAAO,cAAc;AAGvB,0BAAwB,cAAc;AAEtC,SAAO,UAAU,OAAO,cAAmB;;CAG7C,SAAS,wBAAwB,WAA6B;AAC5D,gBAAc,4CACG,QAAQ,OAAO,UAAU,+BAC7B,QAAQ,MAAM,WAAW,UAAU;;CAGlD,SAAS,WAAW,WAAiC;EACnD,MAAM,gBAAgB,sCACI,UAAU,GAChC;AAEJ,SAAO,6BACM,QAAQ,UAAU,IAC7B,UAAU,OAAO,cAA+B"}
@@ -38,7 +38,7 @@ const SuiteContext = (0, context.createCascade)((ctxRef, parentContext) => {
38
38
  if (parentContext) return null;
39
39
  return (0, vest_utils.assign)({
40
40
  inclusion: {},
41
- mode: vest_utils.tinyState.createTinyState(Modes.EAGER),
41
+ mode: (0, vest_utils.createTinyState)(Modes.EAGER),
42
42
  modifiers: {
43
43
  onlyGroup: /* @__PURE__ */ new Set(),
44
44
  skipGroup: /* @__PURE__ */ new Set()
@@ -459,8 +459,8 @@ function useClearTestIndexes(root) {
459
459
  const createSuiteResultCache = () => (0, vest_utils.cache)();
460
460
  function useCreateVestState({ VestReconciler: VestReconciler$1 }) {
461
461
  const stateRef = {
462
- doneCallbacks: vest_utils.tinyState.createTinyState(() => []),
463
- fieldCallbacks: vest_utils.tinyState.createTinyState(() => ({})),
462
+ doneCallbacks: (0, vest_utils.createTinyState)(() => []),
463
+ fieldCallbacks: (0, vest_utils.createTinyState)(() => ({})),
464
464
  suiteId: (0, vest_utils.seq)(),
465
465
  suiteResultCache: createSuiteResultCache()
466
466
  };
@@ -1309,10 +1309,16 @@ function LazyDraft() {
1309
1309
  /**
1310
1310
  * Conditionally skips running tests within the callback.
1311
1311
  *
1312
+ * Unlike `omitWhen`, skipped tests **retain their previous result** from
1313
+ * the last run. Use `skipWhen` when you want to avoid re-evaluating
1314
+ * tests that already have a known result (e.g., skip an async uniqueness
1315
+ * check while the field still has synchronous validation errors).
1316
+ *
1312
1317
  * @example
1313
1318
  *
1319
+ * // Skip the async check while there are sync errors on the field
1314
1320
  * skipWhen(res => res.hasErrors('username'), () => {
1315
- * test('username', 'User already taken', async () => await doesUserExist(username)
1321
+ * test('username', 'User already taken', async () => await doesUserExist(username));
1316
1322
  * });
1317
1323
  */
1318
1324
  function skipWhen(condition, callback) {
@@ -1657,10 +1663,9 @@ function useRunDoneCallbacks() {
1657
1663
  function useInitVestBus() {
1658
1664
  const VestBus = vestjs_runtime.Bus.useBus();
1659
1665
  useRegistryBusEvents(VestBus);
1660
- VestBus.on("TEST_COMPLETED", () => {
1666
+ VestBus.on("TEST_RUN_STARTED", () => {
1661
1667
  useExpireSuiteResultCache();
1662
1668
  });
1663
- VestBus.on("TEST_RUN_STARTED", () => {});
1664
1669
  VestBus.on("ISOLATE_ENTER", (isolate) => {
1665
1670
  if (VestTest.is(isolate)) useOnTestStart(isolate);
1666
1671
  });
@@ -2134,13 +2139,19 @@ function shouldSkipGroup(groupName) {
2134
2139
  /**
2135
2140
  * Conditionally omits tests from the suite.
2136
2141
  *
2137
- * When the condition is met, the tests within the callback will be omitted
2138
- * and will not be executed. The callback itself will also be skipped.
2142
+ * Unlike `skipWhen`, omitted tests are **completely removed** from the
2143
+ * result they do not retain their previous state and are not counted
2144
+ * in `testCount`, `errorCount`, or validity checks. Use `omitWhen` when
2145
+ * the tests are irrelevant to the current form state (e.g., omit
2146
+ * "confirm password" tests when the password field is empty).
2139
2147
  *
2140
2148
  * @example
2141
2149
  *
2142
- * omitWhen(res => res.hasErrors('username'), () => {
2143
- * test('username', 'User already taken', async () => await doesUserExist(username)
2150
+ * // Don't validate confirmation when password is empty
2151
+ * omitWhen(!data.password, () => {
2152
+ * test('confirm', 'Passwords do not match', () => {
2153
+ * enforce(data.confirm).equals(data.password);
2154
+ * });
2144
2155
  * });
2145
2156
  */
2146
2157
  function omitWhen(conditional, callback) {
@@ -2170,7 +2181,7 @@ function getStandardSchema(staticRunner) {
2170
2181
  const result = staticRunner(value);
2171
2182
  if (!result.hasErrors()) return { value };
2172
2183
  return { issues: result.errors.map((error) => ({
2173
- message: error.message,
2184
+ ...error.message === void 0 ? {} : { message: error.message },
2174
2185
  path: error.fieldName ? error.fieldName.split(".") : void 0
2175
2186
  })) };
2176
2187
  },
@@ -2312,7 +2323,8 @@ function runSchemaValidation(schema, schemaRunResult) {
2312
2323
  const error = schemaRunResult[i];
2313
2324
  if (error.pass) continue;
2314
2325
  const fieldName = error.path?.length ? error.path.join(".") : "__root__";
2315
- test(fieldName, error.message ?? "Validation failed", () => false, `${fieldName}_${i}`);
2326
+ const testKey = `${fieldName}_${i}`;
2327
+ test(fieldName, error.message, () => false, testKey);
2316
2328
  }
2317
2329
  };
2318
2330
  }
@@ -2728,4 +2740,4 @@ Object.defineProperty(exports, 'warn', {
2728
2740
  return warn;
2729
2741
  }
2730
2742
  });
2731
- //# sourceMappingURL=vest-CHy2qeni.cjs.map
2743
+ //# sourceMappingURL=vest-B-NiE6Di.cjs.map