vest 5.2.9 → 5.3.0-dev-20240220-62e1
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/classnames.development.js.map +1 -1
- package/dist/cjs/classnames.production.js.map +1 -1
- package/dist/cjs/parser.development.js +1 -1
- package/dist/cjs/parser.development.js.map +1 -1
- package/dist/cjs/parser.production.js +1 -1
- package/dist/cjs/parser.production.js.map +1 -1
- package/dist/cjs/vest.development.js +1056 -1055
- package/dist/cjs/vest.development.js.map +1 -1
- package/dist/cjs/vest.production.js +1 -1
- package/dist/cjs/vest.production.js.map +1 -1
- package/dist/es/classnames.development.js.map +1 -1
- package/dist/es/classnames.production.js.map +1 -1
- package/dist/es/parser.development.js +1 -1
- package/dist/es/parser.development.js.map +1 -1
- package/dist/es/parser.production.js +1 -1
- package/dist/es/parser.production.js.map +1 -1
- package/dist/es/vest.development.js +1057 -1056
- package/dist/es/vest.development.js.map +1 -1
- package/dist/es/vest.production.js +1 -1
- package/dist/es/vest.production.js.map +1 -1
- package/dist/umd/classnames.development.js.map +1 -1
- package/dist/umd/classnames.production.js.map +1 -1
- package/dist/umd/parser.development.js +4 -4
- package/dist/umd/parser.development.js.map +1 -1
- package/dist/umd/parser.production.js +1 -1
- package/dist/umd/parser.production.js.map +1 -1
- package/dist/umd/vest.development.js +1056 -1055
- package/dist/umd/vest.development.js.map +1 -1
- package/dist/umd/vest.production.js +1 -1
- package/dist/umd/vest.production.js.map +1 -1
- package/package.json +6 -6
- package/types/SuiteSerializer.d.ts +3 -2
- package/types/SuiteSerializer.d.ts.map +1 -1
- package/types/vest.d.ts +24 -23
- package/types/vest.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classnames.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts","../../src/exports/classnames.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import {
|
|
1
|
+
{"version":3,"file":"classnames.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts","../../src/exports/classnames.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { suiteSelectors } from 'vest';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n","import { isFunction } from 'vest-utils';\n\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { ParsedVestObject, parse } from 'parser';\n\n/**\n * Creates a function that returns class names that match the validation result\n */\nexport default function classnames<F extends TFieldName, G extends TGroupName>(\n res: SuiteSummary<F, G>,\n classes: SupportedClasses = {}\n): (fieldName: F) => string {\n const selectors = parse(res);\n\n return function cn(fieldName: F): string {\n const classesArray: string[] = [];\n\n for (const selector in classes) {\n const sel = selector as keyof SupportedClasses;\n if (isFunction(selectors[sel]) && selectors[sel](fieldName)) {\n classesArray.push(classes[sel] as string);\n }\n }\n\n return classesArray.join(' ');\n };\n}\n\ntype SupportedClasses = {\n [K in keyof ParsedVestObject<TFieldName>]?: string;\n};\n"],"names":["invariant","hasOwnProperty","suiteSelectors","isNullish","isPositive","isFunction"],"mappings":";;;;;AAAA,IAAY,YAuBX,CAAA;AAvBD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,yCAA+D,CAAA;AAC/D,IAAA,YAAA,CAAA,oBAAA,CAAA,GAAA,iDAAsE,CAAA;AACtE,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,2BAAiD,CAAA;AACjD,IAAA,YAAA,CAAA,yCAAA,CAAA,GAAA,2CAAqF,CAAA;AACrF,IAAA,YAAA,CAAA,4BAAA,CAAA,GAAA,+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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classnames.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/classnames.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { isFunction } from 'vest-utils';\n\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { ParsedVestObject, parse } from 'parser';\n\n/**\n * Creates a function that returns class names that match the validation result\n */\nexport default function classnames<F extends TFieldName, G extends TGroupName>(\n res: SuiteSummary<F, G>,\n classes: SupportedClasses = {}\n): (fieldName: F) => string {\n const selectors = parse(res);\n\n return function cn(fieldName: F): string {\n const classesArray: string[] = [];\n\n for (const selector in classes) {\n const sel = selector as keyof SupportedClasses;\n if (isFunction(selectors[sel]) && selectors[sel](fieldName)) {\n classesArray.push(classes[sel] as string);\n }\n }\n\n return classesArray.join(' ');\n };\n}\n\ntype SupportedClasses = {\n [K in keyof ParsedVestObject<TFieldName>]?: string;\n};\n","import {
|
|
1
|
+
{"version":3,"file":"classnames.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/classnames.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { isFunction } from 'vest-utils';\n\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { ParsedVestObject, parse } from 'parser';\n\n/**\n * Creates a function that returns class names that match the validation result\n */\nexport default function classnames<F extends TFieldName, G extends TGroupName>(\n res: SuiteSummary<F, G>,\n classes: SupportedClasses = {}\n): (fieldName: F) => string {\n const selectors = parse(res);\n\n return function cn(fieldName: F): string {\n const classesArray: string[] = [];\n\n for (const selector in classes) {\n const sel = selector as keyof SupportedClasses;\n if (isFunction(selectors[sel]) && selectors[sel](fieldName)) {\n classesArray.push(classes[sel] as string);\n }\n }\n\n return classesArray.join(' ');\n };\n}\n\ntype SupportedClasses = {\n [K in keyof ParsedVestObject<TFieldName>]?: string;\n};\n","import { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { suiteSelectors } from 'vest';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["ErrorStrings","res","classes","selectors","summary","invariant","hasOwnProperty","PARSER_EXPECT_RESULT_OBJECT","sel","suiteSelectors","testedStorage","invalid","hasErrors","pending","isPending","tested","fieldName","isNullish","isPositive","testCount","addFieldToTestedStorage","untested","valid","isValid","warning","hasWarnings","tests","parse","classesArray","selector","isFunction","push","join"],"mappings":"iBAAYA,6CAAZ,SAAYA,GACVA,EAAA,oBAAA,0CACAA,EAAA,mBAAA,kDACAA,EAAA,oBAAA,4BACAA,EAAA,wCAAA,4CACAA,EAAA,2BAAA,gDACAA,EAAA,4BAAA,2EACAA,EAAA,8BAAA,8DACAA,EAAA,iCAAA,sCACAA,EAAA,iCAAA,yFACAA,EAAA,gCAAA,wZAMAA,EAAA,mCAAA,+KAIAA,EAAA,0BAAA,wIAEAA,EAAA,aAAA,gDACD,CAvBD,CAAYA,IAAAA,EAuBX,CAAA,mBCfuB,SACtBC,EACAC,EAA4B,IAE5B,MAAMC,ECNF,SACJC,GAEAC,EAASA,UACPD,GAAWE,iBAAeF,EAAS,SACnCJ,EAAaO,6BAGf,MAAMC,EAAMC,iBAAeL,GAErBM,EAAyC,CAAA,EAEzCP,EAAY,CAChBQ,QAASH,EAAII,UACbC,QAASL,EAAIM,UACbC,OASF,SAAkBC,GAChB,OAAIC,EAAAA,UAAUD,GACLE,EAAUA,WAACd,EAAQe,WAGxBb,EAAcA,eAACI,EAAeM,GACzBN,EAAcM,IAGvBI,EAAwBJ,GAEjBb,EAAUY,OAAOC,GACzB,EApBCK,SA4BF,SAAoBL,GAClB,QAASE,EAAAA,WAAWd,EAAQe,YAAchB,EAAUY,OAAOC,GAC5D,EA7BCM,MAAOd,EAAIe,QACXC,QAAShB,EAAIiB,aAGf,OAAOtB,EAiBP,SAASiB,EAAwBJ,GAC/BN,EAAcM,GACZV,iBAAeF,EAAQsB,MAAOV,IAC9BE,EAAAA,WAAWd,EAAQsB,MAAMV,GAAWG,UACvC,CAKH,CDzCoBQ,CAAM1B,GAExB,OAAO,SAAYe,GACjB,MAAMY,EAAyB,GAE/B,IAAK,MAAMC,KAAY3B,EAAS,CAC9B,MAAMM,EAAMqB,EACRC,EAAUA,WAAC3B,EAAUK,KAASL,EAAUK,GAAKQ,IAC/CY,EAAaG,KAAK7B,EAAQM,GAE7B,CAED,OAAOoB,EAAaI,KAAK,IAC3B,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import {
|
|
1
|
+
{"version":3,"file":"parser.development.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { suiteSelectors } from 'vest';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["invariant","hasOwnProperty","suiteSelectors","isNullish","isPositive"],"mappings":";;;;;AAAA,IAAY,YAuBX,CAAA;AAvBD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,qBAAA,CAAA,GAAA,yCAA+D,CAAA;AAC/D,IAAA,YAAA,CAAA,oBAAA,CAAA,GAAA,iDAAsE,CAAA;AACtE,IAAA,YAAA,CAAA,qB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AQ,CAAC,SAAa,EAAA;AAC7B,QAAA,IAAIC,mBAAS,CAAC,SAAS,CAAC,EAAE;AACxB,YAAA,OAAOC,oBAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACtC,SAAA;AAED,QAAA,IAAIH,wBAAc,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE;AAC5C,YAAA,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AACjC,SAAA;QAED,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAEnC,QAAA,OAAO,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACpC;IAED,SAAS,uBAAuB,CAAC,SAAY,EAAA;QAC3C,aAAa,CAAC,SAAS,CAAC;AACtB,YAAAA,wBAAc,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;gBACxCG,oBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;KAClD;IAED,SAAS,UAAU,CAAC,SAAa,EAAA;AAC/B,QAAA,OAAO,EAAEA,oBAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;KACxE;AACH;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e,t=require("vest"),s=require("vest
|
|
1
|
+
"use strict";var e,t=require("vest-utils"),s=require("vest");!function(e){e.HOOK_CALLED_OUTSIDE="hook called outside of a running suite.",e.EXPECTED_VEST_TEST="Expected value to be an instance of IsolateTest",e.FIELD_NAME_REQUIRED="Field name must be passed",e.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION="Suite must be initialized with a function",e.PROMISIFY_REQUIRE_FUNCTION="Vest.Promisify must be called with a function",e.PARSER_EXPECT_RESULT_OBJECT="Vest parser: expected argument at position 0 to be Vest's result object.",e.WARN_MUST_BE_CALLED_FROM_TEST="Warn must be called from within the body of a test function",e.EACH_CALLBACK_MUST_BE_A_FUNCTION="Each must be called with a function",e.INVALID_PARAM_PASSED_TO_FUNCTION='Incompatible params passed to {fn_name} function. "{param}" must be of type {expected}',e.TESTS_CALLED_IN_DIFFERENT_ORDER='Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You\'re using if/else statements to conditionally select tests. Instead, use "skipWhen".\n 2. You are iterating over a list of tests, and their order changed. Use "each" and a custom key prop so that Vest retains their state.',e.UNEXPECTED_TEST_REGISTRATION_ERROR="Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.",e.UNEXPECTED_TEST_RUN_ERROR="Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.",e.INCLUDE_SELF="Trying to call include.when on the same field."}(e||(e={})),exports.parse=function(n){t.invariant(n&&t.hasOwnProperty(n,"valid"),e.PARSER_EXPECT_RESULT_OBJECT);const i=s.suiteSelectors(n),r={},o={invalid:i.hasErrors,pending:i.isPending,tested:function(e){if(t.isNullish(e))return t.isPositive(n.testCount);if(t.hasOwnProperty(r,e))return r[e];return a(e),o.tested(e)},untested:function(e){return!(t.isPositive(n.testCount)&&o.tested(e))},valid:i.isValid,warning:i.hasWarnings};return o;function a(e){r[e]=t.hasOwnProperty(n.tests,e)&&t.isPositive(n.tests[e].testCount)}};
|
|
2
2
|
//# sourceMappingURL=parser.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import {
|
|
1
|
+
{"version":3,"file":"parser.production.js","sources":["../../src/errors/ErrorStrings.ts","../../src/exports/parser.ts"],"sourcesContent":["export enum ErrorStrings {\n HOOK_CALLED_OUTSIDE = 'hook called outside of a running suite.',\n EXPECTED_VEST_TEST = 'Expected value to be an instance of IsolateTest',\n FIELD_NAME_REQUIRED = 'Field name must be passed',\n SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION = 'Suite must be initialized with a function',\n PROMISIFY_REQUIRE_FUNCTION = 'Vest.Promisify must be called with a function',\n PARSER_EXPECT_RESULT_OBJECT = \"Vest parser: expected argument at position 0 to be Vest's result object.\",\n WARN_MUST_BE_CALLED_FROM_TEST = 'Warn must be called from within the body of a test function',\n EACH_CALLBACK_MUST_BE_A_FUNCTION = 'Each must be called with a function',\n INVALID_PARAM_PASSED_TO_FUNCTION = 'Incompatible params passed to {fn_name} function. \"{param}\" must be of type {expected}',\n TESTS_CALLED_IN_DIFFERENT_ORDER = `Vest Critical Error: Tests called in different order than previous run.\n expected: {fieldName}\n received: {prevName}\n This can happen on one of two reasons:\n 1. You're using if/else statements to conditionally select tests. Instead, use \"skipWhen\".\n 2. You are iterating over a list of tests, and their order changed. Use \"each\" and a custom key prop so that Vest retains their state.`,\n UNEXPECTED_TEST_REGISTRATION_ERROR = `Unexpected error encountered during test registration.\n Please report this issue to Vest's Github repository.\n Test Object: {testObject}.\n Error: {error}.`,\n UNEXPECTED_TEST_RUN_ERROR = `Unexpected error encountered during test run. Please report this issue to Vest's Github repository.\n Test Object: {testObject}.`,\n INCLUDE_SELF = 'Trying to call include.when on the same field.',\n}\n","import { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils';\n\nimport { ErrorStrings } from 'ErrorStrings';\nimport { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { suiteSelectors } from 'vest';\n\nexport function parse<F extends TFieldName, G extends TGroupName>(\n summary: SuiteSummary<F, G>\n): ParsedVestObject<F> {\n invariant(\n summary && hasOwnProperty(summary, 'valid'),\n ErrorStrings.PARSER_EXPECT_RESULT_OBJECT\n );\n\n const sel = suiteSelectors(summary);\n\n const testedStorage: Record<string, boolean> = {};\n\n const selectors = {\n invalid: sel.hasErrors,\n pending: sel.isPending,\n tested: isTested,\n untested: isUntested,\n valid: sel.isValid,\n warning: sel.hasWarnings,\n };\n\n return selectors;\n\n // Booleans\n function isTested(fieldName?: F): boolean {\n if (isNullish(fieldName)) {\n return isPositive(summary.testCount);\n }\n\n if (hasOwnProperty(testedStorage, fieldName)) {\n return testedStorage[fieldName];\n }\n\n addFieldToTestedStorage(fieldName);\n\n return selectors.tested(fieldName);\n }\n\n function addFieldToTestedStorage(fieldName: F): void {\n testedStorage[fieldName] =\n hasOwnProperty(summary.tests, fieldName) &&\n isPositive(summary.tests[fieldName].testCount);\n }\n\n function isUntested(fieldName?: F): boolean {\n return !(isPositive(summary.testCount) && selectors.tested(fieldName));\n }\n}\n\nexport type ParsedVestObject<F extends TFieldName> = {\n valid(fieldName?: F): boolean;\n tested(fieldName?: F): boolean;\n invalid(fieldName?: F): boolean;\n untested(fieldName?: F): boolean;\n warning(fieldName?: F): boolean;\n pending(fieldName?: F): boolean;\n};\n"],"names":["ErrorStrings","summary","invariant","hasOwnProperty","PARSER_EXPECT_RESULT_OBJECT","sel","suiteSelectors","testedStorage","selectors","invalid","hasErrors","pending","isPending","tested","fieldName","isNullish","isPositive","testCount","addFieldToTestedStorage","untested","valid","isValid","warning","hasWarnings","tests"],"mappings":"iBAAYA,6CAAZ,SAAYA,GACVA,EAAA,oBAAA,0CACAA,EAAA,mBAAA,kDACAA,EAAA,oBAAA,4BACAA,EAAA,wCAAA,4CACAA,EAAA,2BAAA,gDACAA,EAAA,4BAAA,2EACAA,EAAA,8BAAA,8DACAA,EAAA,iCAAA,sCACAA,EAAA,iCAAA,yFACAA,EAAA,gCAAA,wZAMAA,EAAA,mCAAA,+KAIAA,EAAA,0BAAA,wIAEAA,EAAA,aAAA,gDACD,CAvBD,CAAYA,IAAAA,EAuBX,CAAA,kBCjBK,SACJC,GAEAC,EAASA,UACPD,GAAWE,iBAAeF,EAAS,SACnCD,EAAaI,6BAGf,MAAMC,EAAMC,iBAAeL,GAErBM,EAAyC,CAAA,EAEzCC,EAAY,CAChBC,QAASJ,EAAIK,UACbC,QAASN,EAAIO,UACbC,OASF,SAAkBC,GAChB,GAAIC,EAAAA,UAAUD,GACZ,OAAOE,EAAUA,WAACf,EAAQgB,WAG5B,GAAId,EAAcA,eAACI,EAAeO,GAChC,OAAOP,EAAcO,GAKvB,OAFAI,EAAwBJ,GAEjBN,EAAUK,OAAOC,EACzB,EApBCK,SA4BF,SAAoBL,GAClB,QAASE,EAAAA,WAAWf,EAAQgB,YAAcT,EAAUK,OAAOC,GAC5D,EA7BCM,MAAOf,EAAIgB,QACXC,QAASjB,EAAIkB,aAGf,OAAOf,EAiBP,SAASU,EAAwBJ,GAC/BP,EAAcO,GACZX,iBAAeF,EAAQuB,MAAOV,IAC9BE,EAAAA,WAAWf,EAAQuB,MAAMV,GAAWG,UACvC,CAKH"}
|