vest 6.0.0 → 6.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.
Files changed (66) hide show
  1. package/dist/exports/SuiteSerializer.cjs +45 -1
  2. package/dist/exports/SuiteSerializer.cjs.map +1 -1
  3. package/dist/exports/SuiteSerializer.mjs +45 -1
  4. package/dist/exports/SuiteSerializer.mjs.map +1 -1
  5. package/dist/exports/classnames.cjs +2 -2
  6. package/dist/exports/classnames.mjs +2 -2
  7. package/dist/exports/debounce.cjs +1 -1
  8. package/dist/exports/debounce.mjs +1 -1
  9. package/dist/exports/memo.cjs +1 -1
  10. package/dist/exports/memo.mjs +1 -1
  11. package/dist/exports/parser.cjs +2 -2
  12. package/dist/exports/parser.mjs +2 -2
  13. package/dist/{parser-CLhCAAYG.cjs → parser-DurNd9af.cjs} +2 -2
  14. package/dist/{parser-CLhCAAYG.cjs.map → parser-DurNd9af.cjs.map} +1 -1
  15. package/dist/{parser-Ch9qn6Hm.mjs → parser-TvzEAVLQ.mjs} +2 -2
  16. package/dist/{parser-Ch9qn6Hm.mjs.map → parser-TvzEAVLQ.mjs.map} +1 -1
  17. package/dist/{vest-CKYaivPf.cjs → vest-Lg6ZJuyu.cjs} +46 -12
  18. package/dist/vest-Lg6ZJuyu.cjs.map +1 -0
  19. package/dist/{vest-BEj6iXsK.mjs → vest-WSPRosdH.mjs} +47 -13
  20. package/dist/vest-WSPRosdH.mjs.map +1 -0
  21. package/dist/vest.cjs +1 -1
  22. package/dist/vest.mjs +1 -1
  23. package/package.json +6 -6
  24. package/src/core/Runtime.ts +3 -2
  25. package/src/exports/SuiteSerializer.ts +104 -1
  26. package/src/exports/__tests__/SuiteSerializer.test.ts +58 -1
  27. package/src/exports/__tests__/classnames.test.ts +24 -1
  28. package/src/exports/__tests__/parser.test.ts +23 -1
  29. package/src/suite/SuiteTypes.ts +15 -5
  30. package/src/suite/__tests__/runSummary.integration.test.ts +72 -0
  31. package/src/suite/__tests__/schema.types.test.ts +12 -0
  32. package/src/suite/useCreateSuiteRunner.ts +62 -41
  33. package/src/suiteResult/SuiteResultTypes.ts +22 -4
  34. package/src/suiteResult/selectors/useProduceSuiteSummary.ts +3 -2
  35. package/src/suiteResult/suiteResult.ts +37 -10
  36. package/types/{IsolateSuite-DnMtFHBW.d.cts → IsolateSuite-3gZF4eDG.d.mts} +11 -6
  37. package/types/IsolateSuite-3gZF4eDG.d.mts.map +1 -0
  38. package/types/{IsolateSuite-JdFYn2DA.d.mts → IsolateSuite-WsmXGGR-.d.cts} +11 -6
  39. package/types/IsolateSuite-WsmXGGR-.d.cts.map +1 -0
  40. package/types/{SuiteTypes-DESBCvZ7.d.cts → SuiteTypes-BNCL13HG.d.cts} +8 -7
  41. package/types/SuiteTypes-BNCL13HG.d.cts.map +1 -0
  42. package/types/{SuiteTypes-cjI5BA_k.d.mts → SuiteTypes-hg7F7swJ.d.mts} +8 -7
  43. package/types/SuiteTypes-hg7F7swJ.d.mts.map +1 -0
  44. package/types/exports/SuiteSerializer.d.cts +2 -2
  45. package/types/exports/SuiteSerializer.d.mts +2 -2
  46. package/types/exports/classnames.d.cts +2 -2
  47. package/types/exports/classnames.d.mts +2 -2
  48. package/types/exports/debounce.d.cts +1 -1
  49. package/types/exports/debounce.d.mts +1 -1
  50. package/types/exports/memo.d.cts +1 -1
  51. package/types/exports/memo.d.mts +1 -1
  52. package/types/exports/parser.d.cts +2 -2
  53. package/types/exports/parser.d.mts +2 -2
  54. package/types/{parser-BsrjuZ4_.d.cts → parser-DqW8l1IB.d.cts} +2 -2
  55. package/types/{parser-BsrjuZ4_.d.cts.map → parser-DqW8l1IB.d.cts.map} +1 -1
  56. package/types/{parser-CqvCfNJR.d.mts → parser-uCTQIcV6.d.mts} +2 -2
  57. package/types/{parser-CqvCfNJR.d.mts.map → parser-uCTQIcV6.d.mts.map} +1 -1
  58. package/types/vest.d.cts +2 -2
  59. package/types/vest.d.mts +2 -2
  60. package/types/vest.d.ts +2 -2
  61. package/dist/vest-BEj6iXsK.mjs.map +0 -1
  62. package/dist/vest-CKYaivPf.cjs.map +0 -1
  63. package/types/IsolateSuite-DnMtFHBW.d.cts.map +0 -1
  64. package/types/IsolateSuite-JdFYn2DA.d.mts.map +0 -1
  65. package/types/SuiteTypes-DESBCvZ7.d.cts.map +0 -1
  66. package/types/SuiteTypes-cjI5BA_k.d.mts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { n as TestAction, r as TestStatus, t as IsolateTestStateMachine } from "./IsolateTestStateMachine-BejZsTRI.mjs";
2
2
  import { enforce, enforce as enforce$1 } from "n4s";
3
- import { asArray, assign, cache, callEach, defaultTo, deferThrow, dynamicValue, either, freezeAssign, greaterThan, hasOwnProperty, invariant, isArray, isEmpty, isFunction, isNotEmptySet, isNotNullish, isObject, isPositive, isPromise, isStringValue, isUndefined, makeBrand, makeResult, seq, text, tinyState, withCatch, withResolvers } from "vest-utils";
3
+ import { asArray, assign, cache, callEach, defaultTo, deferThrow, dynamicValue, either, greaterThan, hasOwnProperty, invariant, isArray, isEmpty, isFunction, isNotEmptySet, isNotNullish, isObject, isPositive, isPromise, isStringValue, isUndefined, makeBrand, makeResult, seq, text, tinyState, withCatch, withResolvers } from "vest-utils";
4
4
  import { Bus, FocusModes, FocusSelectors, Isolate, IsolateFocused, IsolateInspector, IsolateMutator, IsolateRegistry, IsolateReorderable, IsolateSelectors, Reconciler, VestRuntime, Walker } from "vestjs-runtime";
5
5
  import { createCascade } from "context";
6
6
 
@@ -378,16 +378,25 @@ var SummaryBase = class {
378
378
  }
379
379
  };
380
380
  var SuiteSummary = class extends SummaryBase {
381
- constructor(..._args) {
382
- super(..._args);
381
+ static {
382
+ _Severity$ERRORS = Severity.ERRORS, _Severity$WARNINGS = Severity.WARNINGS;
383
+ }
384
+ constructor() {
385
+ super();
383
386
  this[_Severity$ERRORS] = [];
384
387
  this[_Severity$WARNINGS] = [];
385
388
  this.groups = {};
386
389
  this.tests = {};
387
390
  this.valid = null;
388
- }
389
- static {
390
- _Severity$ERRORS = Severity.ERRORS, _Severity$WARNINGS = Severity.WARNINGS;
391
+ Object.defineProperty(this, "run", {
392
+ configurable: true,
393
+ enumerable: false,
394
+ value: {
395
+ data: void 0,
396
+ time: /* @__PURE__ */ new Date(0)
397
+ },
398
+ writable: true
399
+ });
391
400
  }
392
401
  };
393
402
 
@@ -1229,15 +1238,28 @@ function shouldCountTestRun(testObject) {
1229
1238
 
1230
1239
  //#endregion
1231
1240
  //#region src/suiteResult/suiteResult.ts
1232
- function useCreateSuiteResult(schema, outputData, inputData) {
1241
+ function useCreateSuiteResult(schema, outputData, inputData, runTime = /* @__PURE__ */ new Date()) {
1233
1242
  return useSuiteResultCache(() => {
1234
- return freezeAssign(constructSuiteResultObject(useProduceSuiteSummary(), outputData), {
1243
+ const summary = useProduceSuiteSummary();
1244
+ summary.run = {
1245
+ data: inputData,
1246
+ time: runTime
1247
+ };
1248
+ const result = assign(constructSuiteResultObject(summary, outputData), {
1235
1249
  dump: VestRuntime.persist(VestRuntime.useAvailableRoot),
1236
1250
  types: schema ? {
1237
1251
  input: inputData,
1238
1252
  output: outputData
1239
1253
  } : void 0
1240
1254
  });
1255
+ const runMeta = Object.freeze({ ...summary.run });
1256
+ Object.defineProperty(result, "run", {
1257
+ configurable: true,
1258
+ enumerable: false,
1259
+ value: runMeta,
1260
+ writable: true
1261
+ });
1262
+ return Object.freeze(result);
1241
1263
  });
1242
1264
  }
1243
1265
  function constructSuiteResultObject(summary, outputData) {
@@ -2167,21 +2189,23 @@ function getTypedMethods() {
2167
2189
  function useCreateSuiteRunner(suiteCallback, modifiers, schema) {
2168
2190
  const transformedModifiers = useTransformedModifiers(modifiers);
2169
2191
  return function runSuite(...args) {
2192
+ const runTime = /* @__PURE__ */ new Date();
2170
2193
  const { resolve, promise } = withResolvers();
2171
2194
  const schemaInput = args[0];
2172
2195
  const schemaRunResult = shouldRunSchema(schema, transformedModifiers) ? runSchemaWithParse(schema, schemaInput) : void 0;
2173
2196
  const callbackInput = getCallbackInput(schemaRunResult, schemaInput);
2174
2197
  const callbackArgs = [callbackInput, ...args.slice(1)];
2175
- return assign(promise, SuiteContext.run({
2198
+ const runData = callbackInput;
2199
+ const result = assign(promise, SuiteContext.run({
2176
2200
  suiteParams: callbackArgs,
2177
2201
  schema,
2178
2202
  modifiers: transformedModifiers
2179
2203
  }, () => {
2180
2204
  useEmit("SUITE_RUN_STARTED");
2181
2205
  const useResolver = () => {
2182
- const result = useCreateSuiteResult(schema, callbackInput, schemaInput);
2183
- if (!result.isPending()) resolve(result);
2184
- return result;
2206
+ const result$1 = useCreateSuiteResult(schema, callbackInput, runData, runTime);
2207
+ if (!result$1.isPending()) resolve(result$1);
2208
+ return result$1;
2185
2209
  };
2186
2210
  return IsolateSuite(useRunSuiteCallback({
2187
2211
  args: callbackArgs,
@@ -2192,6 +2216,16 @@ function useCreateSuiteRunner(suiteCallback, modifiers, schema) {
2192
2216
  useResolver
2193
2217
  }), useResolver).output;
2194
2218
  }));
2219
+ Object.defineProperty(result, "run", {
2220
+ configurable: true,
2221
+ enumerable: false,
2222
+ value: Object.freeze({
2223
+ data: runData,
2224
+ time: runTime
2225
+ }),
2226
+ writable: true
2227
+ });
2228
+ return result;
2195
2229
  };
2196
2230
  }
2197
2231
  /**
@@ -2493,4 +2527,4 @@ function createSuite(suiteCallback, schema) {
2493
2527
 
2494
2528
  //#endregion
2495
2529
  export { ErrorStrings as S, suiteSelectors as _, warn as a, SuiteContext as b, only as c, getTestFromAbortSignal as d, registerReconciler as f, optional as g, skipWhen as h, each as i, skip as l, mode as m, createSuite as n, useWarn as o, omitWhen as p, group as r, include as s, enforce$1 as t, test as u, VestTest as v, Modes as x, createVestIsolate as y };
2496
- //# sourceMappingURL=vest-BEj6iXsK.mjs.map
2530
+ //# sourceMappingURL=vest-WSPRosdH.mjs.map