vest 4.6.2-dev-fcaa09 → 4.6.2-dev-b07a89

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 (59) hide show
  1. package/dist/cjs/compose.js +7 -0
  2. package/dist/cjs/compounds.js +7 -0
  3. package/dist/cjs/enforce/compose.development.js +26 -0
  4. package/dist/cjs/enforce/compose.production.js +1 -0
  5. package/dist/cjs/{enforce_compounds.development.js → enforce/compounds.development.js} +0 -0
  6. package/dist/cjs/{enforce_compounds.production.js → enforce/compounds.production.js} +0 -0
  7. package/dist/cjs/enforce/package.json +1 -0
  8. package/dist/cjs/{enforce_schema.development.js → enforce/schema.development.js} +0 -0
  9. package/dist/cjs/{enforce_schema.production.js → enforce/schema.production.js} +0 -0
  10. package/dist/cjs/schema.js +7 -0
  11. package/dist/cjs/vest.development.js +1 -1
  12. package/dist/cjs/vest.production.js +1 -1
  13. package/dist/es/enforce/compose.development.js +4 -0
  14. package/dist/es/enforce/compose.production.js +1 -0
  15. package/dist/es/{enforce_compounds.development.js → enforce/compounds.development.js} +0 -0
  16. package/dist/es/{enforce_compounds.production.js → enforce/compounds.production.js} +0 -0
  17. package/dist/es/enforce/package.json +1 -0
  18. package/dist/es/{enforce_schema.development.js → enforce/schema.development.js} +0 -0
  19. package/dist/es/{enforce_schema.production.js → enforce/schema.production.js} +0 -0
  20. package/dist/es/vest.development.js +1 -1
  21. package/dist/es/vest.production.js +1 -1
  22. package/dist/umd/enforce/compose.development.js +12 -0
  23. package/dist/umd/enforce/compose.production.js +1 -0
  24. package/dist/umd/{enforce_compounds.development.js → enforce/compounds.development.js} +0 -0
  25. package/dist/umd/{enforce_compounds.production.js → enforce/compounds.production.js} +0 -0
  26. package/dist/umd/{enforce_schema.development.js → enforce/schema.development.js} +0 -0
  27. package/dist/umd/{enforce_schema.production.js → enforce/schema.production.js} +0 -0
  28. package/dist/umd/vest.development.js +1 -1
  29. package/dist/umd/vest.production.js +1 -1
  30. package/enforce/compose/package.json +9 -0
  31. package/enforce/compounds/package.json +9 -0
  32. package/enforce/schema/package.json +9 -0
  33. package/package.json +80 -80
  34. package/tsconfig.json +3 -3
  35. package/types/enforce/compose.d.ts +3 -0
  36. package/types/enforce/compose.d.ts.map +1 -0
  37. package/types/enforce/compounds.d.ts +2 -0
  38. package/types/enforce/compounds.d.ts.map +1 -0
  39. package/types/enforce/schema.d.ts +2 -0
  40. package/types/enforce/schema.d.ts.map +1 -0
  41. package/types/vest.d.ts +1 -1
  42. package/dist/cjs/enforce_compose.development.js +0 -2
  43. package/dist/cjs/enforce_compose.js +0 -7
  44. package/dist/cjs/enforce_compose.production.js +0 -1
  45. package/dist/cjs/enforce_compounds.js +0 -7
  46. package/dist/cjs/enforce_schema.js +0 -7
  47. package/dist/es/enforce_compose.development.js +0 -1
  48. package/dist/es/enforce_compose.production.js +0 -1
  49. package/dist/umd/enforce_compose.development.js +0 -8
  50. package/dist/umd/enforce_compose.production.js +0 -1
  51. package/enforce_compose/package.json +0 -9
  52. package/enforce_compounds/package.json +0 -9
  53. package/enforce_schema/package.json +0 -9
  54. package/types/enforce_compose.d.ts +0 -2
  55. package/types/enforce_compose.d.ts.map +0 -1
  56. package/types/enforce_compounds.d.ts +0 -2
  57. package/types/enforce_compounds.d.ts.map +0 -1
  58. package/types/enforce_schema.d.ts +0 -2
  59. package/types/enforce_schema.d.ts.map +0 -1
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./compose.production.js');
5
+ } else {
6
+ module.exports = require('./compose.development.js');
7
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./compounds.production.js');
5
+ } else {
6
+ module.exports = require('./compounds.development.js');
7
+ }
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ // eslint-disable-next-line import/no-unresolved
24
+ var compose = Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('n4s/compose')); });
25
+
26
+ module.exports = compose;
@@ -0,0 +1 @@
1
+ "use strict";var e=Promise.resolve().then((function(){return function(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}(require("n4s/compose"))}));module.exports=e;
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./schema.production.js');
5
+ } else {
6
+ module.exports = require('./schema.development.js');
7
+ }
@@ -1663,7 +1663,7 @@ function warn() {
1663
1663
  ctx.currentTest.warn();
1664
1664
  }
1665
1665
 
1666
- var VERSION = "4.6.2-dev-fcaa09";
1666
+ var VERSION = "4.6.2-dev-b07a89";
1667
1667
 
1668
1668
  Object.defineProperty(exports, 'enforce', {
1669
1669
  enumerable: true,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,n,e,r=require("n4s"),i=require("vest-utils"),u=require("context"),o=require("vast");function s(){var t=0;return{current:function(){return t},next:function(){t++}}}function a(t,n){return void 0===n&&(n=[]),{cursor:s(),keys:{current:{},prev:{}},path:n,type:t}}(n=t||(t={}))[n.DEFAULT=0]="DEFAULT",n[n.SUITE=1]="SUITE",n[n.EACH=2]="EACH",n[n.SKIP_WHEN=3]="SKIP_WHEN",n[n.OMIT_WHEN=4]="OMIT_WHEN",n[n.GROUP=5]="GROUP",function(t){t[t.ALL=0]="ALL",t[t.EAGER=1]="EAGER"}(e||(e={}));var c=u.createCascade((function(n,r){return r?null:i.assign({exclusion:{tests:{},groups:{}},inclusion:{},isolate:a(t.DEFAULT),mode:[e.ALL]},n)}));function f(){return c.useX().stateRef}function l(){return f().suiteId()[0]}function p(){return f().testCallbacks()}function d(){return f().optionalFields()}function v(t,n){(0,d()[1])((function(e){var r;return i.assign(e,((r={})[t]=i.assign({},e[t],n(e[t])),r))}))}function E(t){var n;return null!==(n=d()[0][t])&&void 0!==n?n:{}}function h(){return f().testObjects()}function g(){N((function(t){return t}))}function N(t){(0,h()[1])((function(n){return{prev:n.prev,current:i.asArray(t(n.current))}}))}function y(){return S().filter((function(t){return t.isPending()}))}var m,R=i.cache();function S(){var t=h()[0].current;return R([t],(function(){return i.nestedArray.flatten(t)}))}function T(t){S().forEach(t)}!function(t){t.Error="error",t.Warning="warning"}(m||(m={}));var C,A,_=function(){function t(t,n,e){var r=void 0===e?{}:e;e=r.message;var u=r.groupName;r=r.key,this.key=null,this.id=i.seq(),this.severity=m.Error,this.status=I,this.fieldName=t,this.testFn=n,u&&(this.groupName=u),e&&(this.message=e),r&&(this.key=r)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){(function(t,n){return i.isUndefined(t)&&i.isStringValue(n)})(this.message,n)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==L||(this.status=t)},t.prototype.warns=function(){return this.severity===m.Warning},t.prototype.setPending=function(){this.setStatus(P)},t.prototype.fail=function(){this.setStatus(this.warns()?b:F)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(k)},t.prototype.warn=function(){this.severity=m.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(O)},t.prototype.cancel=function(){this.setStatus(x),g()},t.prototype.reset=function(){this.status=I,g()},t.prototype.omit=function(){this.setStatus(L)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(P)},t.prototype.isOmitted=function(){return this.statusEquals(L)},t.prototype.isUntested=function(){return this.statusEquals(I)},t.prototype.isFailing=function(){return this.statusEquals(F)},t.prototype.isCanceled=function(){return this.statusEquals(x)},t.prototype.isSkipped=function(){return this.statusEquals(O)},t.prototype.isPassing=function(){return this.statusEquals(k)},t.prototype.isWarning=function(){return this.statusEquals(b)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),I="UNTESTED",O="SKIPPED",F="FAILED",b="WARNING",k="PASSING",P="PENDING",x="CANCELED",L="OMITTED";function U(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function D(){return c.useX().isolate}function W(){var t=D();return t.path.concat(t.cursor.current())}function w(){return D().cursor}function G(n,e){n=void 0===(n=n.type)?t.DEFAULT:n,i.invariant(i.isFunction(e));var r=a(n,W());return n=c.run({isolate:r},(function(){return r.keys.prev=function(){var t=h()[0].prev;return i.asArray(i.nestedArray.getCurrent(t,W())).reduce((function(t,n){return n instanceof _&&!i.isNullish(n.key)?(t[n.key]=n,t):t}),{})}(),N((function(t){return i.nestedArray.setValueAtPath(t,r.path,[])})),e()})),w().next(),n}function V(t){return t===C.ERRORS?A.ERROR_COUNT:A.WARN_COUNT}function q(t,n){return!!n&&!X(t,n)}function X(t,n){return!(!n||t.fieldName!==n)}!function(t){t.WARNINGS="warnings",t.ERRORS="errors"}(C||(C={})),function(t){t.ERROR_COUNT="errorCount",t.WARN_COUNT="warnCount"}(A||(A={}));var H,K=i.bindNot((function(t,n){return t.groupName===n}));function M(t){return function(t,n){return S().some((function(e){return B(e,t,n)}))}(C.ERRORS,t)}function B(t,n,e){return!(!t.hasFailures()||q(t,e)||function(t,n){return i.either(t===C.WARNINGS,n.warns())}(n,t))}function j(t){return!!t&&E(t).applied}function Y(t){if(j(t))return!0;var n=S();return!(i.isEmpty(n)||M(t)||function(t){return i.isNotEmpty(y().filter((function(n){return z(n,t)})))}(t))&&function(t){return S().every((function(n){return Q(n,t)}))}(t)}function J(t,n){return!!j(n)||!function(t,n,e){return S().some((function(r){return!K(r,n)&&B(r,t,e)}))}(C.ERRORS,t,n)&&!function(t,n){return i.isNotEmpty(y().filter((function(e){return!K(e,t)&&z(e,n)})))}(t,n)&&function(t,n){return S().every((function(e){return!!K(e,t)||Q(e,n)}))}(t,n)}function z(t,n){return!q(t,n)&&j(n)}function Q(t,n){return!!q(t,n)||(function(t){return E(t.fieldName).type===H.Delayed&&t.awaitsResolution()}(t)||t.isTested()||t.isOmitted())}function Z(){var t=S(),n=i.assign({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){return function(t,n){t[n.fieldName]=$(t,n),t[n.fieldName].valid=!1!==t[n.fieldName].valid&&Y(n.fieldName)}(t.tests,n),function(t,n){var e=n.groupName;e&&(t[e]=t[e]||{},t[e][n.fieldName]=$(t[e],n),t[e][n.fieldName].valid=!1!==t[e][n.fieldName].valid&&J(e,n.fieldName))}(t.groups,n),t}),n),n.valid=Y(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function $(t,n){function e(t){var n=V(t);o[n]++,u&&(o[t]=(o[t]||[]).concat(u))}var r=n.fieldName,u=n.message;t[r]=t[r]||i.assign({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var o=t[r];return n.isNonActionable()||(t[r].testCount++,n.isFailing()?e(C.ERRORS):n.isWarning()&&e(C.WARNINGS)),o}function tt(t,n,e){return e?function(t,n,e){var r;return(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}(t,n,e):function(t,n){var e,r={},u=V(n);for(e in t)i.isPositive(t[e][u])&&(r[e]=t[e][n]||[]);return r}(t,n)}function nt(t){return{getErrors:function(n){return et(t,C.ERRORS,n)},getErrorsByGroup:function(n,e){return rt(t,C.ERRORS,n,e)},getWarnings:function(n){return et(t,C.WARNINGS,n)},getWarningsByGroup:function(n,e){return rt(t,C.WARNINGS,n,e)},hasErrors:function(n){return ot(t,A.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return ut(t,A.ERROR_COUNT,n,e)},hasWarnings:function(n){return ot(t,A.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return ut(t,A.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return it(n,e);for(var r in n)if(!it(n,r))return!1;return!0}}}function et(t,n,e){return tt(t.tests,n,e)}function rt(t,n,e,r){return tt(t.groups[e],n,r)}function it(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function ut(t,n,e,r){var u,o;if(!(t=t.groups[e]))return!1;if(r)return i.isPositive(null===(u=t[r])||void 0===u?void 0:u[n]);for(var s in t)if(i.isPositive(null===(o=t[s])||void 0===o?void 0:o[n]))return!0;return!1}function ot(t,n,e){var r;return t=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0,i.isPositive(t)}!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(H||(H={}));var st=i.cache(1);function at(){var t=S(),n={stateRef:f()};return st([t],c.bind(n,(function(){var t=Z(),n=f().suiteName()[0];return i.assign(t,nt(t),{suiteName:n})})))}function ct(t){var n=y();return!i.isEmpty(n)&&(!t||n.some((function(n){return X(n,t)})))}var ft=i.cache(20);function lt(){var t=S(),n={stateRef:f()};return ft([t],c.bind(n,(function(){return i.assign({},at(),{done:c.bind(n,Et)})})))}function pt(t,n,e){var r;return!!(!i.isFunction(t)||n&&i.numberEquals(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function dt(t){return!(ct()&&(!t||ct(t)))}var vt,Et=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=(t=t.reverse())[0];if(t=t[1],n=lt(),pt(e,t,n))return n;var r=function(){return e(at())};return dt(t)?(r(),n):(ht(r,t),n)};function ht(t,n){(0,p()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function gt(){var t=i.bus.createBus();return t.on(vt.TEST_COMPLETED,(function(n){n.isCanceled()||(n.done(),function(t){var n=p()[0].fieldCallbacks;t&&!ct(t)&&i.isArray(n[t])&&i.callEach(n[t])}(n.fieldName),ct()||t.emit(vt.ALL_RUNNING_TESTS_FINISHED))})),t.on(vt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){e[t.fieldName]&&(t.omit(),v(t.fieldName,(function(){return{applied:!0}})))}var n=d()[0];if(!i.isEmpty(n)){var e={};S().forEach((function(n){if(i.hasOwnProperty(e,n.fieldName))t(n);else{var r=E(n.fieldName);r.type===H.Immediate&&(e[n.fieldName]=i.optionalFunctionValue(r.rule),t(n))}})),g()}}()})),t.on(vt.ALL_RUNNING_TESTS_FINISHED,(function(){!function(){var t=p()[0].doneCallbacks;i.callEach(t)}()})),t.on(vt.REMOVE_FIELD,(function(t){T((function(n){X(n,t)&&(n.cancel(),function(t){N((function(n){return i.nestedArray.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(vt.RESET_FIELD,(function(t){T((function(n){X(n,t)&&n.reset()}))})),t}function Nt(){var t=c.useX();return i.invariant(t.bus),t.bus}!function(t){t.TEST_COMPLETED="test_completed",t.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",t.REMOVE_FIELD="remove_field",t.RESET_FIELD="reset_field",t.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running"}(vt||(vt={}));function yt(){return!!c.useX().skipped}function mt(t){return Tt(0,"tests",t)}function Rt(t){return Tt(1,"tests",t)}function St(t){var n=t.fieldName;if(t=t.groupName,yt())return!0;var e=c.useX(),r=e.exclusion;e=e.inclusion;var u=r.tests,o=u[n];if(!1===o)return!0;if(o=!0===o,t){if(function(t){var n=c.useX().exclusion.groups;return i.hasOwnProperty(n,t)?!1===n[t]:At()}(t))return!0;if(!0===r.groups[t])return!o&&(!!Ct(u)||!1===u[n])}return!!function(t){return!!At()&&!t}(t)||!o&&(!!Ct(u)&&!i.optionalFunctionValue(e[n]))}function Tt(t,n,e){var r=c.useX("hook called outside of a running suite.");e&&i.asArray(e).forEach((function(e){i.isStringValue(e)&&(r.exclusion[n][e]=0===t)}))}function Ct(t){for(var n in t)if(!0===t[n])return!0;return!1}function At(){var t,n=c.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function _t(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function It(t){return function(t){return c.useX().mode[0]===t}(e.EAGER)&&M(t.fieldName)}function Ot(){return!!c.useX().omitted}function Ft(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function bt(t,n){return t.fieldName===n.fieldName&&t.groupName===n.groupName}function kt(t){var n=t.asyncTest,e=t.message;if(i.isPromise(n)){var r=Nt().emit,u=f(),o=c.bind({stateRef:u},(function(){g(),r(vt.TEST_COMPLETED,t)}));u=c.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=i.isStringValue(n)?n:e,t.fail(),o())})),n.then(o,u)}}function Pt(t){var n=Nt(),e=function(t){return c.run({currentTest:t},(function(){return t.run()}))}(t);try{i.isPromise(e)?(t.asyncTest=e,t.setPending(),kt(t)):n.emit(vt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}function xt(n){var e=h()[0].prev;return i.isEmpty(e)?(Lt(n),n):(e=function(t){var n=W();return i.nestedArray.valueAtPath(t,n)}(e),i.isNullish(n.key)?(function(t,n){return i.isNotEmpty(t)&&!bt(t,n)}(e,n)&&(function(n,e){D().type===t.EACH||i.deferThrow("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(e.fieldName,'\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,n),function(){var t=w().current();N((function(n){return n.splice(t),n}))}(),e=null),Lt(n=i.defaultTo(e,n)),n):(n=function(t,n){var e=function(t){return D().keys.prev[t]}(t);return e&&(n=e),function(t,n){var e=D().keys.current;i.isNullish(e[t])?e[t]=n:i.deferThrow('Encountered the same test key "'.concat(t,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted."))}(t,n),n}(n.key,n),Lt(n),n))}function Lt(t){var n=W();N((function(e){return i.nestedArray.setValueAtPath(e,n,t)}))}function Ut(t){var n=w();if(It(t))return t.skip(),xt(t),n.next(),t;var e=xt(t);return Ot()||j(t.fieldName)?(e.omit(),n.next(),e):St(t)?(e.skip(yt()),n.next(),e):(function(t,n){n!==t&&bt(t,n)&&t.isPending()&&t.cancel()}(e,t),Lt(t),function(t){t.isUntested()?Pt(t):i.isPromise(t.asyncTest)&&(t.setPending(),kt(t))}(t),n.next(),t)}function Dt(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=i.isFunction(n[1])?n:Ft([void 0],n,!0);n=r[0],e=r[1],r=r[2],i.invariant(i.isStringValue(t),wt("fieldName","string")),i.invariant(i.isFunction(e),wt("Test callback","function"));var u=c.useX();return Ut(n=new _(t,e,{message:n,groupName:u.groupName,key:r}))}mt.group=function(t){return Tt(0,"groups",t)},Rt.group=function(t){return Tt(1,"groups",t)};var Wt=i.assign(Dt,{memo:function(t){var n=i.cache(10);return function(e){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];u=w().current();var o=(r=r.reverse())[0],s=r[1],a=r[2];return u=[l(),e,u].concat(o),r=n.get(u),i.isNull(r)?n(u,(function(){return t(e,a,s)})):r[1].isCanceled()?(n.invalidate(u),n(u,(function(){return t(e,a,s)}))):Ut(r[1])}}(Dt)});function wt(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}Object.defineProperty(exports,"enforce",{enumerable:!0,get:function(){return r.enforce}}),exports.VERSION="4.6.2-dev-fcaa09",exports.context=c,exports.create=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];n=n[1],i.invariant(i.isFunction(r),"vest.create: Expected callback to be a function.");var u=gt(),s=o.createState();return n={stateRef:U(s,{suiteId:i.seq(),suiteName:n}),bus:u},i.assign(c.bind(n,(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return s.reset(),G({type:t.SUITE},(function(){r.apply(void 0,n)})),u.emit(vt.SUITE_CALLBACK_DONE_RUNNING),lt()})),{get:c.bind(n,at),remove:c.bind(n,(function(t){u.emit(vt.REMOVE_FIELD,t)})),reset:s.reset,resetField:c.bind(n,(function(t){u.emit(vt.RESET_FIELD,t)}))})},exports.each=function(n,e){i.invariant(i.isFunction(e),"each callback must be a function"),G({type:t.EACH},(function(){n.forEach((function(t,n){e(t,n)}))}))},exports.eager=function(){!function(t){c.useX().mode[0]=t}(e.EAGER)},exports.group=function(n,e){i.invariant(i.isStringValue(n),_t("name must be a string")),i.invariant(i.isFunction(e),_t("callback must be a function")),G({type:t.GROUP},(function(){c.run({groupName:n},e)}))},exports.include=function(t){var n=c.useX(),e=n.inclusion;return n=n.exclusion,i.invariant(i.isStringValue(t)),e[t]=i.defaultTo(n.tests[t],!0),{when:function(n){var e=c.useX(),r=e.exclusion;e.inclusion[t]=function(){return i.hasOwnProperty(r.tests,t)?i.defaultTo(r.tests[t],!0):i.isStringValue(n)?!!r.tests[n]:i.optionalFunctionValue(n,i.optionalFunctionValue(at))}}}},exports.omitWhen=function(n,e){G({type:t.OMIT_WHEN},(function(){c.run({omitted:Ot()||i.optionalFunctionValue(n,i.optionalFunctionValue(at))},(function(){return e()}))}))},exports.only=mt,exports.optional=function(t){if(i.isArray(t)||i.isStringValue(t))i.asArray(t).forEach((function(t){v(t,(function(){return{type:H.Delayed,applied:!1,rule:null}}))}));else{var n,e=function(n){var e=t[n];v(n,(function(){return{type:H.Immediate,rule:e,applied:i.optionalFunctionValue(e)}}))};for(n in t)e(n)}},exports.skip=Rt,exports.skipWhen=function(n,e){G({type:t.SKIP_WHEN},(function(){c.run({skipped:yt()||i.optionalFunctionValue(n,i.optionalFunctionValue(at))},(function(){return e()}))}))},exports.suiteSelectors=nt,exports.test=Wt,exports.warn=function(){var t=c.useX("warn hook called outside of a running suite.");i.invariant(t.currentTest,"warn called outside of a test."),t.currentTest.warn()};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,n,e,r=require("n4s"),i=require("vest-utils"),u=require("context"),o=require("vast");function s(){var t=0;return{current:function(){return t},next:function(){t++}}}function a(t,n){return void 0===n&&(n=[]),{cursor:s(),keys:{current:{},prev:{}},path:n,type:t}}(n=t||(t={}))[n.DEFAULT=0]="DEFAULT",n[n.SUITE=1]="SUITE",n[n.EACH=2]="EACH",n[n.SKIP_WHEN=3]="SKIP_WHEN",n[n.OMIT_WHEN=4]="OMIT_WHEN",n[n.GROUP=5]="GROUP",function(t){t[t.ALL=0]="ALL",t[t.EAGER=1]="EAGER"}(e||(e={}));var c=u.createCascade((function(n,r){return r?null:i.assign({exclusion:{tests:{},groups:{}},inclusion:{},isolate:a(t.DEFAULT),mode:[e.ALL]},n)}));function f(){return c.useX().stateRef}function l(){return f().suiteId()[0]}function p(){return f().testCallbacks()}function d(){return f().optionalFields()}function v(t,n){(0,d()[1])((function(e){var r;return i.assign(e,((r={})[t]=i.assign({},e[t],n(e[t])),r))}))}function E(t){var n;return null!==(n=d()[0][t])&&void 0!==n?n:{}}function h(){return f().testObjects()}function g(){N((function(t){return t}))}function N(t){(0,h()[1])((function(n){return{prev:n.prev,current:i.asArray(t(n.current))}}))}function y(){return S().filter((function(t){return t.isPending()}))}var m,R=i.cache();function S(){var t=h()[0].current;return R([t],(function(){return i.nestedArray.flatten(t)}))}function T(t){S().forEach(t)}!function(t){t.Error="error",t.Warning="warning"}(m||(m={}));var C,A,_=function(){function t(t,n,e){var r=void 0===e?{}:e;e=r.message;var u=r.groupName;r=r.key,this.key=null,this.id=i.seq(),this.severity=m.Error,this.status=I,this.fieldName=t,this.testFn=n,u&&(this.groupName=u),e&&(this.message=e),r&&(this.key=r)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){(function(t,n){return i.isUndefined(t)&&i.isStringValue(n)})(this.message,n)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==L||(this.status=t)},t.prototype.warns=function(){return this.severity===m.Warning},t.prototype.setPending=function(){this.setStatus(P)},t.prototype.fail=function(){this.setStatus(this.warns()?b:F)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(k)},t.prototype.warn=function(){this.severity=m.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(O)},t.prototype.cancel=function(){this.setStatus(x),g()},t.prototype.reset=function(){this.status=I,g()},t.prototype.omit=function(){this.setStatus(L)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(P)},t.prototype.isOmitted=function(){return this.statusEquals(L)},t.prototype.isUntested=function(){return this.statusEquals(I)},t.prototype.isFailing=function(){return this.statusEquals(F)},t.prototype.isCanceled=function(){return this.statusEquals(x)},t.prototype.isSkipped=function(){return this.statusEquals(O)},t.prototype.isPassing=function(){return this.statusEquals(k)},t.prototype.isWarning=function(){return this.statusEquals(b)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),I="UNTESTED",O="SKIPPED",F="FAILED",b="WARNING",k="PASSING",P="PENDING",x="CANCELED",L="OMITTED";function U(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function D(){return c.useX().isolate}function W(){var t=D();return t.path.concat(t.cursor.current())}function w(){return D().cursor}function G(n,e){n=void 0===(n=n.type)?t.DEFAULT:n,i.invariant(i.isFunction(e));var r=a(n,W());return n=c.run({isolate:r},(function(){return r.keys.prev=function(){var t=h()[0].prev;return i.asArray(i.nestedArray.getCurrent(t,W())).reduce((function(t,n){return n instanceof _&&!i.isNullish(n.key)?(t[n.key]=n,t):t}),{})}(),N((function(t){return i.nestedArray.setValueAtPath(t,r.path,[])})),e()})),w().next(),n}function V(t){return t===C.ERRORS?A.ERROR_COUNT:A.WARN_COUNT}function q(t,n){return!!n&&!X(t,n)}function X(t,n){return!(!n||t.fieldName!==n)}!function(t){t.WARNINGS="warnings",t.ERRORS="errors"}(C||(C={})),function(t){t.ERROR_COUNT="errorCount",t.WARN_COUNT="warnCount"}(A||(A={}));var H,K=i.bindNot((function(t,n){return t.groupName===n}));function M(t){return function(t,n){return S().some((function(e){return B(e,t,n)}))}(C.ERRORS,t)}function B(t,n,e){return!(!t.hasFailures()||q(t,e)||function(t,n){return i.either(t===C.WARNINGS,n.warns())}(n,t))}function j(t){return!!t&&E(t).applied}function Y(t){if(j(t))return!0;var n=S();return!(i.isEmpty(n)||M(t)||function(t){return i.isNotEmpty(y().filter((function(n){return z(n,t)})))}(t))&&function(t){return S().every((function(n){return Q(n,t)}))}(t)}function J(t,n){return!!j(n)||!function(t,n,e){return S().some((function(r){return!K(r,n)&&B(r,t,e)}))}(C.ERRORS,t,n)&&!function(t,n){return i.isNotEmpty(y().filter((function(e){return!K(e,t)&&z(e,n)})))}(t,n)&&function(t,n){return S().every((function(e){return!!K(e,t)||Q(e,n)}))}(t,n)}function z(t,n){return!q(t,n)&&j(n)}function Q(t,n){return!!q(t,n)||(function(t){return E(t.fieldName).type===H.Delayed&&t.awaitsResolution()}(t)||t.isTested()||t.isOmitted())}function Z(){var t=S(),n=i.assign({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){return function(t,n){t[n.fieldName]=$(t,n),t[n.fieldName].valid=!1!==t[n.fieldName].valid&&Y(n.fieldName)}(t.tests,n),function(t,n){var e=n.groupName;e&&(t[e]=t[e]||{},t[e][n.fieldName]=$(t[e],n),t[e][n.fieldName].valid=!1!==t[e][n.fieldName].valid&&J(e,n.fieldName))}(t.groups,n),t}),n),n.valid=Y(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function $(t,n){function e(t){var n=V(t);o[n]++,u&&(o[t]=(o[t]||[]).concat(u))}var r=n.fieldName,u=n.message;t[r]=t[r]||i.assign({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var o=t[r];return n.isNonActionable()||(t[r].testCount++,n.isFailing()?e(C.ERRORS):n.isWarning()&&e(C.WARNINGS)),o}function tt(t,n,e){return e?function(t,n,e){var r;return(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}(t,n,e):function(t,n){var e,r={},u=V(n);for(e in t)i.isPositive(t[e][u])&&(r[e]=t[e][n]||[]);return r}(t,n)}function nt(t){return{getErrors:function(n){return et(t,C.ERRORS,n)},getErrorsByGroup:function(n,e){return rt(t,C.ERRORS,n,e)},getWarnings:function(n){return et(t,C.WARNINGS,n)},getWarningsByGroup:function(n,e){return rt(t,C.WARNINGS,n,e)},hasErrors:function(n){return ot(t,A.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return ut(t,A.ERROR_COUNT,n,e)},hasWarnings:function(n){return ot(t,A.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return ut(t,A.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return it(n,e);for(var r in n)if(!it(n,r))return!1;return!0}}}function et(t,n,e){return tt(t.tests,n,e)}function rt(t,n,e,r){return tt(t.groups[e],n,r)}function it(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function ut(t,n,e,r){var u,o;if(!(t=t.groups[e]))return!1;if(r)return i.isPositive(null===(u=t[r])||void 0===u?void 0:u[n]);for(var s in t)if(i.isPositive(null===(o=t[s])||void 0===o?void 0:o[n]))return!0;return!1}function ot(t,n,e){var r;return t=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0,i.isPositive(t)}!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(H||(H={}));var st=i.cache(1);function at(){var t=S(),n={stateRef:f()};return st([t],c.bind(n,(function(){var t=Z(),n=f().suiteName()[0];return i.assign(t,nt(t),{suiteName:n})})))}function ct(t){var n=y();return!i.isEmpty(n)&&(!t||n.some((function(n){return X(n,t)})))}var ft=i.cache(20);function lt(){var t=S(),n={stateRef:f()};return ft([t],c.bind(n,(function(){return i.assign({},at(),{done:c.bind(n,Et)})})))}function pt(t,n,e){var r;return!!(!i.isFunction(t)||n&&i.numberEquals(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function dt(t){return!(ct()&&(!t||ct(t)))}var vt,Et=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=(t=t.reverse())[0];if(t=t[1],n=lt(),pt(e,t,n))return n;var r=function(){return e(at())};return dt(t)?(r(),n):(ht(r,t),n)};function ht(t,n){(0,p()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function gt(){var t=i.bus.createBus();return t.on(vt.TEST_COMPLETED,(function(n){n.isCanceled()||(n.done(),function(t){var n=p()[0].fieldCallbacks;t&&!ct(t)&&i.isArray(n[t])&&i.callEach(n[t])}(n.fieldName),ct()||t.emit(vt.ALL_RUNNING_TESTS_FINISHED))})),t.on(vt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){e[t.fieldName]&&(t.omit(),v(t.fieldName,(function(){return{applied:!0}})))}var n=d()[0];if(!i.isEmpty(n)){var e={};S().forEach((function(n){if(i.hasOwnProperty(e,n.fieldName))t(n);else{var r=E(n.fieldName);r.type===H.Immediate&&(e[n.fieldName]=i.optionalFunctionValue(r.rule),t(n))}})),g()}}()})),t.on(vt.ALL_RUNNING_TESTS_FINISHED,(function(){!function(){var t=p()[0].doneCallbacks;i.callEach(t)}()})),t.on(vt.REMOVE_FIELD,(function(t){T((function(n){X(n,t)&&(n.cancel(),function(t){N((function(n){return i.nestedArray.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(vt.RESET_FIELD,(function(t){T((function(n){X(n,t)&&n.reset()}))})),t}function Nt(){var t=c.useX();return i.invariant(t.bus),t.bus}!function(t){t.TEST_COMPLETED="test_completed",t.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",t.REMOVE_FIELD="remove_field",t.RESET_FIELD="reset_field",t.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running"}(vt||(vt={}));function yt(){return!!c.useX().skipped}function mt(t){return Tt(0,"tests",t)}function Rt(t){return Tt(1,"tests",t)}function St(t){var n=t.fieldName;if(t=t.groupName,yt())return!0;var e=c.useX(),r=e.exclusion;e=e.inclusion;var u=r.tests,o=u[n];if(!1===o)return!0;if(o=!0===o,t){if(function(t){var n=c.useX().exclusion.groups;return i.hasOwnProperty(n,t)?!1===n[t]:At()}(t))return!0;if(!0===r.groups[t])return!o&&(!!Ct(u)||!1===u[n])}return!!function(t){return!!At()&&!t}(t)||!o&&(!!Ct(u)&&!i.optionalFunctionValue(e[n]))}function Tt(t,n,e){var r=c.useX("hook called outside of a running suite.");e&&i.asArray(e).forEach((function(e){i.isStringValue(e)&&(r.exclusion[n][e]=0===t)}))}function Ct(t){for(var n in t)if(!0===t[n])return!0;return!1}function At(){var t,n=c.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function _t(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function It(t){return function(t){return c.useX().mode[0]===t}(e.EAGER)&&M(t.fieldName)}function Ot(){return!!c.useX().omitted}function Ft(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function bt(t,n){return t.fieldName===n.fieldName&&t.groupName===n.groupName}function kt(t){var n=t.asyncTest,e=t.message;if(i.isPromise(n)){var r=Nt().emit,u=f(),o=c.bind({stateRef:u},(function(){g(),r(vt.TEST_COMPLETED,t)}));u=c.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=i.isStringValue(n)?n:e,t.fail(),o())})),n.then(o,u)}}function Pt(t){var n=Nt(),e=function(t){return c.run({currentTest:t},(function(){return t.run()}))}(t);try{i.isPromise(e)?(t.asyncTest=e,t.setPending(),kt(t)):n.emit(vt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}function xt(n){var e=h()[0].prev;return i.isEmpty(e)?(Lt(n),n):(e=function(t){var n=W();return i.nestedArray.valueAtPath(t,n)}(e),i.isNullish(n.key)?(function(t,n){return i.isNotEmpty(t)&&!bt(t,n)}(e,n)&&(function(n,e){D().type===t.EACH||i.deferThrow("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(e.fieldName,'\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,n),function(){var t=w().current();N((function(n){return n.splice(t),n}))}(),e=null),Lt(n=i.defaultTo(e,n)),n):(n=function(t,n){var e=function(t){return D().keys.prev[t]}(t);return e&&(n=e),function(t,n){var e=D().keys.current;i.isNullish(e[t])?e[t]=n:i.deferThrow('Encountered the same test key "'.concat(t,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted."))}(t,n),n}(n.key,n),Lt(n),n))}function Lt(t){var n=W();N((function(e){return i.nestedArray.setValueAtPath(e,n,t)}))}function Ut(t){var n=w();if(It(t))return t.skip(),xt(t),n.next(),t;var e=xt(t);return Ot()||j(t.fieldName)?(e.omit(),n.next(),e):St(t)?(e.skip(yt()),n.next(),e):(function(t,n){n!==t&&bt(t,n)&&t.isPending()&&t.cancel()}(e,t),Lt(t),function(t){t.isUntested()?Pt(t):i.isPromise(t.asyncTest)&&(t.setPending(),kt(t))}(t),n.next(),t)}function Dt(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=i.isFunction(n[1])?n:Ft([void 0],n,!0);n=r[0],e=r[1],r=r[2],i.invariant(i.isStringValue(t),wt("fieldName","string")),i.invariant(i.isFunction(e),wt("Test callback","function"));var u=c.useX();return Ut(n=new _(t,e,{message:n,groupName:u.groupName,key:r}))}mt.group=function(t){return Tt(0,"groups",t)},Rt.group=function(t){return Tt(1,"groups",t)};var Wt=i.assign(Dt,{memo:function(t){var n=i.cache(10);return function(e){for(var r=[],u=1;u<arguments.length;u++)r[u-1]=arguments[u];u=w().current();var o=(r=r.reverse())[0],s=r[1],a=r[2];return u=[l(),e,u].concat(o),r=n.get(u),i.isNull(r)?n(u,(function(){return t(e,a,s)})):r[1].isCanceled()?(n.invalidate(u),n(u,(function(){return t(e,a,s)}))):Ut(r[1])}}(Dt)});function wt(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}Object.defineProperty(exports,"enforce",{enumerable:!0,get:function(){return r.enforce}}),exports.VERSION="4.6.2-dev-b07a89",exports.context=c,exports.create=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];n=n[1],i.invariant(i.isFunction(r),"vest.create: Expected callback to be a function.");var u=gt(),s=o.createState();return n={stateRef:U(s,{suiteId:i.seq(),suiteName:n}),bus:u},i.assign(c.bind(n,(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return s.reset(),G({type:t.SUITE},(function(){r.apply(void 0,n)})),u.emit(vt.SUITE_CALLBACK_DONE_RUNNING),lt()})),{get:c.bind(n,at),remove:c.bind(n,(function(t){u.emit(vt.REMOVE_FIELD,t)})),reset:s.reset,resetField:c.bind(n,(function(t){u.emit(vt.RESET_FIELD,t)}))})},exports.each=function(n,e){i.invariant(i.isFunction(e),"each callback must be a function"),G({type:t.EACH},(function(){n.forEach((function(t,n){e(t,n)}))}))},exports.eager=function(){!function(t){c.useX().mode[0]=t}(e.EAGER)},exports.group=function(n,e){i.invariant(i.isStringValue(n),_t("name must be a string")),i.invariant(i.isFunction(e),_t("callback must be a function")),G({type:t.GROUP},(function(){c.run({groupName:n},e)}))},exports.include=function(t){var n=c.useX(),e=n.inclusion;return n=n.exclusion,i.invariant(i.isStringValue(t)),e[t]=i.defaultTo(n.tests[t],!0),{when:function(n){var e=c.useX(),r=e.exclusion;e.inclusion[t]=function(){return i.hasOwnProperty(r.tests,t)?i.defaultTo(r.tests[t],!0):i.isStringValue(n)?!!r.tests[n]:i.optionalFunctionValue(n,i.optionalFunctionValue(at))}}}},exports.omitWhen=function(n,e){G({type:t.OMIT_WHEN},(function(){c.run({omitted:Ot()||i.optionalFunctionValue(n,i.optionalFunctionValue(at))},(function(){return e()}))}))},exports.only=mt,exports.optional=function(t){if(i.isArray(t)||i.isStringValue(t))i.asArray(t).forEach((function(t){v(t,(function(){return{type:H.Delayed,applied:!1,rule:null}}))}));else{var n,e=function(n){var e=t[n];v(n,(function(){return{type:H.Immediate,rule:e,applied:i.optionalFunctionValue(e)}}))};for(n in t)e(n)}},exports.skip=Rt,exports.skipWhen=function(n,e){G({type:t.SKIP_WHEN},(function(){c.run({skipped:yt()||i.optionalFunctionValue(n,i.optionalFunctionValue(at))},(function(){return e()}))}))},exports.suiteSelectors=nt,exports.test=Wt,exports.warn=function(){var t=c.useX("warn hook called outside of a running suite.");i.invariant(t.currentTest,"warn called outside of a test."),t.currentTest.warn()};
@@ -0,0 +1,4 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ var compose = import('n4s/compose');
3
+
4
+ export default compose;
@@ -0,0 +1 @@
1
+ var o=import("n4s/compose");export default o;
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -1659,6 +1659,6 @@ function warn() {
1659
1659
  ctx.currentTest.warn();
1660
1660
  }
1661
1661
 
1662
- var VERSION = "4.6.2-dev-fcaa09";
1662
+ var VERSION = "4.6.2-dev-b07a89";
1663
1663
 
1664
1664
  export { VERSION, context, create, each, eager, group, include, omitWhen, only, optional, skip, skipWhen, suiteSelectors, test, warn };
@@ -1 +1 @@
1
- import{createState as t}from"vast";import{createCascade as n}from"context";import{isUndefined as e,isStringValue as r,assign as i,cache as u,nestedArray as s,asArray as o,seq as a,isNullish as c,deferThrow as f,invariant as l,isFunction as d,bindNot as p,either as v,isArray as E,optionalFunctionValue as N,isEmpty as m,isNotEmpty as h,isPositive as g,numberEquals as y,hasOwnProperty as R,callEach as S,bus as C,defaultTo as T,isPromise as _,isNull as O}from"vest-utils";export{enforce}from"n4s";var I,A=I||(I={});A[A.DEFAULT=0]="DEFAULT",A[A.SUITE=1]="SUITE",A[A.EACH=2]="EACH",A[A.SKIP_WHEN=3]="SKIP_WHEN",A[A.OMIT_WHEN=4]="OMIT_WHEN",A[A.GROUP=5]="GROUP";var k,b=k||(k={});function U(){var t=0;return{current:function(){return t},next:function(){t++}}}function L(t,n){return void 0===n&&(n=[]),{cursor:U(),keys:{current:{},prev:{}},path:n,type:t}}b[b.ALL=0]="ALL",b[b.EAGER=1]="EAGER";var F=n((function(t,n){return n?null:i({exclusion:{tests:{},groups:{}},inclusion:{},isolate:L(I.DEFAULT),mode:[k.ALL]},t)}));function D(){return F.useX().stateRef}function W(t,n){(0,D().optionalFields()[1])((function(e){var r;return i(e,((r={})[t]=i({},e[t],n(e[t])),r))}))}function P(t){var n;return null!==(n=D().optionalFields()[0][t])&&void 0!==n?n:{}}function G(){w((function(t){return t}))}function w(t){(0,D().testObjects()[1])((function(n){return{prev:n.prev,current:o(t(n.current))}}))}function x(){return H().filter((function(t){return t.isPending()}))}var X=u();function H(){var t=D().testObjects()[0].current;return X([t],(function(){return s.flatten(t)}))}var K,M=K||(K={});M.Error="error",M.Warning="warning";var q=function(){function t(t,n,e){var r=void 0===e?{}:e;e=r.message;var i=r.groupName;r=r.key,this.key=null,this.id=a(),this.severity=K.Error,this.status=B,this.fieldName=t,this.testFn=n,i&&(this.groupName=i),e&&(this.message=e),r&&(this.key=r)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){t=n,e(this.message)&&r(t)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==Z||(this.status=t)},t.prototype.warns=function(){return this.severity===K.Warning},t.prototype.setPending=function(){this.setStatus(z)},t.prototype.fail=function(){this.setStatus(this.warns()?Y:j)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(J)},t.prototype.warn=function(){this.severity=K.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(V)},t.prototype.cancel=function(){this.setStatus(Q),G()},t.prototype.reset=function(){this.status=B,G()},t.prototype.omit=function(){this.setStatus(Z)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(z)},t.prototype.isOmitted=function(){return this.statusEquals(Z)},t.prototype.isUntested=function(){return this.statusEquals(B)},t.prototype.isFailing=function(){return this.statusEquals(j)},t.prototype.isCanceled=function(){return this.statusEquals(Q)},t.prototype.isSkipped=function(){return this.statusEquals(V)},t.prototype.isPassing=function(){return this.statusEquals(J)},t.prototype.isWarning=function(){return this.statusEquals(Y)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),B="UNTESTED",V="SKIPPED",j="FAILED",Y="WARNING",J="PASSING",z="PENDING",Q="CANCELED",Z="OMITTED";function $(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function tt(){return F.useX().isolate}function nt(){var t=tt();return t.path.concat(t.cursor.current())}function et(t,n){t=void 0===(t=t.type)?I.DEFAULT:t,l(d(n));var e=L(t,nt());return t=F.run({isolate:e},(function(){return e.keys.prev=function(){var t=D().testObjects()[0].prev;return o(s.getCurrent(t,nt())).reduce((function(t,n){return n instanceof q&&!c(n.key)?(t[n.key]=n,t):t}),{})}(),w((function(t){return s.setValueAtPath(t,e.path,[])})),n()})),tt().cursor.next(),t}var rt,it=rt||(rt={});it.WARNINGS="warnings",it.ERRORS="errors";var ut,st=ut||(ut={});function ot(t,n){return!(!n||t.fieldName!==n)}st.ERROR_COUNT="errorCount",st.WARN_COUNT="warnCount";var at=p((function(t,n){return t.groupName===n}));function ct(t,n){return H().some((function(e){return ft(e,t,n)}))}function ft(t,n,e){return!(!t.hasFailures()||e&&!ot(t,e)||v(n===rt.WARNINGS,t.warns()))}function lt(t){return!!t&&P(t).applied}var dt,pt=dt||(dt={});function vt(t){if(lt(t))return!0;var n=H();return!(m(n)||ct(rt.ERRORS,t)||function(t){return h(x().filter((function(n){return Et(n,t)})))}(t))&&function(t){return H().every((function(n){return Nt(n,t)}))}(t)}function Et(t,n){return!(n&&!ot(t,n))&&lt(n)}function Nt(t,n){return!(!n||ot(t,n))||(P(t.fieldName).type===dt.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function mt(){var t=H(),n=i({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){var e=t.tests;e[n.fieldName]=ht(e,n),e[n.fieldName].valid=!1!==e[n.fieldName].valid&&vt(n.fieldName);var r=t.groups,i=n.groupName;return i&&(r[i]=r[i]||{},r[i][n.fieldName]=ht(r[i],n),e=r[i][n.fieldName],!1===r[i][n.fieldName].valid?n=!1:n=!!lt(n=n.fieldName)||!function(t,n,e){return H().some((function(r){return!at(r,n)&&ft(r,t,e)}))}(rt.ERRORS,i,n)&&!function(t,n){return h(x().filter((function(e){return!at(e,t)&&Et(e,n)})))}(i,n)&&function(t,n){return H().every((function(e){return!!at(e,t)||Nt(e,n)}))}(i,n),e.valid=n),t}),n),n.valid=vt(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function ht(t,n){function e(t){s[t===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT]++,u&&(s[t]=(s[t]||[]).concat(u))}var r=n.fieldName,u=n.message;t[r]=t[r]||i({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var s=t[r];return n.isNonActionable()||(t[r].testCount++,n.isFailing()?e(rt.ERRORS):n.isWarning()&&e(rt.WARNINGS)),s}function gt(t,n,e){if(e){var r;t=(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}else{for(var i in r={},e=n===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT,t)g(t[i][e])&&(r[i]=t[i][n]||[]);t=r}return t}function yt(t){return{getErrors:function(n){return gt(t.tests,rt.ERRORS,n)},getErrorsByGroup:function(n,e){return gt(t.groups[n],rt.ERRORS,e)},getWarnings:function(n){return gt(t.tests,rt.WARNINGS,n)},getWarningsByGroup:function(n,e){return gt(t.groups[n],rt.WARNINGS,e)},hasErrors:function(n){return Ct(t,ut.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return St(t,ut.ERROR_COUNT,n,e)},hasWarnings:function(n){return Ct(t,ut.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return St(t,ut.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return Rt(n,e);for(var r in n)if(!Rt(n,r))return!1;return!0}}}function Rt(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function St(t,n,e,r){var i,u;if(!(t=t.groups[e]))return!1;if(r)return g(null===(i=t[r])||void 0===i?void 0:i[n]);for(var s in t)if(g(null===(u=t[s])||void 0===u?void 0:u[n]))return!0;return!1}function Ct(t,n,e){var r;return t=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0,g(t)}pt[pt.Immediate=0]="Immediate",pt[pt.Delayed=1]="Delayed";var Tt=u(1);function _t(){var t=H(),n={stateRef:D()};return Tt([t],F.bind(n,(function(){var t=mt(),n=D().suiteName()[0];return i(t,yt(t),{suiteName:n})})))}function Ot(t){var n=x();return!m(n)&&(!t||n.some((function(n){return ot(n,t)})))}var It=u(20);function At(){var t=H(),n={stateRef:D()};return It([t],F.bind(n,(function(){return i({},_t(),{done:F.bind(n,Ut)})})))}function kt(t,n,e){var r;return!!(!d(t)||n&&y(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function bt(t){return!(Ot()&&(!t||Ot(t)))}function Ut(){function t(){return r(_t())}for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];return n=n[1],e=At(),kt(r,n,e)?e:bt(n)?(t(),e):(Lt(t,n),e)}function Lt(t,n){(0,D().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function Ft(){var t=C.createBus();return t.on(Wt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var e=D().testCallbacks()[0].fieldCallbacks;n&&!Ot(n)&&E(e[n])&&S(e[n]),Ot()||t.emit(Wt.ALL_RUNNING_TESTS_FINISHED)}})),t.on(Wt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){e[t.fieldName]&&(t.omit(),W(t.fieldName,(function(){return{applied:!0}})))}var n=D().optionalFields()[0];if(!m(n)){var e={};H().forEach((function(n){if(R(e,n.fieldName))t(n);else{var r=P(n.fieldName);r.type===dt.Immediate&&(e[n.fieldName]=N(r.rule),t(n))}})),G()}}()})),t.on(Wt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=D().testCallbacks()[0].doneCallbacks;S(t)})),t.on(Wt.REMOVE_FIELD,(function(t){H().forEach((function(n){ot(n,t)&&(n.cancel(),function(t){w((function(n){return s.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Wt.RESET_FIELD,(function(t){H().forEach((function(n){ot(n,t)&&n.reset()}))})),t}function Dt(){var t=F.useX();return l(t.bus),t.bus}var Wt,Pt=Wt||(Wt={});function Gt(t){return xt(0,"tests",t)}function wt(t){return xt(1,"tests",t)}function xt(t,n,e){var i=F.useX("hook called outside of a running suite.");e&&o(e).forEach((function(e){r(e)&&(i.exclusion[n][e]=0===t)}))}function Xt(t){for(var n in t)if(!0===t[n])return!0;return!1}function Ht(){var t,n=F.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function Kt(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function Mt(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function qt(t){var n=t.asyncTest,e=t.message;if(_(n)){var i=Dt().emit,u=D(),s=F.bind({stateRef:u},(function(){G(),i(Wt.TEST_COMPLETED,t)}));u=F.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=r(n)?n:e,t.fail(),s())})),n.then(s,u)}}function Bt(t){var n=D().testObjects()[0].prev;if(m(n))return Vt(t),t;var e=nt();if(n=s.valueAtPath(n,e),!c(t.key)){n=t.key,(e=tt().keys.prev[n])&&(t=e),e=t;var r=tt().keys.current;return c(r[n])?r[n]=e:f('Encountered the same test key "'.concat(n,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.")),Vt(t),t}return!h(e=n)||e.fieldName===t.fieldName&&e.groupName===t.groupName||(tt().type===I.EACH||f("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(t.fieldName,'\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.')),function(){var t=tt().cursor.current();w((function(n){return n.splice(t),n}))}(),n=null),Vt(t=T(n,t)),t}function Vt(t){var n=nt();w((function(e){return s.setValueAtPath(e,n,t)}))}function jt(t){var n=tt().cursor,e=k.EAGER;if(F.useX().mode[0]===e&&ct(rt.ERRORS,t.fieldName))return t.skip(),Bt(t),n.next(),t;if(e=Bt(t),F.useX().omitted||lt(t.fieldName))return e.omit(),n.next(),e;if(function(t){var n=t.fieldName;if(t=t.groupName,F.useX().skipped)return!0;var e=F.useX(),r=e.exclusion;e=e.inclusion;var i=r.tests,u=i[n];if(!1===u)return!0;if(u=!0===u,t){var s=F.useX().exclusion.groups;if(s=R(s,t)?!1===s[t]:Ht())return!0;if(!0===r.groups[t])return!(u||!Xt(i)&&!1!==i[n])}return!!(t=!!Ht()&&!t)||!u&&!!Xt(i)&&!N(e[n])}(t))return e.skip(!!F.useX().skipped),n.next(),e;if(t!==e&&e.fieldName===t.fieldName&&e.groupName===t.groupName&&e.isPending()&&e.cancel(),Vt(t),t.isUntested()){e=Dt();var r=function(t){return F.run({currentTest:t},(function(){return t.run()}))}(t);try{_(r)?(t.asyncTest=r,t.setPending(),qt(t)):e.emit(Wt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}else _(t.asyncTest)&&(t.setPending(),qt(t));return n.next(),t}function Yt(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=d(n[1])?n:Mt([void 0],n,!0);n=i[0],e=i[1],i=i[2],l(r(t),Zt("fieldName","string")),l(d(e),Zt("Test callback","function"));var u=F.useX();return jt(n=new q(t,e,{message:n,groupName:u.groupName,key:i}))}Pt.TEST_COMPLETED="test_completed",Pt.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",Pt.REMOVE_FIELD="remove_field",Pt.RESET_FIELD="reset_field",Pt.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running",Gt.group=function(t){return xt(0,"groups",t)},wt.group=function(t){return xt(1,"groups",t)};var Jt,zt,Qt=i(Yt,{memo:(Jt=Yt,zt=u(10),function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];e=tt().cursor.current();var r=(n=n.reverse())[0],i=n[1],u=n[2];return e=[D().suiteId()[0],t,e].concat(r),n=zt.get(e),O(n)?zt(e,(function(){return Jt(t,u,i)})):n[1].isCanceled()?(zt.invalidate(e),zt(e,(function(){return Jt(t,u,i)}))):jt(n[1])})});function Zt(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}var $t="4.6.2-dev-fcaa09";function tn(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];n=n[1],l(d(r),"vest.create: Expected callback to be a function.");var u=Ft(),s=t();return n={stateRef:$(s,{suiteId:a(),suiteName:n}),bus:u},i(F.bind(n,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return s.reset(),et({type:I.SUITE},(function(){r.apply(void 0,t)})),u.emit(Wt.SUITE_CALLBACK_DONE_RUNNING),At()})),{get:F.bind(n,_t),remove:F.bind(n,(function(t){u.emit(Wt.REMOVE_FIELD,t)})),reset:s.reset,resetField:F.bind(n,(function(t){u.emit(Wt.RESET_FIELD,t)}))})}function nn(t,n){l(d(n),"each callback must be a function"),et({type:I.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))}function en(){var t=k.EAGER;F.useX().mode[0]=t}function rn(t,n){l(r(t),Kt("name must be a string")),l(d(n),Kt("callback must be a function")),et({type:I.GROUP},(function(){F.run({groupName:t},n)}))}function un(t){var n=F.useX(),e=n.inclusion;return n=n.exclusion,l(r(t)),e[t]=T(n.tests[t],!0),{when:function(n){var e=F.useX(),i=e.exclusion;e.inclusion[t]=function(){return R(i.tests,t)?T(i.tests[t],!0):r(n)?!!i.tests[n]:N(n,N(_t))}}}}function sn(t,n){et({type:I.OMIT_WHEN},(function(){F.run({omitted:!!F.useX().omitted||N(t,N(_t))},(function(){return n()}))}))}function on(t){if(E(t)||r(t))o(t).forEach((function(t){W(t,(function(){return{type:dt.Delayed,applied:!1,rule:null}}))}));else{var n,e=function(n){var e=t[n];W(n,(function(){return{type:dt.Immediate,rule:e,applied:N(e)}}))};for(n in t)e(n)}}function an(t,n){et({type:I.SKIP_WHEN},(function(){F.run({skipped:!!F.useX().skipped||N(t,N(_t))},(function(){return n()}))}))}function cn(){var t=F.useX("warn hook called outside of a running suite.");l(t.currentTest,"warn called outside of a test."),t.currentTest.warn()}export{$t as VERSION,F as context,tn as create,nn as each,en as eager,rn as group,un as include,sn as omitWhen,Gt as only,on as optional,wt as skip,an as skipWhen,yt as suiteSelectors,Qt as test,cn as warn};
1
+ import{createState as t}from"vast";import{createCascade as n}from"context";import{isUndefined as e,isStringValue as r,assign as i,cache as u,nestedArray as s,asArray as o,seq as a,isNullish as c,deferThrow as f,invariant as l,isFunction as d,bindNot as p,either as v,isArray as E,optionalFunctionValue as N,isEmpty as m,isNotEmpty as h,isPositive as g,numberEquals as y,hasOwnProperty as R,callEach as S,bus as C,defaultTo as T,isPromise as _,isNull as O}from"vest-utils";export{enforce}from"n4s";var I,A=I||(I={});A[A.DEFAULT=0]="DEFAULT",A[A.SUITE=1]="SUITE",A[A.EACH=2]="EACH",A[A.SKIP_WHEN=3]="SKIP_WHEN",A[A.OMIT_WHEN=4]="OMIT_WHEN",A[A.GROUP=5]="GROUP";var b,k=b||(b={});function U(){var t=0;return{current:function(){return t},next:function(){t++}}}function L(t,n){return void 0===n&&(n=[]),{cursor:U(),keys:{current:{},prev:{}},path:n,type:t}}k[k.ALL=0]="ALL",k[k.EAGER=1]="EAGER";var F=n((function(t,n){return n?null:i({exclusion:{tests:{},groups:{}},inclusion:{},isolate:L(I.DEFAULT),mode:[b.ALL]},t)}));function D(){return F.useX().stateRef}function W(t,n){(0,D().optionalFields()[1])((function(e){var r;return i(e,((r={})[t]=i({},e[t],n(e[t])),r))}))}function P(t){var n;return null!==(n=D().optionalFields()[0][t])&&void 0!==n?n:{}}function G(){w((function(t){return t}))}function w(t){(0,D().testObjects()[1])((function(n){return{prev:n.prev,current:o(t(n.current))}}))}function x(){return H().filter((function(t){return t.isPending()}))}var X=u();function H(){var t=D().testObjects()[0].current;return X([t],(function(){return s.flatten(t)}))}var K,M=K||(K={});M.Error="error",M.Warning="warning";var q=function(){function t(t,n,e){var r=void 0===e?{}:e;e=r.message;var i=r.groupName;r=r.key,this.key=null,this.id=a(),this.severity=K.Error,this.status=B,this.fieldName=t,this.testFn=n,i&&(this.groupName=i),e&&(this.message=e),r&&(this.key=r)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){t=n,e(this.message)&&r(t)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==Z||(this.status=t)},t.prototype.warns=function(){return this.severity===K.Warning},t.prototype.setPending=function(){this.setStatus(z)},t.prototype.fail=function(){this.setStatus(this.warns()?Y:j)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(J)},t.prototype.warn=function(){this.severity=K.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(V)},t.prototype.cancel=function(){this.setStatus(Q),G()},t.prototype.reset=function(){this.status=B,G()},t.prototype.omit=function(){this.setStatus(Z)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(z)},t.prototype.isOmitted=function(){return this.statusEquals(Z)},t.prototype.isUntested=function(){return this.statusEquals(B)},t.prototype.isFailing=function(){return this.statusEquals(j)},t.prototype.isCanceled=function(){return this.statusEquals(Q)},t.prototype.isSkipped=function(){return this.statusEquals(V)},t.prototype.isPassing=function(){return this.statusEquals(J)},t.prototype.isWarning=function(){return this.statusEquals(Y)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),B="UNTESTED",V="SKIPPED",j="FAILED",Y="WARNING",J="PASSING",z="PENDING",Q="CANCELED",Z="OMITTED";function $(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function tt(){return F.useX().isolate}function nt(){var t=tt();return t.path.concat(t.cursor.current())}function et(t,n){t=void 0===(t=t.type)?I.DEFAULT:t,l(d(n));var e=L(t,nt());return t=F.run({isolate:e},(function(){return e.keys.prev=function(){var t=D().testObjects()[0].prev;return o(s.getCurrent(t,nt())).reduce((function(t,n){return n instanceof q&&!c(n.key)?(t[n.key]=n,t):t}),{})}(),w((function(t){return s.setValueAtPath(t,e.path,[])})),n()})),tt().cursor.next(),t}var rt,it=rt||(rt={});it.WARNINGS="warnings",it.ERRORS="errors";var ut,st=ut||(ut={});function ot(t,n){return!(!n||t.fieldName!==n)}st.ERROR_COUNT="errorCount",st.WARN_COUNT="warnCount";var at=p((function(t,n){return t.groupName===n}));function ct(t,n){return H().some((function(e){return ft(e,t,n)}))}function ft(t,n,e){return!(!t.hasFailures()||e&&!ot(t,e)||v(n===rt.WARNINGS,t.warns()))}function lt(t){return!!t&&P(t).applied}var dt,pt=dt||(dt={});function vt(t){if(lt(t))return!0;var n=H();return!(m(n)||ct(rt.ERRORS,t)||function(t){return h(x().filter((function(n){return Et(n,t)})))}(t))&&function(t){return H().every((function(n){return Nt(n,t)}))}(t)}function Et(t,n){return!(n&&!ot(t,n))&&lt(n)}function Nt(t,n){return!(!n||ot(t,n))||(P(t.fieldName).type===dt.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function mt(){var t=H(),n=i({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){var e=t.tests;e[n.fieldName]=ht(e,n),e[n.fieldName].valid=!1!==e[n.fieldName].valid&&vt(n.fieldName);var r=t.groups,i=n.groupName;return i&&(r[i]=r[i]||{},r[i][n.fieldName]=ht(r[i],n),e=r[i][n.fieldName],!1===r[i][n.fieldName].valid?n=!1:n=!!lt(n=n.fieldName)||!function(t,n,e){return H().some((function(r){return!at(r,n)&&ft(r,t,e)}))}(rt.ERRORS,i,n)&&!function(t,n){return h(x().filter((function(e){return!at(e,t)&&Et(e,n)})))}(i,n)&&function(t,n){return H().every((function(e){return!!at(e,t)||Nt(e,n)}))}(i,n),e.valid=n),t}),n),n.valid=vt(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function ht(t,n){function e(t){s[t===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT]++,u&&(s[t]=(s[t]||[]).concat(u))}var r=n.fieldName,u=n.message;t[r]=t[r]||i({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var s=t[r];return n.isNonActionable()||(t[r].testCount++,n.isFailing()?e(rt.ERRORS):n.isWarning()&&e(rt.WARNINGS)),s}function gt(t,n,e){if(e){var r;t=(null===(r=null==t?void 0:t[e])||void 0===r?void 0:r[n])||[]}else{for(var i in r={},e=n===rt.ERRORS?ut.ERROR_COUNT:ut.WARN_COUNT,t)g(t[i][e])&&(r[i]=t[i][n]||[]);t=r}return t}function yt(t){return{getErrors:function(n){return gt(t.tests,rt.ERRORS,n)},getErrorsByGroup:function(n,e){return gt(t.groups[n],rt.ERRORS,e)},getWarnings:function(n){return gt(t.tests,rt.WARNINGS,n)},getWarningsByGroup:function(n,e){return gt(t.groups[n],rt.WARNINGS,e)},hasErrors:function(n){return Ct(t,ut.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return St(t,ut.ERROR_COUNT,n,e)},hasWarnings:function(n){return Ct(t,ut.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return St(t,ut.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return Rt(n,e);for(var r in n)if(!Rt(n,r))return!1;return!0}}}function Rt(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function St(t,n,e,r){var i,u;if(!(t=t.groups[e]))return!1;if(r)return g(null===(i=t[r])||void 0===i?void 0:i[n]);for(var s in t)if(g(null===(u=t[s])||void 0===u?void 0:u[n]))return!0;return!1}function Ct(t,n,e){var r;return t=e?null===(r=t.tests[e])||void 0===r?void 0:r[n]:t[n]||0,g(t)}pt[pt.Immediate=0]="Immediate",pt[pt.Delayed=1]="Delayed";var Tt=u(1);function _t(){var t=H(),n={stateRef:D()};return Tt([t],F.bind(n,(function(){var t=mt(),n=D().suiteName()[0];return i(t,yt(t),{suiteName:n})})))}function Ot(t){var n=x();return!m(n)&&(!t||n.some((function(n){return ot(n,t)})))}var It=u(20);function At(){var t=H(),n={stateRef:D()};return It([t],F.bind(n,(function(){return i({},_t(),{done:F.bind(n,Ut)})})))}function bt(t,n,e){var r;return!!(!d(t)||n&&y(null===(r=e.tests[n])||void 0===r?void 0:r.testCount,0))}function kt(t){return!(Ot()&&(!t||Ot(t)))}function Ut(){function t(){return r(_t())}for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];return n=n[1],e=At(),bt(r,n,e)?e:kt(n)?(t(),e):(Lt(t,n),e)}function Lt(t,n){(0,D().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function Ft(){var t=C.createBus();return t.on(Wt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var e=D().testCallbacks()[0].fieldCallbacks;n&&!Ot(n)&&E(e[n])&&S(e[n]),Ot()||t.emit(Wt.ALL_RUNNING_TESTS_FINISHED)}})),t.on(Wt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){e[t.fieldName]&&(t.omit(),W(t.fieldName,(function(){return{applied:!0}})))}var n=D().optionalFields()[0];if(!m(n)){var e={};H().forEach((function(n){if(R(e,n.fieldName))t(n);else{var r=P(n.fieldName);r.type===dt.Immediate&&(e[n.fieldName]=N(r.rule),t(n))}})),G()}}()})),t.on(Wt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=D().testCallbacks()[0].doneCallbacks;S(t)})),t.on(Wt.REMOVE_FIELD,(function(t){H().forEach((function(n){ot(n,t)&&(n.cancel(),function(t){w((function(n){return s.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Wt.RESET_FIELD,(function(t){H().forEach((function(n){ot(n,t)&&n.reset()}))})),t}function Dt(){var t=F.useX();return l(t.bus),t.bus}var Wt,Pt=Wt||(Wt={});function Gt(t){return xt(0,"tests",t)}function wt(t){return xt(1,"tests",t)}function xt(t,n,e){var i=F.useX("hook called outside of a running suite.");e&&o(e).forEach((function(e){r(e)&&(i.exclusion[n][e]=0===t)}))}function Xt(t){for(var n in t)if(!0===t[n])return!0;return!1}function Ht(){var t,n=F.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function Kt(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function Mt(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function qt(t){var n=t.asyncTest,e=t.message;if(_(n)){var i=Dt().emit,u=D(),s=F.bind({stateRef:u},(function(){G(),i(Wt.TEST_COMPLETED,t)}));u=F.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=r(n)?n:e,t.fail(),s())})),n.then(s,u)}}function Bt(t){var n=D().testObjects()[0].prev;if(m(n))return Vt(t),t;var e=nt();if(n=s.valueAtPath(n,e),!c(t.key)){n=t.key,(e=tt().keys.prev[n])&&(t=e),e=t;var r=tt().keys.current;return c(r[n])?r[n]=e:f('Encountered the same test key "'.concat(n,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.")),Vt(t),t}return!h(e=n)||e.fieldName===t.fieldName&&e.groupName===t.groupName||(tt().type===I.EACH||f("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(t.fieldName,'\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.')),function(){var t=tt().cursor.current();w((function(n){return n.splice(t),n}))}(),n=null),Vt(t=T(n,t)),t}function Vt(t){var n=nt();w((function(e){return s.setValueAtPath(e,n,t)}))}function jt(t){var n=tt().cursor,e=b.EAGER;if(F.useX().mode[0]===e&&ct(rt.ERRORS,t.fieldName))return t.skip(),Bt(t),n.next(),t;if(e=Bt(t),F.useX().omitted||lt(t.fieldName))return e.omit(),n.next(),e;if(function(t){var n=t.fieldName;if(t=t.groupName,F.useX().skipped)return!0;var e=F.useX(),r=e.exclusion;e=e.inclusion;var i=r.tests,u=i[n];if(!1===u)return!0;if(u=!0===u,t){var s=F.useX().exclusion.groups;if(s=R(s,t)?!1===s[t]:Ht())return!0;if(!0===r.groups[t])return!(u||!Xt(i)&&!1!==i[n])}return!!(t=!!Ht()&&!t)||!u&&!!Xt(i)&&!N(e[n])}(t))return e.skip(!!F.useX().skipped),n.next(),e;if(t!==e&&e.fieldName===t.fieldName&&e.groupName===t.groupName&&e.isPending()&&e.cancel(),Vt(t),t.isUntested()){e=Dt();var r=function(t){return F.run({currentTest:t},(function(){return t.run()}))}(t);try{_(r)?(t.asyncTest=r,t.setPending(),qt(t)):e.emit(Wt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}else _(t.asyncTest)&&(t.setPending(),qt(t));return n.next(),t}function Yt(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=d(n[1])?n:Mt([void 0],n,!0);n=i[0],e=i[1],i=i[2],l(r(t),Zt("fieldName","string")),l(d(e),Zt("Test callback","function"));var u=F.useX();return jt(n=new q(t,e,{message:n,groupName:u.groupName,key:i}))}Pt.TEST_COMPLETED="test_completed",Pt.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",Pt.REMOVE_FIELD="remove_field",Pt.RESET_FIELD="reset_field",Pt.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running",Gt.group=function(t){return xt(0,"groups",t)},wt.group=function(t){return xt(1,"groups",t)};var Jt,zt,Qt=i(Yt,{memo:(Jt=Yt,zt=u(10),function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];e=tt().cursor.current();var r=(n=n.reverse())[0],i=n[1],u=n[2];return e=[D().suiteId()[0],t,e].concat(r),n=zt.get(e),O(n)?zt(e,(function(){return Jt(t,u,i)})):n[1].isCanceled()?(zt.invalidate(e),zt(e,(function(){return Jt(t,u,i)}))):jt(n[1])})});function Zt(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}var $t="4.6.2-dev-b07a89";function tn(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=(n=n.reverse())[0];n=n[1],l(d(r),"vest.create: Expected callback to be a function.");var u=Ft(),s=t();return n={stateRef:$(s,{suiteId:a(),suiteName:n}),bus:u},i(F.bind(n,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return s.reset(),et({type:I.SUITE},(function(){r.apply(void 0,t)})),u.emit(Wt.SUITE_CALLBACK_DONE_RUNNING),At()})),{get:F.bind(n,_t),remove:F.bind(n,(function(t){u.emit(Wt.REMOVE_FIELD,t)})),reset:s.reset,resetField:F.bind(n,(function(t){u.emit(Wt.RESET_FIELD,t)}))})}function nn(t,n){l(d(n),"each callback must be a function"),et({type:I.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))}function en(){var t=b.EAGER;F.useX().mode[0]=t}function rn(t,n){l(r(t),Kt("name must be a string")),l(d(n),Kt("callback must be a function")),et({type:I.GROUP},(function(){F.run({groupName:t},n)}))}function un(t){var n=F.useX(),e=n.inclusion;return n=n.exclusion,l(r(t)),e[t]=T(n.tests[t],!0),{when:function(n){var e=F.useX(),i=e.exclusion;e.inclusion[t]=function(){return R(i.tests,t)?T(i.tests[t],!0):r(n)?!!i.tests[n]:N(n,N(_t))}}}}function sn(t,n){et({type:I.OMIT_WHEN},(function(){F.run({omitted:!!F.useX().omitted||N(t,N(_t))},(function(){return n()}))}))}function on(t){if(E(t)||r(t))o(t).forEach((function(t){W(t,(function(){return{type:dt.Delayed,applied:!1,rule:null}}))}));else{var n,e=function(n){var e=t[n];W(n,(function(){return{type:dt.Immediate,rule:e,applied:N(e)}}))};for(n in t)e(n)}}function an(t,n){et({type:I.SKIP_WHEN},(function(){F.run({skipped:!!F.useX().skipped||N(t,N(_t))},(function(){return n()}))}))}function cn(){var t=F.useX("warn hook called outside of a running suite.");l(t.currentTest,"warn called outside of a test."),t.currentTest.warn()}export{$t as VERSION,F as context,tn as create,nn as each,en as eager,rn as group,un as include,sn as omitWhen,Gt as only,on as optional,wt as skip,an as skipWhen,yt as suiteSelectors,Qt as test,cn as warn};
@@ -0,0 +1,12 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.compose = factory());
5
+ }(this, (function () { 'use strict';
6
+
7
+ // eslint-disable-next-line import/no-unresolved
8
+ var compose = import('n4s/compose');
9
+
10
+ return compose;
11
+
12
+ })));
@@ -0,0 +1 @@
1
+ "use strict";!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).compose=o()}(this,(function(){return import("n4s/compose")}));
@@ -1660,7 +1660,7 @@
1660
1660
  ctx.currentTest.warn();
1661
1661
  }
1662
1662
 
1663
- var VERSION = "4.6.2-dev-fcaa09";
1663
+ var VERSION = "4.6.2-dev-b07a89";
1664
1664
 
1665
1665
  Object.defineProperty(exports, 'enforce', {
1666
1666
  enumerable: true,
@@ -1 +1 @@
1
- "use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("n4s"),require("vest-utils"),require("context"),require("vast")):"function"==typeof define&&define.amd?define(["exports","n4s","vest-utils","context","vast"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).vest={},t.n4s,t["vest-utils"],t.context,t.vast)}(this,(function(t,n,e,r,i){function u(){var t=0;return{current:function(){return t},next:function(){t++}}}function s(t,n){return void 0===n&&(n=[]),{cursor:u(),keys:{current:{},prev:{}},path:n,type:t}}function o(){return rt.useX().stateRef}function a(t,n){(0,o().optionalFields()[1])((function(r){var i;return e.assign(r,((i={})[t]=e.assign({},r[t],n(r[t])),i))}))}function c(t){var n;return null!==(n=o().optionalFields()[0][t])&&void 0!==n?n:{}}function f(){l((function(t){return t}))}function l(t){(0,o().testObjects()[1])((function(n){return{prev:n.prev,current:e.asArray(t(n.current))}}))}function d(){return p().filter((function(t){return t.isPending()}))}function p(){var t=o().testObjects()[0].current;return it([t],(function(){return e.nestedArray.flatten(t)}))}function v(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function E(){return rt.useX().isolate}function g(){var t=E();return t.path.concat(t.cursor.current())}function h(t,n){t=void 0===(t=t.type)?$.DEFAULT:t,e.invariant(e.isFunction(n));var r=s(t,g());return t=rt.run({isolate:r},(function(){return r.keys.prev=function(){var t=o().testObjects()[0].prev;return e.asArray(e.nestedArray.getCurrent(t,g())).reduce((function(t,n){return n instanceof ot&&!e.isNullish(n.key)?(t[n.key]=n,t):t}),{})}(),l((function(t){return e.nestedArray.setValueAtPath(t,r.path,[])})),n()})),E().cursor.next(),t}function N(t,n){return!(!n||t.fieldName!==n)}function m(t,n){return p().some((function(e){return y(e,t,n)}))}function y(t,n,r){return!(!t.hasFailures()||r&&!N(t,r)||e.either(n===ut.WARNINGS,t.warns()))}function R(t){return!!t&&c(t).applied}function S(t){if(R(t))return!0;var n=p();return!(e.isEmpty(n)||m(ut.ERRORS,t)||function(t){return e.isNotEmpty(d().filter((function(n){return T(n,t)})))}(t))&&function(t){return p().every((function(n){return C(n,t)}))}(t)}function T(t,n){return!(n&&!N(t,n))&&R(n)}function C(t,n){return!(!n||N(t,n))||(c(t.fieldName).type===gt.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function O(){var t=p(),n=e.assign({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){var r=t.tests;r[n.fieldName]=A(r,n),r[n.fieldName].valid=!1!==r[n.fieldName].valid&&S(n.fieldName);var i=t.groups,u=n.groupName;return u&&(i[u]=i[u]||{},i[u][n.fieldName]=A(i[u],n),r=i[u][n.fieldName],!1===i[u][n.fieldName].valid?n=!1:n=!!R(n=n.fieldName)||!function(t,n,e){return p().some((function(r){return!ht(r,n)&&y(r,t,e)}))}(ut.ERRORS,u,n)&&!function(t,n){return e.isNotEmpty(d().filter((function(e){return!ht(e,t)&&T(e,n)})))}(u,n)&&function(t,n){return p().every((function(e){return!!ht(e,t)||C(e,n)}))}(u,n),r.valid=n),t}),n),n.valid=S(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function A(t,n){function r(t){s[t===ut.ERRORS?st.ERROR_COUNT:st.WARN_COUNT]++,u&&(s[t]=(s[t]||[]).concat(u))}var i=n.fieldName,u=n.message;t[i]=t[i]||e.assign({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var s=t[i];return n.isNonActionable()||(t[i].testCount++,n.isFailing()?r(ut.ERRORS):n.isWarning()&&r(ut.WARNINGS)),s}function _(t,n,r){if(r){var i;t=(null===(i=null==t?void 0:t[r])||void 0===i?void 0:i[n])||[]}else{for(var u in i={},r=n===ut.ERRORS?st.ERROR_COUNT:st.WARN_COUNT,t)e.isPositive(t[u][r])&&(i[u]=t[u][n]||[]);t=i}return t}function b(t){return{getErrors:function(n){return _(t.tests,ut.ERRORS,n)},getErrorsByGroup:function(n,e){return _(t.groups[n],ut.ERRORS,e)},getWarnings:function(n){return _(t.tests,ut.WARNINGS,n)},getWarningsByGroup:function(n,e){return _(t.groups[n],ut.WARNINGS,e)},hasErrors:function(n){return k(t,st.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return F(t,st.ERROR_COUNT,n,e)},hasWarnings:function(n){return k(t,st.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return F(t,st.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return I(n,e);for(var r in n)if(!I(n,r))return!1;return!0}}}function I(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function F(t,n,r,i){var u,s;if(!(t=t.groups[r]))return!1;if(i)return e.isPositive(null===(u=t[i])||void 0===u?void 0:u[n]);for(var o in t)if(e.isPositive(null===(s=t[o])||void 0===s?void 0:s[n]))return!0;return!1}function k(t,n,r){var i;return t=r?null===(i=t.tests[r])||void 0===i?void 0:i[n]:t[n]||0,e.isPositive(t)}function P(){var t=p(),n={stateRef:o()};return mt([t],rt.bind(n,(function(){var t=O(),n=o().suiteName()[0];return e.assign(t,b(t),{suiteName:n})})))}function U(t){var n=d();return!e.isEmpty(n)&&(!t||n.some((function(n){return N(n,t)})))}function L(){var t=p(),n={stateRef:o()};return yt([t],rt.bind(n,(function(){return e.assign({},P(),{done:rt.bind(n,Rt)})})))}function W(t,n,r){var i;return!!(!e.isFunction(t)||n&&e.numberEquals(null===(i=r.tests[n])||void 0===i?void 0:i.testCount,0))}function D(t){return!(U()&&(!t||U(t)))}function w(t,n){(0,o().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function G(){var t=e.bus.createBus();return t.on(Nt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var r=o().testCallbacks()[0].fieldCallbacks;n&&!U(n)&&e.isArray(r[n])&&e.callEach(r[n]),U()||t.emit(Nt.ALL_RUNNING_TESTS_FINISHED)}})),t.on(Nt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){r[t.fieldName]&&(t.omit(),a(t.fieldName,(function(){return{applied:!0}})))}var n=o().optionalFields()[0];if(!e.isEmpty(n)){var r={};p().forEach((function(n){if(e.hasOwnProperty(r,n.fieldName))t(n);else{var i=c(n.fieldName);i.type===gt.Immediate&&(r[n.fieldName]=e.optionalFunctionValue(i.rule),t(n))}})),f()}}()})),t.on(Nt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=o().testCallbacks()[0].doneCallbacks;e.callEach(t)})),t.on(Nt.REMOVE_FIELD,(function(t){p().forEach((function(n){N(n,t)&&(n.cancel(),function(t){l((function(n){return e.nestedArray.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Nt.RESET_FIELD,(function(t){p().forEach((function(n){N(n,t)&&n.reset()}))})),t}function V(){var t=rt.useX();return e.invariant(t.bus),t.bus}function x(t){return q(0,"tests",t)}function X(t){return q(1,"tests",t)}function q(t,n,r){var i=rt.useX("hook called outside of a running suite.");r&&e.asArray(r).forEach((function(r){e.isStringValue(r)&&(i.exclusion[n][r]=0===t)}))}function H(t){for(var n in t)if(!0===t[n])return!0;return!1}function K(){var t,n=rt.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function M(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function j(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function B(t){var n=t.asyncTest,r=t.message;if(e.isPromise(n)){var i=V().emit,u=o(),s=rt.bind({stateRef:u},(function(){f(),i(Nt.TEST_COMPLETED,t)}));u=rt.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=e.isStringValue(n)?n:r,t.fail(),s())})),n.then(s,u)}}function Y(t){var n=o().testObjects()[0].prev;if(e.isEmpty(n))return J(t),t;var r=g();if(n=e.nestedArray.valueAtPath(n,r),!e.isNullish(t.key)){n=t.key,(r=E().keys.prev[n])&&(t=r),r=t;var i=E().keys.current;return e.isNullish(i[n])?i[n]=r:e.deferThrow('Encountered the same test key "'.concat(n,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.")),J(t),t}return r=n,!e.isNotEmpty(r)||r.fieldName===t.fieldName&&r.groupName===t.groupName||(E().type===$.EACH||e.deferThrow("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(t.fieldName,'\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.')),function(){var t=E().cursor.current();l((function(n){return n.splice(t),n}))}(),n=null),J(t=e.defaultTo(n,t)),t}function J(t){var n=g();l((function(r){return e.nestedArray.setValueAtPath(r,n,t)}))}function z(t){var n=E().cursor,r=nt.EAGER;if(rt.useX().mode[0]===r&&m(ut.ERRORS,t.fieldName))return t.skip(),Y(t),n.next(),t;if(r=Y(t),rt.useX().omitted||R(t.fieldName))return r.omit(),n.next(),r;if(function(t){var n=t.fieldName;if(t=t.groupName,rt.useX().skipped)return!0;var r=rt.useX(),i=r.exclusion;r=r.inclusion;var u=i.tests,s=u[n];if(!1===s)return!0;if(s=!0===s,t){var o=rt.useX().exclusion.groups;if(o=e.hasOwnProperty(o,t)?!1===o[t]:K())return!0;if(!0===i.groups[t])return!(s||!H(u)&&!1!==u[n])}return!!(t=!!K()&&!t)||!s&&!!H(u)&&!e.optionalFunctionValue(r[n])}(t))return r.skip(!!rt.useX().skipped),n.next(),r;if(t!==r&&r.fieldName===t.fieldName&&r.groupName===t.groupName&&r.isPending()&&r.cancel(),J(t),t.isUntested()){r=V();var i=function(t){return rt.run({currentTest:t},(function(){return t.run()}))}(t);try{e.isPromise(i)?(t.asyncTest=i,t.setPending(),B(t)):r.emit(Nt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}else e.isPromise(t.asyncTest)&&(t.setPending(),B(t));return n.next(),t}function Q(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=e.isFunction(n[1])?n:j([void 0],n,!0);n=i[0],r=i[1],i=i[2],e.invariant(e.isStringValue(t),Z("fieldName","string")),e.invariant(e.isFunction(r),Z("Test callback","function"));var u=rt.useX();return z(n=new ot(t,r,{message:n,groupName:u.groupName,key:i}))}function Z(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}var $,tt,nt;(tt=$||($={}))[tt.DEFAULT=0]="DEFAULT",tt[tt.SUITE=1]="SUITE",tt[tt.EACH=2]="EACH",tt[tt.SKIP_WHEN=3]="SKIP_WHEN",tt[tt.OMIT_WHEN=4]="OMIT_WHEN",tt[tt.GROUP=5]="GROUP",function(t){t[t.ALL=0]="ALL",t[t.EAGER=1]="EAGER"}(nt||(nt={}));var et,rt=r.createCascade((function(t,n){return n?null:e.assign({exclusion:{tests:{},groups:{}},inclusion:{},isolate:s($.DEFAULT),mode:[nt.ALL]},t)})),it=e.cache();!function(t){t.Error="error",t.Warning="warning"}(et||(et={}));var ut,st,ot=function(){function t(t,n,r){var i=void 0===r?{}:r;r=i.message;var u=i.groupName;i=i.key,this.key=null,this.id=e.seq(),this.severity=et.Error,this.status=at,this.fieldName=t,this.testFn=n,u&&(this.groupName=u),r&&(this.message=r),i&&(this.key=i)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){t=n,e.isUndefined(this.message)&&e.isStringValue(t)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==Et||(this.status=t)},t.prototype.warns=function(){return this.severity===et.Warning},t.prototype.setPending=function(){this.setStatus(pt)},t.prototype.fail=function(){this.setStatus(this.warns()?lt:ft)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(dt)},t.prototype.warn=function(){this.severity=et.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(ct)},t.prototype.cancel=function(){this.setStatus(vt),f()},t.prototype.reset=function(){this.status=at,f()},t.prototype.omit=function(){this.setStatus(Et)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(pt)},t.prototype.isOmitted=function(){return this.statusEquals(Et)},t.prototype.isUntested=function(){return this.statusEquals(at)},t.prototype.isFailing=function(){return this.statusEquals(ft)},t.prototype.isCanceled=function(){return this.statusEquals(vt)},t.prototype.isSkipped=function(){return this.statusEquals(ct)},t.prototype.isPassing=function(){return this.statusEquals(dt)},t.prototype.isWarning=function(){return this.statusEquals(lt)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),at="UNTESTED",ct="SKIPPED",ft="FAILED",lt="WARNING",dt="PASSING",pt="PENDING",vt="CANCELED",Et="OMITTED";!function(t){t.WARNINGS="warnings",t.ERRORS="errors"}(ut||(ut={})),function(t){t.ERROR_COUNT="errorCount",t.WARN_COUNT="warnCount"}(st||(st={}));var gt,ht=e.bindNot((function(t,n){return t.groupName===n}));!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(gt||(gt={}));var Nt,mt=e.cache(1),yt=e.cache(20),Rt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=(t=t.reverse())[0];if(t=t[1],n=L(),W(e,t,n))return n;var r=function(){return e(P())};return D(t)?(r(),n):(w(r,t),n)};!function(t){t.TEST_COMPLETED="test_completed",t.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",t.REMOVE_FIELD="remove_field",t.RESET_FIELD="reset_field",t.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running"}(Nt||(Nt={})),x.group=function(t){return q(0,"groups",t)},X.group=function(t){return q(1,"groups",t)},r=e.assign(Q,{memo:function(t){var n=e.cache(10);return function(r){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];u=E().cursor.current();var s=(i=i.reverse())[0],a=i[1],c=i[2];return u=[o().suiteId()[0],r,u].concat(s),i=n.get(u),e.isNull(i)?n(u,(function(){return t(r,c,a)})):i[1].isCanceled()?(n.invalidate(u),n(u,(function(){return t(r,c,a)}))):z(i[1])}}(Q)}),Object.defineProperty(t,"enforce",{enumerable:!0,get:function(){return n.enforce}}),t.VERSION="4.6.2-dev-fcaa09",t.context=rt,t.create=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=(t=t.reverse())[0];t=t[1],e.invariant(e.isFunction(r),"vest.create: Expected callback to be a function.");var u=G(),s=i.createState();return t={stateRef:v(s,{suiteId:e.seq(),suiteName:t}),bus:u},e.assign(rt.bind(t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return s.reset(),h({type:$.SUITE},(function(){r.apply(void 0,t)})),u.emit(Nt.SUITE_CALLBACK_DONE_RUNNING),L()})),{get:rt.bind(t,P),remove:rt.bind(t,(function(t){u.emit(Nt.REMOVE_FIELD,t)})),reset:s.reset,resetField:rt.bind(t,(function(t){u.emit(Nt.RESET_FIELD,t)}))})},t.each=function(t,n){e.invariant(e.isFunction(n),"each callback must be a function"),h({type:$.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))},t.eager=function(){var t=nt.EAGER;rt.useX().mode[0]=t},t.group=function(t,n){e.invariant(e.isStringValue(t),M("name must be a string")),e.invariant(e.isFunction(n),M("callback must be a function")),h({type:$.GROUP},(function(){rt.run({groupName:t},n)}))},t.include=function(t){var n=rt.useX(),r=n.inclusion;return n=n.exclusion,e.invariant(e.isStringValue(t)),r[t]=e.defaultTo(n.tests[t],!0),{when:function(n){var r=rt.useX(),i=r.exclusion;r.inclusion[t]=function(){return e.hasOwnProperty(i.tests,t)?e.defaultTo(i.tests[t],!0):e.isStringValue(n)?!!i.tests[n]:e.optionalFunctionValue(n,e.optionalFunctionValue(P))}}}},t.omitWhen=function(t,n){h({type:$.OMIT_WHEN},(function(){rt.run({omitted:!!rt.useX().omitted||e.optionalFunctionValue(t,e.optionalFunctionValue(P))},(function(){return n()}))}))},t.only=x,t.optional=function(t){if(e.isArray(t)||e.isStringValue(t))e.asArray(t).forEach((function(t){a(t,(function(){return{type:gt.Delayed,applied:!1,rule:null}}))}));else{var n,r=function(n){var r=t[n];a(n,(function(){return{type:gt.Immediate,rule:r,applied:e.optionalFunctionValue(r)}}))};for(n in t)r(n)}},t.skip=X,t.skipWhen=function(t,n){h({type:$.SKIP_WHEN},(function(){rt.run({skipped:!!rt.useX().skipped||e.optionalFunctionValue(t,e.optionalFunctionValue(P))},(function(){return n()}))}))},t.suiteSelectors=b,t.test=r,t.warn=function(){var t=rt.useX("warn hook called outside of a running suite.");e.invariant(t.currentTest,"warn called outside of a test."),t.currentTest.warn()},Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ "use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("n4s"),require("vest-utils"),require("context"),require("vast")):"function"==typeof define&&define.amd?define(["exports","n4s","vest-utils","context","vast"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).vest={},t.n4s,t["vest-utils"],t.context,t.vast)}(this,(function(t,n,e,r,i){function u(){var t=0;return{current:function(){return t},next:function(){t++}}}function s(t,n){return void 0===n&&(n=[]),{cursor:u(),keys:{current:{},prev:{}},path:n,type:t}}function o(){return rt.useX().stateRef}function a(t,n){(0,o().optionalFields()[1])((function(r){var i;return e.assign(r,((i={})[t]=e.assign({},r[t],n(r[t])),i))}))}function c(t){var n;return null!==(n=o().optionalFields()[0][t])&&void 0!==n?n:{}}function f(){l((function(t){return t}))}function l(t){(0,o().testObjects()[1])((function(n){return{prev:n.prev,current:e.asArray(t(n.current))}}))}function d(){return p().filter((function(t){return t.isPending()}))}function p(){var t=o().testObjects()[0].current;return it([t],(function(){return e.nestedArray.flatten(t)}))}function v(t,n){var e=n.suiteId;return n=n.suiteName,{optionalFields:t.registerStateKey((function(){return{}})),suiteId:t.registerStateKey(e),suiteName:t.registerStateKey(n),testCallbacks:t.registerStateKey((function(){return{fieldCallbacks:{},doneCallbacks:[]}})),testObjects:t.registerStateKey((function(t){return{prev:t?t.current:[],current:[]}}))}}function E(){return rt.useX().isolate}function g(){var t=E();return t.path.concat(t.cursor.current())}function h(t,n){t=void 0===(t=t.type)?$.DEFAULT:t,e.invariant(e.isFunction(n));var r=s(t,g());return t=rt.run({isolate:r},(function(){return r.keys.prev=function(){var t=o().testObjects()[0].prev;return e.asArray(e.nestedArray.getCurrent(t,g())).reduce((function(t,n){return n instanceof ot&&!e.isNullish(n.key)?(t[n.key]=n,t):t}),{})}(),l((function(t){return e.nestedArray.setValueAtPath(t,r.path,[])})),n()})),E().cursor.next(),t}function N(t,n){return!(!n||t.fieldName!==n)}function m(t,n){return p().some((function(e){return y(e,t,n)}))}function y(t,n,r){return!(!t.hasFailures()||r&&!N(t,r)||e.either(n===ut.WARNINGS,t.warns()))}function R(t){return!!t&&c(t).applied}function S(t){if(R(t))return!0;var n=p();return!(e.isEmpty(n)||m(ut.ERRORS,t)||function(t){return e.isNotEmpty(d().filter((function(n){return T(n,t)})))}(t))&&function(t){return p().every((function(n){return C(n,t)}))}(t)}function T(t,n){return!(n&&!N(t,n))&&R(n)}function C(t,n){return!(!n||N(t,n))||(c(t.fieldName).type===gt.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function O(){var t=p(),n=e.assign({errorCount:0,warnCount:0,testCount:0},{groups:{},tests:{},valid:!1});return t.reduce((function(t,n){var r=t.tests;r[n.fieldName]=A(r,n),r[n.fieldName].valid=!1!==r[n.fieldName].valid&&S(n.fieldName);var i=t.groups,u=n.groupName;return u&&(i[u]=i[u]||{},i[u][n.fieldName]=A(i[u],n),r=i[u][n.fieldName],!1===i[u][n.fieldName].valid?n=!1:n=!!R(n=n.fieldName)||!function(t,n,e){return p().some((function(r){return!ht(r,n)&&y(r,t,e)}))}(ut.ERRORS,u,n)&&!function(t,n){return e.isNotEmpty(d().filter((function(e){return!ht(e,t)&&T(e,n)})))}(u,n)&&function(t,n){return p().every((function(e){return!!ht(e,t)||C(e,n)}))}(u,n),r.valid=n),t}),n),n.valid=S(),function(t){for(var n in t.tests)t.errorCount+=t.tests[n].errorCount,t.warnCount+=t.tests[n].warnCount,t.testCount+=t.tests[n].testCount;return t}(n)}function A(t,n){function r(t){s[t===ut.ERRORS?st.ERROR_COUNT:st.WARN_COUNT]++,u&&(s[t]=(s[t]||[]).concat(u))}var i=n.fieldName,u=n.message;t[i]=t[i]||e.assign({errorCount:0,warnCount:0,testCount:0},{errors:[],warnings:[]});var s=t[i];return n.isNonActionable()||(t[i].testCount++,n.isFailing()?r(ut.ERRORS):n.isWarning()&&r(ut.WARNINGS)),s}function _(t,n,r){if(r){var i;t=(null===(i=null==t?void 0:t[r])||void 0===i?void 0:i[n])||[]}else{for(var u in i={},r=n===ut.ERRORS?st.ERROR_COUNT:st.WARN_COUNT,t)e.isPositive(t[u][r])&&(i[u]=t[u][n]||[]);t=i}return t}function b(t){return{getErrors:function(n){return _(t.tests,ut.ERRORS,n)},getErrorsByGroup:function(n,e){return _(t.groups[n],ut.ERRORS,e)},getWarnings:function(n){return _(t.tests,ut.WARNINGS,n)},getWarningsByGroup:function(n,e){return _(t.groups[n],ut.WARNINGS,e)},hasErrors:function(n){return k(t,st.ERROR_COUNT,n)},hasErrorsByGroup:function(n,e){return F(t,st.ERROR_COUNT,n,e)},hasWarnings:function(n){return k(t,st.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return F(t,st.WARN_COUNT,n,e)},isValid:function(n){var e;return n?!(null===(e=t.tests[n])||void 0===e||!e.valid):t.valid},isValidByGroup:function(n,e){if(!(n=t.groups[n]))return!1;if(e)return I(n,e);for(var r in n)if(!I(n,r))return!1;return!0}}}function I(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function F(t,n,r,i){var u,s;if(!(t=t.groups[r]))return!1;if(i)return e.isPositive(null===(u=t[i])||void 0===u?void 0:u[n]);for(var o in t)if(e.isPositive(null===(s=t[o])||void 0===s?void 0:s[n]))return!0;return!1}function k(t,n,r){var i;return t=r?null===(i=t.tests[r])||void 0===i?void 0:i[n]:t[n]||0,e.isPositive(t)}function P(){var t=p(),n={stateRef:o()};return mt([t],rt.bind(n,(function(){var t=O(),n=o().suiteName()[0];return e.assign(t,b(t),{suiteName:n})})))}function U(t){var n=d();return!e.isEmpty(n)&&(!t||n.some((function(n){return N(n,t)})))}function L(){var t=p(),n={stateRef:o()};return yt([t],rt.bind(n,(function(){return e.assign({},P(),{done:rt.bind(n,Rt)})})))}function W(t,n,r){var i;return!!(!e.isFunction(t)||n&&e.numberEquals(null===(i=r.tests[n])||void 0===i?void 0:i.testCount,0))}function D(t){return!(U()&&(!t||U(t)))}function w(t,n){(0,o().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function G(){var t=e.bus.createBus();return t.on(Nt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var r=o().testCallbacks()[0].fieldCallbacks;n&&!U(n)&&e.isArray(r[n])&&e.callEach(r[n]),U()||t.emit(Nt.ALL_RUNNING_TESTS_FINISHED)}})),t.on(Nt.SUITE_CALLBACK_DONE_RUNNING,(function(){!function(){function t(t){r[t.fieldName]&&(t.omit(),a(t.fieldName,(function(){return{applied:!0}})))}var n=o().optionalFields()[0];if(!e.isEmpty(n)){var r={};p().forEach((function(n){if(e.hasOwnProperty(r,n.fieldName))t(n);else{var i=c(n.fieldName);i.type===gt.Immediate&&(r[n.fieldName]=e.optionalFunctionValue(i.rule),t(n))}})),f()}}()})),t.on(Nt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=o().testCallbacks()[0].doneCallbacks;e.callEach(t)})),t.on(Nt.REMOVE_FIELD,(function(t){p().forEach((function(n){N(n,t)&&(n.cancel(),function(t){l((function(n){return e.nestedArray.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Nt.RESET_FIELD,(function(t){p().forEach((function(n){N(n,t)&&n.reset()}))})),t}function V(){var t=rt.useX();return e.invariant(t.bus),t.bus}function x(t){return q(0,"tests",t)}function X(t){return q(1,"tests",t)}function q(t,n,r){var i=rt.useX("hook called outside of a running suite.");r&&e.asArray(r).forEach((function(r){e.isStringValue(r)&&(i.exclusion[n][r]=0===t)}))}function H(t){for(var n in t)if(!0===t[n])return!0;return!1}function K(){var t,n=rt.useX().exclusion;for(t in n.groups)if(n.groups[t])return!0;return!1}function M(t){return"Wrong arguments passed to group. Group ".concat(t,".")}function j(t,n,e){if(e||2===arguments.length)for(var r,i=0,u=n.length;i<u;i++)!r&&i in n||(r||(r=Array.prototype.slice.call(n,0,i)),r[i]=n[i]);return t.concat(r||Array.prototype.slice.call(n))}function B(t){var n=t.asyncTest,r=t.message;if(e.isPromise(n)){var i=V().emit,u=o(),s=rt.bind({stateRef:u},(function(){f(),i(Nt.TEST_COMPLETED,t)}));u=rt.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=e.isStringValue(n)?n:r,t.fail(),s())})),n.then(s,u)}}function Y(t){var n=o().testObjects()[0].prev;if(e.isEmpty(n))return J(t),t;var r=g();if(n=e.nestedArray.valueAtPath(n,r),!e.isNullish(t.key)){n=t.key,(r=E().keys.prev[n])&&(t=r),r=t;var i=E().keys.current;return e.isNullish(i[n])?i[n]=r:e.deferThrow('Encountered the same test key "'.concat(n,"\" twice. This may lead to tests overriding each other's results, or to tests being unexpectedly omitted.")),J(t),t}return r=n,!e.isNotEmpty(r)||r.fieldName===t.fieldName&&r.groupName===t.groupName||(E().type===$.EACH||e.deferThrow("Vest Critical Error: Tests called in different order than previous run.\n expected: ".concat(n.fieldName,"\n received: ").concat(t.fieldName,'\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.')),function(){var t=E().cursor.current();l((function(n){return n.splice(t),n}))}(),n=null),J(t=e.defaultTo(n,t)),t}function J(t){var n=g();l((function(r){return e.nestedArray.setValueAtPath(r,n,t)}))}function z(t){var n=E().cursor,r=nt.EAGER;if(rt.useX().mode[0]===r&&m(ut.ERRORS,t.fieldName))return t.skip(),Y(t),n.next(),t;if(r=Y(t),rt.useX().omitted||R(t.fieldName))return r.omit(),n.next(),r;if(function(t){var n=t.fieldName;if(t=t.groupName,rt.useX().skipped)return!0;var r=rt.useX(),i=r.exclusion;r=r.inclusion;var u=i.tests,s=u[n];if(!1===s)return!0;if(s=!0===s,t){var o=rt.useX().exclusion.groups;if(o=e.hasOwnProperty(o,t)?!1===o[t]:K())return!0;if(!0===i.groups[t])return!(s||!H(u)&&!1!==u[n])}return!!(t=!!K()&&!t)||!s&&!!H(u)&&!e.optionalFunctionValue(r[n])}(t))return r.skip(!!rt.useX().skipped),n.next(),r;if(t!==r&&r.fieldName===t.fieldName&&r.groupName===t.groupName&&r.isPending()&&r.cancel(),J(t),t.isUntested()){r=V();var i=function(t){return rt.run({currentTest:t},(function(){return t.run()}))}(t);try{e.isPromise(i)?(t.asyncTest=i,t.setPending(),B(t)):r.emit(Nt.TEST_COMPLETED,t)}catch(n){throw Error("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(t),".\n Error: ").concat(n,"."))}}else e.isPromise(t.asyncTest)&&(t.setPending(),B(t));return n.next(),t}function Q(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=e.isFunction(n[1])?n:j([void 0],n,!0);n=i[0],r=i[1],i=i[2],e.invariant(e.isStringValue(t),Z("fieldName","string")),e.invariant(e.isFunction(r),Z("Test callback","function"));var u=rt.useX();return z(n=new ot(t,r,{message:n,groupName:u.groupName,key:i}))}function Z(t,n){return"Incompatible params passed to test function. ".concat(t," must be a ").concat(n)}var $,tt,nt;(tt=$||($={}))[tt.DEFAULT=0]="DEFAULT",tt[tt.SUITE=1]="SUITE",tt[tt.EACH=2]="EACH",tt[tt.SKIP_WHEN=3]="SKIP_WHEN",tt[tt.OMIT_WHEN=4]="OMIT_WHEN",tt[tt.GROUP=5]="GROUP",function(t){t[t.ALL=0]="ALL",t[t.EAGER=1]="EAGER"}(nt||(nt={}));var et,rt=r.createCascade((function(t,n){return n?null:e.assign({exclusion:{tests:{},groups:{}},inclusion:{},isolate:s($.DEFAULT),mode:[nt.ALL]},t)})),it=e.cache();!function(t){t.Error="error",t.Warning="warning"}(et||(et={}));var ut,st,ot=function(){function t(t,n,r){var i=void 0===r?{}:r;r=i.message;var u=i.groupName;i=i.key,this.key=null,this.id=e.seq(),this.severity=et.Error,this.status=at,this.fieldName=t,this.testFn=n,u&&(this.groupName=u),r&&(this.message=r),i&&(this.key=i)}return t.prototype.run=function(){try{var t=this.testFn()}catch(n){t=n,e.isUndefined(this.message)&&e.isStringValue(t)&&(this.message=n),t=!1}return!1===t&&this.fail(),t},t.prototype.setStatus=function(t){this.isFinalStatus()&&t!==Et||(this.status=t)},t.prototype.warns=function(){return this.severity===et.Warning},t.prototype.setPending=function(){this.setStatus(pt)},t.prototype.fail=function(){this.setStatus(this.warns()?lt:ft)},t.prototype.done=function(){this.isFinalStatus()||this.setStatus(dt)},t.prototype.warn=function(){this.severity=et.Warning},t.prototype.isFinalStatus=function(){return this.hasFailures()||this.isCanceled()||this.isPassing()},t.prototype.skip=function(t){this.isPending()&&!t||this.setStatus(ct)},t.prototype.cancel=function(){this.setStatus(vt),f()},t.prototype.reset=function(){this.status=at,f()},t.prototype.omit=function(){this.setStatus(Et)},t.prototype.valueOf=function(){return!this.isFailing()},t.prototype.isPending=function(){return this.statusEquals(pt)},t.prototype.isOmitted=function(){return this.statusEquals(Et)},t.prototype.isUntested=function(){return this.statusEquals(at)},t.prototype.isFailing=function(){return this.statusEquals(ft)},t.prototype.isCanceled=function(){return this.statusEquals(vt)},t.prototype.isSkipped=function(){return this.statusEquals(ct)},t.prototype.isPassing=function(){return this.statusEquals(dt)},t.prototype.isWarning=function(){return this.statusEquals(lt)},t.prototype.hasFailures=function(){return this.isFailing()||this.isWarning()},t.prototype.isNonActionable=function(){return this.isSkipped()||this.isOmitted()||this.isCanceled()},t.prototype.isTested=function(){return this.hasFailures()||this.isPassing()},t.prototype.awaitsResolution=function(){return this.isSkipped()||this.isUntested()||this.isPending()},t.prototype.statusEquals=function(t){return this.status===t},t}(),at="UNTESTED",ct="SKIPPED",ft="FAILED",lt="WARNING",dt="PASSING",pt="PENDING",vt="CANCELED",Et="OMITTED";!function(t){t.WARNINGS="warnings",t.ERRORS="errors"}(ut||(ut={})),function(t){t.ERROR_COUNT="errorCount",t.WARN_COUNT="warnCount"}(st||(st={}));var gt,ht=e.bindNot((function(t,n){return t.groupName===n}));!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(gt||(gt={}));var Nt,mt=e.cache(1),yt=e.cache(20),Rt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=(t=t.reverse())[0];if(t=t[1],n=L(),W(e,t,n))return n;var r=function(){return e(P())};return D(t)?(r(),n):(w(r,t),n)};!function(t){t.TEST_COMPLETED="test_completed",t.ALL_RUNNING_TESTS_FINISHED="all_running_tests_finished",t.REMOVE_FIELD="remove_field",t.RESET_FIELD="reset_field",t.SUITE_CALLBACK_DONE_RUNNING="suite_callback_done_running"}(Nt||(Nt={})),x.group=function(t){return q(0,"groups",t)},X.group=function(t){return q(1,"groups",t)},r=e.assign(Q,{memo:function(t){var n=e.cache(10);return function(r){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];u=E().cursor.current();var s=(i=i.reverse())[0],a=i[1],c=i[2];return u=[o().suiteId()[0],r,u].concat(s),i=n.get(u),e.isNull(i)?n(u,(function(){return t(r,c,a)})):i[1].isCanceled()?(n.invalidate(u),n(u,(function(){return t(r,c,a)}))):z(i[1])}}(Q)}),Object.defineProperty(t,"enforce",{enumerable:!0,get:function(){return n.enforce}}),t.VERSION="4.6.2-dev-b07a89",t.context=rt,t.create=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=(t=t.reverse())[0];t=t[1],e.invariant(e.isFunction(r),"vest.create: Expected callback to be a function.");var u=G(),s=i.createState();return t={stateRef:v(s,{suiteId:e.seq(),suiteName:t}),bus:u},e.assign(rt.bind(t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return s.reset(),h({type:$.SUITE},(function(){r.apply(void 0,t)})),u.emit(Nt.SUITE_CALLBACK_DONE_RUNNING),L()})),{get:rt.bind(t,P),remove:rt.bind(t,(function(t){u.emit(Nt.REMOVE_FIELD,t)})),reset:s.reset,resetField:rt.bind(t,(function(t){u.emit(Nt.RESET_FIELD,t)}))})},t.each=function(t,n){e.invariant(e.isFunction(n),"each callback must be a function"),h({type:$.EACH},(function(){t.forEach((function(t,e){n(t,e)}))}))},t.eager=function(){var t=nt.EAGER;rt.useX().mode[0]=t},t.group=function(t,n){e.invariant(e.isStringValue(t),M("name must be a string")),e.invariant(e.isFunction(n),M("callback must be a function")),h({type:$.GROUP},(function(){rt.run({groupName:t},n)}))},t.include=function(t){var n=rt.useX(),r=n.inclusion;return n=n.exclusion,e.invariant(e.isStringValue(t)),r[t]=e.defaultTo(n.tests[t],!0),{when:function(n){var r=rt.useX(),i=r.exclusion;r.inclusion[t]=function(){return e.hasOwnProperty(i.tests,t)?e.defaultTo(i.tests[t],!0):e.isStringValue(n)?!!i.tests[n]:e.optionalFunctionValue(n,e.optionalFunctionValue(P))}}}},t.omitWhen=function(t,n){h({type:$.OMIT_WHEN},(function(){rt.run({omitted:!!rt.useX().omitted||e.optionalFunctionValue(t,e.optionalFunctionValue(P))},(function(){return n()}))}))},t.only=x,t.optional=function(t){if(e.isArray(t)||e.isStringValue(t))e.asArray(t).forEach((function(t){a(t,(function(){return{type:gt.Delayed,applied:!1,rule:null}}))}));else{var n,r=function(n){var r=t[n];a(n,(function(){return{type:gt.Immediate,rule:r,applied:e.optionalFunctionValue(r)}}))};for(n in t)r(n)}},t.skip=X,t.skipWhen=function(t,n){h({type:$.SKIP_WHEN},(function(){rt.run({skipped:!!rt.useX().skipped||e.optionalFunctionValue(t,e.optionalFunctionValue(P))},(function(){return n()}))}))},t.suiteSelectors=b,t.test=r,t.warn=function(){var t=rt.useX("warn hook called outside of a running suite.");e.invariant(t.currentTest,"warn called outside of a test."),t.currentTest.warn()},Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -0,0 +1,9 @@
1
+ {
2
+ "main": "../../dist/cjs/enforce/compose.js",
3
+ "module": "../../dist/es/enforce/compose.production.js",
4
+ "unpkg": "../../dist/umd/enforce/compose.production.js",
5
+ "jsdelivr": "../../dist/umd/enforce/compose.production.js",
6
+ "name": "compose",
7
+ "types": "../../types/enforce/compose.d.ts",
8
+ "private": true
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "main": "../../dist/cjs/enforce/compounds.js",
3
+ "module": "../../dist/es/enforce/compounds.production.js",
4
+ "unpkg": "../../dist/umd/enforce/compounds.production.js",
5
+ "jsdelivr": "../../dist/umd/enforce/compounds.production.js",
6
+ "name": "compounds",
7
+ "types": "../../types/enforce/compounds.d.ts",
8
+ "private": true
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "main": "../../dist/cjs/enforce/schema.js",
3
+ "module": "../../dist/es/enforce/schema.production.js",
4
+ "unpkg": "../../dist/umd/enforce/schema.production.js",
5
+ "jsdelivr": "../../dist/umd/enforce/schema.production.js",
6
+ "name": "schema",
7
+ "types": "../../types/enforce/schema.d.ts",
8
+ "private": true
9
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.6.2-dev-fcaa09",
2
+ "version": "4.6.2-dev-b07a89",
3
3
  "license": "MIT",
4
4
  "name": "vest",
5
5
  "author": "ealush",
@@ -20,10 +20,10 @@
20
20
  "url": "https://github.com/ealush/vest.git/issues"
21
21
  },
22
22
  "dependencies": {
23
- "context": "^3.0.2-dev-fcaa09",
24
- "n4s": "^4.2.2-dev-fcaa09",
25
- "vast": "^1.0.13-dev-fcaa09",
26
- "vest-utils": "^0.0.3-dev-fcaa09"
23
+ "context": "^3.0.1",
24
+ "n4s": "^4.2.2-dev-b07a89",
25
+ "vast": "^1.0.12",
26
+ "vest-utils": "^0.0.2"
27
27
  },
28
28
  "homepage": "https://vestjs.dev/",
29
29
  "exports": {
@@ -57,95 +57,95 @@
57
57
  "module": "./dist/es/classnames.production.js",
58
58
  "default": "./dist/cjs/classnames.production.js"
59
59
  },
60
- "./enforce_compose": {
60
+ "./enforce/compose": {
61
61
  "production": {
62
- "types": "./types/enforce_compose.d.ts",
63
- "browser": "./dist/es/enforce_compose.production.js",
64
- "umd": "./dist/umd/enforce_compose.production.js",
65
- "import": "./dist/es/enforce_compose.production.js",
66
- "require": "./dist/cjs/enforce_compose.production.js",
67
- "node": "./dist/cjs/enforce_compose.production.js",
68
- "module": "./dist/es/enforce_compose.production.js",
69
- "default": "./dist/cjs/enforce_compose.production.js"
62
+ "types": "./types/enforce/compose.d.ts",
63
+ "browser": "./dist/es/enforce/compose.production.js",
64
+ "umd": "./dist/umd/enforce/compose.production.js",
65
+ "import": "./dist/es/enforce/compose.production.js",
66
+ "require": "./dist/cjs/enforce/compose.production.js",
67
+ "node": "./dist/cjs/enforce/compose.production.js",
68
+ "module": "./dist/es/enforce/compose.production.js",
69
+ "default": "./dist/cjs/enforce/compose.production.js"
70
70
  },
71
71
  "development": {
72
- "types": "./types/enforce_compose.d.ts",
73
- "browser": "./dist/es/enforce_compose.development.js",
74
- "umd": "./dist/umd/enforce_compose.development.js",
75
- "import": "./dist/es/enforce_compose.development.js",
76
- "require": "./dist/cjs/enforce_compose.development.js",
77
- "node": "./dist/cjs/enforce_compose.development.js",
78
- "module": "./dist/es/enforce_compose.development.js",
79
- "default": "./dist/cjs/enforce_compose.development.js"
72
+ "types": "./types/enforce/compose.d.ts",
73
+ "browser": "./dist/es/enforce/compose.development.js",
74
+ "umd": "./dist/umd/enforce/compose.development.js",
75
+ "import": "./dist/es/enforce/compose.development.js",
76
+ "require": "./dist/cjs/enforce/compose.development.js",
77
+ "node": "./dist/cjs/enforce/compose.development.js",
78
+ "module": "./dist/es/enforce/compose.development.js",
79
+ "default": "./dist/cjs/enforce/compose.development.js"
80
80
  },
81
- "types": "./types/enforce_compose.d.ts",
82
- "browser": "./dist/es/enforce_compose.production.js",
83
- "umd": "./dist/umd/enforce_compose.production.js",
84
- "import": "./dist/es/enforce_compose.production.js",
85
- "require": "./dist/cjs/enforce_compose.production.js",
86
- "node": "./dist/cjs/enforce_compose.production.js",
87
- "module": "./dist/es/enforce_compose.production.js",
88
- "default": "./dist/cjs/enforce_compose.production.js"
81
+ "types": "./types/enforce/compose.d.ts",
82
+ "browser": "./dist/es/enforce/compose.production.js",
83
+ "umd": "./dist/umd/enforce/compose.production.js",
84
+ "import": "./dist/es/enforce/compose.production.js",
85
+ "require": "./dist/cjs/enforce/compose.production.js",
86
+ "node": "./dist/cjs/enforce/compose.production.js",
87
+ "module": "./dist/es/enforce/compose.production.js",
88
+ "default": "./dist/cjs/enforce/compose.production.js"
89
89
  },
90
- "./enforce_compounds": {
90
+ "./enforce/compounds": {
91
91
  "production": {
92
- "types": "./types/enforce_compounds.d.ts",
93
- "browser": "./dist/es/enforce_compounds.production.js",
94
- "umd": "./dist/umd/enforce_compounds.production.js",
95
- "import": "./dist/es/enforce_compounds.production.js",
96
- "require": "./dist/cjs/enforce_compounds.production.js",
97
- "node": "./dist/cjs/enforce_compounds.production.js",
98
- "module": "./dist/es/enforce_compounds.production.js",
99
- "default": "./dist/cjs/enforce_compounds.production.js"
92
+ "types": "./types/enforce/compounds.d.ts",
93
+ "browser": "./dist/es/enforce/compounds.production.js",
94
+ "umd": "./dist/umd/enforce/compounds.production.js",
95
+ "import": "./dist/es/enforce/compounds.production.js",
96
+ "require": "./dist/cjs/enforce/compounds.production.js",
97
+ "node": "./dist/cjs/enforce/compounds.production.js",
98
+ "module": "./dist/es/enforce/compounds.production.js",
99
+ "default": "./dist/cjs/enforce/compounds.production.js"
100
100
  },
101
101
  "development": {
102
- "types": "./types/enforce_compounds.d.ts",
103
- "browser": "./dist/es/enforce_compounds.development.js",
104
- "umd": "./dist/umd/enforce_compounds.development.js",
105
- "import": "./dist/es/enforce_compounds.development.js",
106
- "require": "./dist/cjs/enforce_compounds.development.js",
107
- "node": "./dist/cjs/enforce_compounds.development.js",
108
- "module": "./dist/es/enforce_compounds.development.js",
109
- "default": "./dist/cjs/enforce_compounds.development.js"
102
+ "types": "./types/enforce/compounds.d.ts",
103
+ "browser": "./dist/es/enforce/compounds.development.js",
104
+ "umd": "./dist/umd/enforce/compounds.development.js",
105
+ "import": "./dist/es/enforce/compounds.development.js",
106
+ "require": "./dist/cjs/enforce/compounds.development.js",
107
+ "node": "./dist/cjs/enforce/compounds.development.js",
108
+ "module": "./dist/es/enforce/compounds.development.js",
109
+ "default": "./dist/cjs/enforce/compounds.development.js"
110
110
  },
111
- "types": "./types/enforce_compounds.d.ts",
112
- "browser": "./dist/es/enforce_compounds.production.js",
113
- "umd": "./dist/umd/enforce_compounds.production.js",
114
- "import": "./dist/es/enforce_compounds.production.js",
115
- "require": "./dist/cjs/enforce_compounds.production.js",
116
- "node": "./dist/cjs/enforce_compounds.production.js",
117
- "module": "./dist/es/enforce_compounds.production.js",
118
- "default": "./dist/cjs/enforce_compounds.production.js"
111
+ "types": "./types/enforce/compounds.d.ts",
112
+ "browser": "./dist/es/enforce/compounds.production.js",
113
+ "umd": "./dist/umd/enforce/compounds.production.js",
114
+ "import": "./dist/es/enforce/compounds.production.js",
115
+ "require": "./dist/cjs/enforce/compounds.production.js",
116
+ "node": "./dist/cjs/enforce/compounds.production.js",
117
+ "module": "./dist/es/enforce/compounds.production.js",
118
+ "default": "./dist/cjs/enforce/compounds.production.js"
119
119
  },
120
- "./enforce_schema": {
120
+ "./enforce/schema": {
121
121
  "production": {
122
- "types": "./types/enforce_schema.d.ts",
123
- "browser": "./dist/es/enforce_schema.production.js",
124
- "umd": "./dist/umd/enforce_schema.production.js",
125
- "import": "./dist/es/enforce_schema.production.js",
126
- "require": "./dist/cjs/enforce_schema.production.js",
127
- "node": "./dist/cjs/enforce_schema.production.js",
128
- "module": "./dist/es/enforce_schema.production.js",
129
- "default": "./dist/cjs/enforce_schema.production.js"
122
+ "types": "./types/enforce/schema.d.ts",
123
+ "browser": "./dist/es/enforce/schema.production.js",
124
+ "umd": "./dist/umd/enforce/schema.production.js",
125
+ "import": "./dist/es/enforce/schema.production.js",
126
+ "require": "./dist/cjs/enforce/schema.production.js",
127
+ "node": "./dist/cjs/enforce/schema.production.js",
128
+ "module": "./dist/es/enforce/schema.production.js",
129
+ "default": "./dist/cjs/enforce/schema.production.js"
130
130
  },
131
131
  "development": {
132
- "types": "./types/enforce_schema.d.ts",
133
- "browser": "./dist/es/enforce_schema.development.js",
134
- "umd": "./dist/umd/enforce_schema.development.js",
135
- "import": "./dist/es/enforce_schema.development.js",
136
- "require": "./dist/cjs/enforce_schema.development.js",
137
- "node": "./dist/cjs/enforce_schema.development.js",
138
- "module": "./dist/es/enforce_schema.development.js",
139
- "default": "./dist/cjs/enforce_schema.development.js"
132
+ "types": "./types/enforce/schema.d.ts",
133
+ "browser": "./dist/es/enforce/schema.development.js",
134
+ "umd": "./dist/umd/enforce/schema.development.js",
135
+ "import": "./dist/es/enforce/schema.development.js",
136
+ "require": "./dist/cjs/enforce/schema.development.js",
137
+ "node": "./dist/cjs/enforce/schema.development.js",
138
+ "module": "./dist/es/enforce/schema.development.js",
139
+ "default": "./dist/cjs/enforce/schema.development.js"
140
140
  },
141
- "types": "./types/enforce_schema.d.ts",
142
- "browser": "./dist/es/enforce_schema.production.js",
143
- "umd": "./dist/umd/enforce_schema.production.js",
144
- "import": "./dist/es/enforce_schema.production.js",
145
- "require": "./dist/cjs/enforce_schema.production.js",
146
- "node": "./dist/cjs/enforce_schema.production.js",
147
- "module": "./dist/es/enforce_schema.production.js",
148
- "default": "./dist/cjs/enforce_schema.production.js"
141
+ "types": "./types/enforce/schema.d.ts",
142
+ "browser": "./dist/es/enforce/schema.production.js",
143
+ "umd": "./dist/umd/enforce/schema.production.js",
144
+ "import": "./dist/es/enforce/schema.production.js",
145
+ "require": "./dist/cjs/enforce/schema.production.js",
146
+ "node": "./dist/cjs/enforce/schema.production.js",
147
+ "module": "./dist/es/enforce/schema.production.js",
148
+ "default": "./dist/cjs/enforce/schema.production.js"
149
149
  },
150
150
  "./parser": {
151
151
  "production": {
package/tsconfig.json CHANGED
@@ -74,9 +74,9 @@
74
74
  "VestTest": ["src/core/test/VestTest.ts"],
75
75
  "vestBus": ["src/core/vestBus.ts"],
76
76
  "classnames": ["src/exports/classnames.ts"],
77
- "enforce_compose": ["src/exports/enforce_compose.ts"],
78
- "enforce_compounds": ["src/exports/enforce_compounds.ts"],
79
- "enforce_schema": ["src/exports/enforce_schema.ts"],
77
+ "enforce@compose": ["src/exports/enforce@compose.ts"],
78
+ "enforce@compounds": ["src/exports/enforce@compounds.ts"],
79
+ "enforce@schema": ["src/exports/enforce@schema.ts"],
80
80
  "parser": ["src/exports/parser.ts"],
81
81
  "promisify": ["src/exports/promisify.ts"],
82
82
  "exclusive": ["src/hooks/exclusive.ts"],
@@ -0,0 +1,3 @@
1
+ declare const compose: Promise<typeof import("n4s/compose")>;
2
+ export { compose as default };
3
+ //# sourceMappingURL=compose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/exports/enforce@compose.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,OAAO,uCAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=compounds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compounds.d.ts","sourceRoot":"","sources":["../../src/exports/enforce@compounds.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/exports/enforce@schema.ts"],"names":[],"mappings":""}
package/types/vest.d.ts CHANGED
@@ -336,7 +336,7 @@ declare const test: typeof testBase & {
336
336
  * Sets a running test to warn only mode.
337
337
  */
338
338
  declare function warn(): void;
339
- declare const VERSION = "4.6.2-dev-fcaa09";
339
+ declare const VERSION = "4.6.2-dev-b07a89";
340
340
  export { suiteSelectors, test, create, each, only, skip, warn, group, optional, skipWhen, omitWhen, enforce, VERSION, context, include, eager };
341
341
  export type { SuiteResult, SuiteRunResult, SuiteSummary, VestTest, Suite };
342
342
  //# sourceMappingURL=vest.d.ts.map
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,7 +0,0 @@
1
- 'use strict'
2
-
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./enforce_compose.production.js');
5
- } else {
6
- module.exports = require('./enforce_compose.development.js');
7
- }
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,7 +0,0 @@
1
- 'use strict'
2
-
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./enforce_compounds.production.js');
5
- } else {
6
- module.exports = require('./enforce_compounds.development.js');
7
- }
@@ -1,7 +0,0 @@
1
- 'use strict'
2
-
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./enforce_schema.production.js');
5
- } else {
6
- module.exports = require('./enforce_schema.development.js');
7
- }
@@ -1 +0,0 @@
1
-
@@ -1,8 +0,0 @@
1
- (function (factory) {
2
- typeof define === 'function' && define.amd ? define(factory) :
3
- factory();
4
- }((function () { 'use strict';
5
-
6
-
7
-
8
- })));
@@ -1 +0,0 @@
1
- "use strict";!function(n){"function"==typeof define&&define.amd&&define(n)}((function(){}));
@@ -1,9 +0,0 @@
1
- {
2
- "main": "../dist/cjs/enforce_compose.js",
3
- "module": "../dist/es/enforce_compose.production.js",
4
- "unpkg": "../dist/umd/enforce_compose.production.js",
5
- "jsdelivr": "../dist/umd/enforce_compose.production.js",
6
- "name": "enforce_compose",
7
- "types": "../types/enforce_compose.d.ts",
8
- "private": true
9
- }
@@ -1,9 +0,0 @@
1
- {
2
- "main": "../dist/cjs/enforce_compounds.js",
3
- "module": "../dist/es/enforce_compounds.production.js",
4
- "unpkg": "../dist/umd/enforce_compounds.production.js",
5
- "jsdelivr": "../dist/umd/enforce_compounds.production.js",
6
- "name": "enforce_compounds",
7
- "types": "../types/enforce_compounds.d.ts",
8
- "private": true
9
- }
@@ -1,9 +0,0 @@
1
- {
2
- "main": "../dist/cjs/enforce_schema.js",
3
- "module": "../dist/es/enforce_schema.production.js",
4
- "unpkg": "../dist/umd/enforce_schema.production.js",
5
- "jsdelivr": "../dist/umd/enforce_schema.production.js",
6
- "name": "enforce_schema",
7
- "types": "../types/enforce_schema.d.ts",
8
- "private": true
9
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=enforce_compose.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enforce_compose.d.ts","sourceRoot":"","sources":["../src/exports/enforce_compose.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=enforce_compounds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enforce_compounds.d.ts","sourceRoot":"","sources":["../src/exports/enforce_compounds.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=enforce_schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enforce_schema.d.ts","sourceRoot":"","sources":["../src/exports/enforce_schema.ts"],"names":[],"mappings":""}