vest 4.6.1 → 4.6.2-dev-fcaa09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/enforce_compose.development.js +2 -0
- package/dist/cjs/enforce_compose.js +7 -0
- package/dist/cjs/enforce_compose.production.js +1 -0
- package/dist/cjs/enforce_compounds.development.js +4 -0
- package/dist/cjs/enforce_compounds.js +7 -0
- package/dist/cjs/enforce_compounds.production.js +1 -0
- package/dist/cjs/enforce_schema.development.js +4 -0
- package/dist/cjs/enforce_schema.js +7 -0
- package/dist/cjs/enforce_schema.production.js +1 -0
- package/dist/cjs/vest.development.js +4 -74
- package/dist/cjs/vest.production.js +1 -1
- package/dist/es/enforce_compose.development.js +1 -0
- package/dist/es/enforce_compose.production.js +1 -0
- package/dist/es/enforce_compounds.development.js +1 -0
- package/dist/es/enforce_compounds.production.js +1 -0
- package/dist/es/enforce_schema.development.js +1 -0
- package/dist/es/enforce_schema.production.js +1 -0
- package/dist/es/vest.development.js +4 -74
- package/dist/es/vest.production.js +1 -1
- package/dist/umd/enforce_compose.development.js +8 -0
- package/dist/umd/enforce_compose.production.js +1 -0
- package/dist/umd/enforce_compounds.development.js +8 -0
- package/dist/umd/enforce_compounds.production.js +1 -0
- package/dist/umd/enforce_schema.development.js +8 -0
- package/dist/umd/enforce_schema.production.js +1 -0
- package/dist/umd/vest.development.js +7 -78
- package/dist/umd/vest.production.js +1 -1
- package/enforce_compose/package.json +9 -0
- package/enforce_compounds/package.json +9 -0
- package/enforce_schema/package.json +9 -0
- package/package.json +80 -79
- package/tsconfig.json +85 -1
- package/types/classnames.d.ts +1 -0
- package/types/classnames.d.ts.map +1 -0
- package/types/enforce_compose.d.ts +2 -0
- package/types/enforce_compose.d.ts.map +1 -0
- package/types/enforce_compounds.d.ts +2 -0
- package/types/enforce_compounds.d.ts.map +1 -0
- package/types/enforce_schema.d.ts +2 -0
- package/types/enforce_schema.d.ts.map +1 -0
- package/types/parser.d.ts +1 -0
- package/types/parser.d.ts.map +1 -0
- package/types/promisify.d.ts +1 -0
- package/types/promisify.d.ts.map +1 -0
- package/types/vest.d.ts +5 -10
- package/types/vest.d.ts.map +1 -0
- package/dist/cjs/compose.js +0 -7
- package/dist/cjs/compounds.js +0 -7
- package/dist/cjs/enforce/compose.development.js +0 -60
- package/dist/cjs/enforce/compose.production.js +0 -1
- package/dist/cjs/enforce/compounds.development.js +0 -92
- package/dist/cjs/enforce/compounds.production.js +0 -1
- package/dist/cjs/enforce/package.json +0 -1
- package/dist/cjs/enforce/schema.development.js +0 -92
- package/dist/cjs/enforce/schema.production.js +0 -1
- package/dist/cjs/schema.js +0 -7
- package/dist/es/enforce/compose.development.js +0 -58
- package/dist/es/enforce/compose.production.js +0 -1
- package/dist/es/enforce/compounds.development.js +0 -90
- package/dist/es/enforce/compounds.production.js +0 -1
- package/dist/es/enforce/package.json +0 -1
- package/dist/es/enforce/schema.development.js +0 -88
- package/dist/es/enforce/schema.production.js +0 -1
- package/dist/umd/enforce/compose.development.js +0 -63
- package/dist/umd/enforce/compose.production.js +0 -1
- package/dist/umd/enforce/compounds.development.js +0 -95
- package/dist/umd/enforce/compounds.production.js +0 -1
- package/dist/umd/enforce/schema.development.js +0 -95
- package/dist/umd/enforce/schema.production.js +0 -1
- package/enforce/compose/package.json +0 -9
- package/enforce/compounds/package.json +0 -9
- package/enforce/schema/package.json +0 -9
- package/types/enforce/compose.d.ts +0 -126
- package/types/enforce/compounds.d.ts +0 -136
- package/types/enforce/schema.d.ts +0 -144
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("n4s"),require("vest-utils"),require("context")):"function"==typeof define&&define.amd?define(["exports","n4s","vest-utils","context"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).vest={},t.n4s,t["vest-utils"],t.context)}(this,(function(t,n,e,r){function i(){var t=0;return{current:function(){return t},next:function(){t++}}}function u(t,n){return void 0===n&&(n=[]),{cursor:i(),keys:{current:{},prev:{}},path:n,type:t}}function s(){return rt.useX().stateRef}function o(t,n){(0,s().optionalFields()[1])((function(r){var i;return e.assign(r,((i={})[t]=e.assign({},r[t],n(r[t])),i))}))}function a(t){var n;return null!==(n=s().optionalFields()[0][t])&&void 0!==n?n:{}}function c(){f((function(t){return t}))}function f(t){(0,s().testObjects()[1])((function(n){return{prev:n.prev,current:e.asArray(t(n.current))}}))}function l(){return d().filter((function(t){return t.isPending()}))}function d(){var t=s().testObjects()[0].current;return it([t],(function(){return e.nestedArray.flatten(t)}))}function p(t){function n(t,n,u){return i.references.push(),r(t,e.optionalFunctionValue(n,u)),function(){return[i.references[t],function(n){return r(t,e.optionalFunctionValue(n,i.references[t]))}]}}function r(n,r){var s=i.references[n];i.references[n]=r,n=u[n][1],e.isFunction(n)&&n(r,s),e.isFunction(t)&&t()}var i={references:[]},u=[];return{registerStateKey:function(t,e){var r=u.length;return u.push([t,e]),n(r,t)},reset:function(){var t=i.references;i.references=[],u.forEach((function(e,r){return n(r,e[0],t[r])}))}}}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 h(){var t=E();return t.path.concat(t.cursor.current())}function g(t,n){t=void 0===(t=t.type)?$.DEFAULT:t,e.invariant(e.isFunction(n));var r=u(t,h());return t=rt.run({isolate:r},(function(){return r.keys.prev=function(){var t=s().testObjects()[0].prev;return e.asArray(e.nestedArray.getCurrent(t,h())).reduce((function(t,n){return n instanceof ot&&!e.isNullish(n.key)?(t[n.key]=n,t):t}),{})}(),f((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 d().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&&a(t).applied}function S(t){if(R(t))return!0;var n=d();return!(e.isEmpty(n)||m(ut.ERRORS,t)||function(t){return e.isNotEmpty(l().filter((function(n){return T(n,t)})))}(t))&&function(t){return d().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))||(a(t.fieldName).type===ht.Delayed&&t.awaitsResolution()||t.isTested()||t.isOmitted())}function O(){var t=d(),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 d().some((function(r){return!gt(r,n)&&y(r,t,e)}))}(ut.ERRORS,u,n)&&!function(t,n){return e.isNotEmpty(l().filter((function(e){return!gt(e,t)&&T(e,n)})))}(u,n)&&function(t,n){return d().every((function(e){return!!gt(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 I(t,st.ERROR_COUNT,n,e)},hasWarnings:function(n){return k(t,st.WARN_COUNT,n)},hasWarningsByGroup:function(n,e){return I(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 F(n,e);for(var r in n)if(!F(n,r))return!1;return!0}}}function F(t,n){var e;return!(null===(e=t[n])||void 0===e||!e.valid)}function I(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=d(),n={stateRef:s()};return mt([t],rt.bind(n,(function(){var t=O(),n=s().suiteName()[0];return e.assign(t,b(t),{suiteName:n})})))}function U(t){var n=l();return!e.isEmpty(n)&&(!t||n.some((function(n){return N(n,t)})))}function L(){var t=d(),n={stateRef:s()};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 V(t,n){(0,s().testCallbacks()[1])((function(e){return n?e.fieldCallbacks[n]=(e.fieldCallbacks[n]||[]).concat(t):e.doneCallbacks.push(t),e}))}function w(){var t=e.bus.createBus();return t.on(Nt.TEST_COMPLETED,(function(n){if(!n.isCanceled()){n.done(),n=n.fieldName;var r=s().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(),o(t.fieldName,(function(){return{applied:!0}})))}var n=s().optionalFields()[0];if(!e.isEmpty(n)){var r={};d().forEach((function(n){if(e.hasOwnProperty(r,n.fieldName))t(n);else{var i=a(n.fieldName);i.type===ht.Immediate&&(r[n.fieldName]=e.optionalFunctionValue(i.rule),t(n))}})),c()}}()})),t.on(Nt.ALL_RUNNING_TESTS_FINISHED,(function(){var t=s().testCallbacks()[0].doneCallbacks;e.callEach(t)})),t.on(Nt.REMOVE_FIELD,(function(t){d().forEach((function(n){N(n,t)&&(n.cancel(),function(t){f((function(n){return e.nestedArray.transform(n,(function(n){return t!==n?n:null}))}))}(n))}))})),t.on(Nt.RESET_FIELD,(function(t){d().forEach((function(n){N(n,t)&&n.reset()}))})),t}function G(){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=G().emit,u=s(),o=rt.bind({stateRef:u},(function(){c(),i(Nt.TEST_COMPLETED,t)}));u=rt.bind({stateRef:u},(function(n){t.isCanceled()||(t.message=e.isStringValue(n)?n:r,t.fail(),o())}));try{n.then(o,u)}catch(t){u()}}}function Y(t){var n=s().testObjects()[0].prev;if(e.isEmpty(n))return J(t),t;var r=h();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();f((function(n){return n.splice(t),n}))}(),n=null),J(t=e.defaultTo(n,t)),t}function J(t){var n=h();f((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=G();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:u($.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),c()},t.prototype.reset=function(){this.status=at,c()},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 ht,gt=e.bindNot((function(t,n){return t.groupName===n}));!function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=1]="Delayed"}(ht||(ht={}));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):(V(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 o=(i=i.reverse())[0],a=i[1],c=i[2];return u=[s().suiteId()[0],r,u].concat(o),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.1",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 i=w(),u=p();return t={stateRef:v(u,{suiteId:e.seq(),suiteName:t}),bus:i},e.assign(rt.bind(t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u.reset(),g({type:$.SUITE},(function(){r.apply(void 0,t)})),i.emit(Nt.SUITE_CALLBACK_DONE_RUNNING),L()})),{get:rt.bind(t,P),remove:rt.bind(t,(function(t){i.emit(Nt.REMOVE_FIELD,t)})),reset:u.reset,resetField:rt.bind(t,(function(t){i.emit(Nt.RESET_FIELD,t)}))})},t.each=function(t,n){e.invariant(e.isFunction(n),"each callback must be a function"),g({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")),g({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){g({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){o(t,(function(){return{type:ht.Delayed,applied:!1,rule:null}}))}));else{var n,r=function(n){var r=t[n];o(n,(function(){return{type:ht.Immediate,rule:r,applied:e.optionalFunctionValue(r)}}))};for(n in t)r(n)}},t.skip=X,t.skipWhen=function(t,n){g({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-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})}));
|
|
@@ -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": "enforce_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": "enforce_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": "enforce_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
|
+
"version": "4.6.2-dev-fcaa09",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "vest",
|
|
5
5
|
"author": "ealush",
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
"url": "https://github.com/ealush/vest.git/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"context": "^3.0.
|
|
24
|
-
"n4s": "^4.2.
|
|
25
|
-
"
|
|
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"
|
|
26
27
|
},
|
|
27
28
|
"homepage": "https://vestjs.dev/",
|
|
28
29
|
"exports": {
|
|
@@ -56,95 +57,95 @@
|
|
|
56
57
|
"module": "./dist/es/classnames.production.js",
|
|
57
58
|
"default": "./dist/cjs/classnames.production.js"
|
|
58
59
|
},
|
|
59
|
-
"./
|
|
60
|
+
"./enforce_compose": {
|
|
60
61
|
"production": {
|
|
61
|
-
"types": "./types/
|
|
62
|
-
"browser": "./dist/es/
|
|
63
|
-
"umd": "./dist/umd/
|
|
64
|
-
"import": "./dist/es/
|
|
65
|
-
"require": "./dist/cjs/
|
|
66
|
-
"node": "./dist/cjs/
|
|
67
|
-
"module": "./dist/es/
|
|
68
|
-
"default": "./dist/cjs/
|
|
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"
|
|
69
70
|
},
|
|
70
71
|
"development": {
|
|
71
|
-
"types": "./types/
|
|
72
|
-
"browser": "./dist/es/
|
|
73
|
-
"umd": "./dist/umd/
|
|
74
|
-
"import": "./dist/es/
|
|
75
|
-
"require": "./dist/cjs/
|
|
76
|
-
"node": "./dist/cjs/
|
|
77
|
-
"module": "./dist/es/
|
|
78
|
-
"default": "./dist/cjs/
|
|
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"
|
|
79
80
|
},
|
|
80
|
-
"types": "./types/
|
|
81
|
-
"browser": "./dist/es/
|
|
82
|
-
"umd": "./dist/umd/
|
|
83
|
-
"import": "./dist/es/
|
|
84
|
-
"require": "./dist/cjs/
|
|
85
|
-
"node": "./dist/cjs/
|
|
86
|
-
"module": "./dist/es/
|
|
87
|
-
"default": "./dist/cjs/
|
|
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"
|
|
88
89
|
},
|
|
89
|
-
"./
|
|
90
|
+
"./enforce_compounds": {
|
|
90
91
|
"production": {
|
|
91
|
-
"types": "./types/
|
|
92
|
-
"browser": "./dist/es/
|
|
93
|
-
"umd": "./dist/umd/
|
|
94
|
-
"import": "./dist/es/
|
|
95
|
-
"require": "./dist/cjs/
|
|
96
|
-
"node": "./dist/cjs/
|
|
97
|
-
"module": "./dist/es/
|
|
98
|
-
"default": "./dist/cjs/
|
|
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"
|
|
99
100
|
},
|
|
100
101
|
"development": {
|
|
101
|
-
"types": "./types/
|
|
102
|
-
"browser": "./dist/es/
|
|
103
|
-
"umd": "./dist/umd/
|
|
104
|
-
"import": "./dist/es/
|
|
105
|
-
"require": "./dist/cjs/
|
|
106
|
-
"node": "./dist/cjs/
|
|
107
|
-
"module": "./dist/es/
|
|
108
|
-
"default": "./dist/cjs/
|
|
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"
|
|
109
110
|
},
|
|
110
|
-
"types": "./types/
|
|
111
|
-
"browser": "./dist/es/
|
|
112
|
-
"umd": "./dist/umd/
|
|
113
|
-
"import": "./dist/es/
|
|
114
|
-
"require": "./dist/cjs/
|
|
115
|
-
"node": "./dist/cjs/
|
|
116
|
-
"module": "./dist/es/
|
|
117
|
-
"default": "./dist/cjs/
|
|
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"
|
|
118
119
|
},
|
|
119
|
-
"./
|
|
120
|
+
"./enforce_schema": {
|
|
120
121
|
"production": {
|
|
121
|
-
"types": "./types/
|
|
122
|
-
"browser": "./dist/es/
|
|
123
|
-
"umd": "./dist/umd/
|
|
124
|
-
"import": "./dist/es/
|
|
125
|
-
"require": "./dist/cjs/
|
|
126
|
-
"node": "./dist/cjs/
|
|
127
|
-
"module": "./dist/es/
|
|
128
|
-
"default": "./dist/cjs/
|
|
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"
|
|
129
130
|
},
|
|
130
131
|
"development": {
|
|
131
|
-
"types": "./types/
|
|
132
|
-
"browser": "./dist/es/
|
|
133
|
-
"umd": "./dist/umd/
|
|
134
|
-
"import": "./dist/es/
|
|
135
|
-
"require": "./dist/cjs/
|
|
136
|
-
"node": "./dist/cjs/
|
|
137
|
-
"module": "./dist/es/
|
|
138
|
-
"default": "./dist/cjs/
|
|
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"
|
|
139
140
|
},
|
|
140
|
-
"types": "./types/
|
|
141
|
-
"browser": "./dist/es/
|
|
142
|
-
"umd": "./dist/umd/
|
|
143
|
-
"import": "./dist/es/
|
|
144
|
-
"require": "./dist/cjs/
|
|
145
|
-
"node": "./dist/cjs/
|
|
146
|
-
"module": "./dist/es/
|
|
147
|
-
"default": "./dist/cjs/
|
|
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"
|
|
148
149
|
},
|
|
149
150
|
"./parser": {
|
|
150
151
|
"production": {
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
|
+
"rootDir": ".",
|
|
3
4
|
"compilerOptions": {
|
|
5
|
+
"baseUrl": ".",
|
|
4
6
|
"declarationMap": true,
|
|
5
7
|
"declarationDir": "./types",
|
|
6
|
-
"outDir": "./dist"
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"paths": {
|
|
10
|
+
"ctx": ["src/core/ctx/ctx.ts"],
|
|
11
|
+
"generateIsolate": ["src/core/isolate/generateIsolate.ts"],
|
|
12
|
+
"isolate": ["src/core/isolate/isolate.ts"],
|
|
13
|
+
"isolateCursor": ["src/core/isolate/isolateCursor.ts"],
|
|
14
|
+
"isolateHooks": ["src/core/isolate/isolateHooks.ts"],
|
|
15
|
+
"each": ["src/core/isolate/isolates/each.ts"],
|
|
16
|
+
"group": ["src/core/isolate/isolates/group.ts"],
|
|
17
|
+
"omitWhen": ["src/core/isolate/isolates/omitWhen.ts"],
|
|
18
|
+
"skipWhen": ["src/core/isolate/isolates/skipWhen.ts"],
|
|
19
|
+
"IsolateTypes": ["src/core/isolate/IsolateTypes.ts"],
|
|
20
|
+
"createStateRef": ["src/core/state/createStateRef.ts"],
|
|
21
|
+
"stateHooks": ["src/core/state/stateHooks.ts"],
|
|
22
|
+
"create": ["src/core/suite/create.ts"],
|
|
23
|
+
"hasRemainingTests": ["src/core/suite/hasRemainingTests.ts"],
|
|
24
|
+
"produceSuiteResult": ["src/core/suite/produce/produceSuiteResult.ts"],
|
|
25
|
+
"produceSuiteRunResult": [
|
|
26
|
+
"src/core/suite/produce/produceSuiteRunResult.ts"
|
|
27
|
+
],
|
|
28
|
+
"runCallbacks": ["src/core/suite/produce/runCallbacks.ts"],
|
|
29
|
+
"Severity": ["src/core/suite/produce/Severity.ts"],
|
|
30
|
+
"genTestsSummary": [
|
|
31
|
+
"src/core/suite/produce/summaryGenerators/genTestsSummary.ts"
|
|
32
|
+
],
|
|
33
|
+
"hasFailuresByTestObjects": [
|
|
34
|
+
"src/core/suite/produce/summaryGenerators/hasFailuresByTestObjects.ts"
|
|
35
|
+
],
|
|
36
|
+
"matchingFieldName": [
|
|
37
|
+
"src/core/suite/produce/summaryGenerators/helpers/matchingFieldName.ts"
|
|
38
|
+
],
|
|
39
|
+
"matchingGroupName": [
|
|
40
|
+
"src/core/suite/produce/summaryGenerators/helpers/matchingGroupName.ts"
|
|
41
|
+
],
|
|
42
|
+
"nonMatchingSeverityProfile": [
|
|
43
|
+
"src/core/suite/produce/summaryGenerators/helpers/nonMatchingSeverityProfile.ts"
|
|
44
|
+
],
|
|
45
|
+
"shouldAddValidProperty": [
|
|
46
|
+
"src/core/suite/produce/summaryGenerators/shouldAddValidProperty.ts"
|
|
47
|
+
],
|
|
48
|
+
"SuiteSummaryTypes": [
|
|
49
|
+
"src/core/suite/produce/summaryGenerators/SuiteSummaryTypes.ts"
|
|
50
|
+
],
|
|
51
|
+
"collectFailures": [
|
|
52
|
+
"src/core/suite/produce/summarySelectors/collectFailures.ts"
|
|
53
|
+
],
|
|
54
|
+
"suiteSelectors": [
|
|
55
|
+
"src/core/suite/produce/summarySelectors/suiteSelectors.ts"
|
|
56
|
+
],
|
|
57
|
+
"key": ["src/core/test/key.ts"],
|
|
58
|
+
"cancelOverriddenPendingTest": [
|
|
59
|
+
"src/core/test/lib/cancelOverriddenPendingTest.ts"
|
|
60
|
+
],
|
|
61
|
+
"isSameProfileTest": ["src/core/test/lib/isSameProfileTest.ts"],
|
|
62
|
+
"registerPrevRunTest": ["src/core/test/lib/registerPrevRunTest.ts"],
|
|
63
|
+
"registerTest": ["src/core/test/lib/registerTest.ts"],
|
|
64
|
+
"removeTestFromState": ["src/core/test/lib/removeTestFromState.ts"],
|
|
65
|
+
"shouldUseErrorAsMessage": [
|
|
66
|
+
"src/core/test/lib/shouldUseErrorAsMessage.ts"
|
|
67
|
+
],
|
|
68
|
+
"useTestAtCursor": ["src/core/test/lib/useTestAtCursor.ts"],
|
|
69
|
+
"omitOptionalFields": ["src/core/test/omitOptionalFields.ts"],
|
|
70
|
+
"runAsyncTest": ["src/core/test/runAsyncTest.ts"],
|
|
71
|
+
"runSyncTest": ["src/core/test/runSyncTest.ts"],
|
|
72
|
+
"test.memo": ["src/core/test/test.memo.ts"],
|
|
73
|
+
"test": ["src/core/test/test.ts"],
|
|
74
|
+
"VestTest": ["src/core/test/VestTest.ts"],
|
|
75
|
+
"vestBus": ["src/core/vestBus.ts"],
|
|
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"],
|
|
80
|
+
"parser": ["src/exports/parser.ts"],
|
|
81
|
+
"promisify": ["src/exports/promisify.ts"],
|
|
82
|
+
"exclusive": ["src/hooks/exclusive.ts"],
|
|
83
|
+
"hookErrors": ["src/hooks/hookErrors.ts"],
|
|
84
|
+
"include": ["src/hooks/include.ts"],
|
|
85
|
+
"mode": ["src/hooks/mode/mode.ts"],
|
|
86
|
+
"Modes": ["src/hooks/mode/Modes.ts"],
|
|
87
|
+
"optionalFields": ["src/hooks/optionalFields.ts"],
|
|
88
|
+
"warn": ["src/hooks/warn.ts"],
|
|
89
|
+
"vest": ["src/vest.ts"]
|
|
90
|
+
}
|
|
7
91
|
}
|
|
8
92
|
}
|
package/types/classnames.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classnames.d.ts","sourceRoot":"","sources":["../src/exports/classnames.ts","../src/core/suite/produce/summaryGenerators/SuiteSummaryTypes.ts","../src/exports/parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAKA;;GAEG;AACH,iBAAwB,UAAU,CAChC,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE,gBAAqB,GAC7B,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAe/B;AAED,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforce_compose.d.ts","sourceRoot":"","sources":["../src/exports/enforce_compose.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforce_compounds.d.ts","sourceRoot":"","sources":["../src/exports/enforce_compounds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforce_schema.d.ts","sourceRoot":"","sources":["../src/exports/enforce_schema.ts"],"names":[],"mappings":""}
|
package/types/parser.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/exports/parser.ts","../src/core/suite/produce/summaryGenerators/SuiteSummaryTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,iBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAuC7D;AAED,UAAU,gBAAgB;IACxB,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC"}
|
package/types/promisify.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promisify.d.ts","sourceRoot":"","sources":["../src/exports/promisify.ts","../src/core/suite/produce/summaryGenerators/SuiteSummaryTypes.ts","../src/core/test/lib/shouldUseErrorAsMessage.ts","../src/hooks/optionalFields.ts","../src/core/state/createStateRef.ts","../src/hooks/mode/Modes.ts","../src/core/isolate/isolateCursor.ts","../src/core/isolate/generateIsolate.ts","../src/core/ctx/ctx.ts","../src/core/state/stateHooks.ts","../src/core/test/VestTest.ts","../src/core/isolate/IsolateTypes.ts","../src/core/isolate/isolateHooks.ts","../src/core/test/key.ts","../src/core/isolate/isolate.ts","../src/core/suite/produce/summaryGenerators/helpers/matchingFieldName.ts","../src/core/suite/hasRemainingTests.ts","../src/core/suite/produce/produceSuiteRunResult.ts","../src/core/test/omitOptionalFields.ts","../src/core/test/lib/removeTestFromState.ts","../src/core/suite/produce/runCallbacks.ts","../src/core/vestBus.ts","../src/core/suite/create.ts","../src/core/suite/produce/Severity.ts","../src/core/suite/produce/summaryGenerators/helpers/matchingGroupName.ts","../src/core/suite/produce/summaryGenerators/helpers/nonMatchingSeverityProfile.ts","../src/core/suite/produce/summaryGenerators/hasFailuresByTestObjects.ts","../src/core/suite/produce/summaryGenerators/shouldAddValidProperty.ts","../src/core/suite/produce/summaryGenerators/genTestsSummary.ts","../src/core/suite/produce/summarySelectors/collectFailures.ts","../src/core/suite/produce/summarySelectors/suiteSelectors.ts","../src/core/suite/produce/produceSuiteResult.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,QAAA,MAAM,SAAS,0BACW,GAAG,EAAE,KAAK,cAAc,eACtC,GAAG,EAAE,KAAG,QAAQ,WAAW,CAOpC,CAAC"}
|
package/types/vest.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { enforce } from 'n4s';
|
|
2
|
+
import { CB, nestedArray } from "vest-utils";
|
|
3
|
+
import { UseState } from "vast";
|
|
2
4
|
type SuiteSummary = {
|
|
3
5
|
groups: Groups;
|
|
4
6
|
tests: Tests;
|
|
@@ -69,7 +71,6 @@ type AsyncTest = Promise<string | void>;
|
|
|
69
71
|
type TestResult = AsyncTest | boolean | void;
|
|
70
72
|
type TestFn = () => TestResult;
|
|
71
73
|
type KStatus = "UNTESTED" | "SKIPPED" | "FAILED" | "WARNING" | "PASSING" | "PENDING" | "CANCELED" | "OMITTED";
|
|
72
|
-
type CB = (...args: any[]) => any;
|
|
73
74
|
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
74
75
|
declare function suiteSelectors(summary: SuiteSummary): SuiteSelectors;
|
|
75
76
|
interface SuiteSelectors {
|
|
@@ -152,13 +153,6 @@ declare enum Modes {
|
|
|
152
153
|
ALL = 0,
|
|
153
154
|
EAGER = 1
|
|
154
155
|
}
|
|
155
|
-
type NestedArray<T> = Array<NestedArray<T> | T>;
|
|
156
|
-
type SetStateInput<S> = S | ((prevState: S) => S);
|
|
157
|
-
type StateHandlerReturn<S> = [
|
|
158
|
-
S,
|
|
159
|
-
(nextState: SetStateInput<S>) => void
|
|
160
|
-
];
|
|
161
|
-
type UseState<S> = () => StateHandlerReturn<S>;
|
|
162
156
|
/**
|
|
163
157
|
* Marks a field as optional, either just by name, or by a given condition.
|
|
164
158
|
*
|
|
@@ -204,7 +198,7 @@ type TestObjects = {
|
|
|
204
198
|
prev: VestTests;
|
|
205
199
|
current: VestTests;
|
|
206
200
|
};
|
|
207
|
-
type VestTests = NestedArray<VestTest>;
|
|
201
|
+
type VestTests = nestedArray.NestedArray<VestTest>;
|
|
208
202
|
declare const _default: import("context").CtxCascadeApi<CTXType>;
|
|
209
203
|
type CTXType = {
|
|
210
204
|
isolate: Isolate;
|
|
@@ -342,6 +336,7 @@ declare const test: typeof testBase & {
|
|
|
342
336
|
* Sets a running test to warn only mode.
|
|
343
337
|
*/
|
|
344
338
|
declare function warn(): void;
|
|
345
|
-
declare const VERSION = "4.6.
|
|
339
|
+
declare const VERSION = "4.6.2-dev-fcaa09";
|
|
346
340
|
export { suiteSelectors, test, create, each, only, skip, warn, group, optional, skipWhen, omitWhen, enforce, VERSION, context, include, eager };
|
|
347
341
|
export type { SuiteResult, SuiteRunResult, SuiteSummary, VestTest, Suite };
|
|
342
|
+
//# sourceMappingURL=vest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vest.d.ts","sourceRoot":"","sources":["../src/vest.ts","../src/core/suite/produce/summaryGenerators/SuiteSummaryTypes.ts","../src/core/test/lib/shouldUseErrorAsMessage.ts","../src/hooks/optionalFields.ts","../src/core/isolate/isolateCursor.ts","../src/core/isolate/IsolateTypes.ts","../src/hooks/mode/Modes.ts","../src/core/isolate/generateIsolate.ts","../src/core/ctx/ctx.ts","../src/core/isolate/isolateHooks.ts","../src/core/test/key.ts","../src/core/isolate/isolate.ts","../src/core/suite/produce/summaryGenerators/helpers/matchingFieldName.ts","../src/core/suite/hasRemainingTests.ts","../src/core/suite/produce/produceSuiteRunResult.ts","../src/core/test/omitOptionalFields.ts","../src/core/test/lib/removeTestFromState.ts","../src/core/suite/produce/runCallbacks.ts","../src/core/vestBus.ts","../src/core/suite/create.ts","../src/core/suite/produce/Severity.ts","../src/core/suite/produce/summaryGenerators/helpers/matchingGroupName.ts","../src/core/suite/produce/summaryGenerators/helpers/nonMatchingSeverityProfile.ts","../src/core/suite/produce/summaryGenerators/hasFailuresByTestObjects.ts","../src/core/suite/produce/summaryGenerators/shouldAddValidProperty.ts","../src/core/suite/produce/summaryGenerators/genTestsSummary.ts","../src/core/suite/produce/summarySelectors/collectFailures.ts","../src/core/suite/produce/summarySelectors/suiteSelectors.ts","../src/core/suite/produce/produceSuiteResult.ts","../src/core/state/createStateRef.ts","../src/core/state/stateHooks.ts","../src/core/test/VestTest.ts","../src/core/isolate/isolates/each.ts","../src/hooks/hookErrors.ts","../src/core/isolate/isolates/skipWhen.ts","../src/hooks/exclusive.ts","../src/core/isolate/isolates/group.ts","../src/hooks/include.ts","../src/hooks/mode/mode.ts","../src/core/isolate/isolates/omitWhen.ts","../src/core/test/lib/isSameProfileTest.ts","../src/core/test/lib/cancelOverriddenPendingTest.ts","../src/core/test/runAsyncTest.ts","../src/core/test/runSyncTest.ts","../src/core/test/lib/registerTest.ts","../src/core/test/lib/useTestAtCursor.ts","../src/core/test/lib/registerPrevRunTest.ts","../src/core/test/test.memo.ts","../src/core/test/test.ts","../src/hooks/warn.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoB9B,QAAA,MAAM,OAAO,qBAAqB,CAAC;AAEnC,OAAO,wIAiBN,CAAC;AAEF,YAAY,8DAA8D,CAAC"}
|
package/dist/cjs/compose.js
DELETED
package/dist/cjs/compounds.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var n4s = require('n4s');
|
|
4
|
-
var vestUtils = require('vest-utils');
|
|
5
|
-
|
|
6
|
-
function ruleReturn(pass, message) {
|
|
7
|
-
var output = { pass: pass };
|
|
8
|
-
if (message) {
|
|
9
|
-
output.message = message;
|
|
10
|
-
}
|
|
11
|
-
return output;
|
|
12
|
-
}
|
|
13
|
-
function failing() {
|
|
14
|
-
return ruleReturn(false);
|
|
15
|
-
}
|
|
16
|
-
function passing() {
|
|
17
|
-
return ruleReturn(true);
|
|
18
|
-
}
|
|
19
|
-
function defaultToPassing(callback) {
|
|
20
|
-
return vestUtils.defaultTo(callback, passing());
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function runLazyRule(lazyRule, currentValue) {
|
|
24
|
-
try {
|
|
25
|
-
return lazyRule.run(currentValue);
|
|
26
|
-
}
|
|
27
|
-
catch (_a) {
|
|
28
|
-
return failing();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* eslint-disable max-lines-per-function */
|
|
33
|
-
function compose() {
|
|
34
|
-
var composites = [];
|
|
35
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
36
|
-
composites[_i] = arguments[_i];
|
|
37
|
-
}
|
|
38
|
-
return vestUtils.assign(function (value) {
|
|
39
|
-
var res = run(value);
|
|
40
|
-
vestUtils.invariant(res.pass, vestUtils.StringObject(res.message));
|
|
41
|
-
}, {
|
|
42
|
-
run: run,
|
|
43
|
-
test: function (value) { return run(value).pass; }
|
|
44
|
-
});
|
|
45
|
-
function run(value) {
|
|
46
|
-
return n4s.ctx.run({ value: value }, function () {
|
|
47
|
-
return defaultToPassing(vestUtils.mapFirst(composites, function (composite, breakout) {
|
|
48
|
-
/* HACK: Just a small white lie. ~~HELP WANTED~~.
|
|
49
|
-
The ideal is that instead of `LazyRuleRunners` We would simply use `Lazy` to begin with.
|
|
50
|
-
The problem is that lazy rules can't really be passed to this function due to some generic hell
|
|
51
|
-
so we're limiting it to a small set of functions.
|
|
52
|
-
*/
|
|
53
|
-
var res = runLazyRule(composite, value);
|
|
54
|
-
breakout(!res.pass, res);
|
|
55
|
-
}));
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
module.exports = compose;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var n=require("n4s"),t=require("vest-utils");function r(n,t){return n={pass:n},t&&(n.message=t),n}function u(n){return t.defaultTo(n,r(!0))}function e(n,t){try{return n.run(t)}catch(n){return r(!1)}}module.exports=function(){function r(r){return n.ctx.run({value:r},(function(){return u(t.mapFirst(s,(function(n,t){t(!(n=e(n,r)).pass,n)})))}))}for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];return t.assign((function(n){n=r(n),t.invariant(n.pass,t.StringObject(n.message))}),{run:r,test:function(n){return r(n).pass}})};
|