From 54ef2e8e5dcda2907a9a089a38f78682277f6748 Mon Sep 17 00:00:00 2001 From: ealush Date: Mon, 29 Jul 2024 02:05:03 +0300 Subject: [PATCH] Replace jest with Vitest --- .eslintrc.js | 33 +- .github/PULL_REQUEST_TEMPLATE.md | 6 +- .github/workflows/integration.yml | 2 + .prettierignore | 3 +- .yarnrc.yml | 2 +- CONTRIBUTING.md | 2 +- package.json | 2 + packages/anyone/README.md | 16 +- packages/anyone/src/__tests__/all.test.ts | 19 +- packages/anyone/src/__tests__/any.test.ts | 23 +- packages/anyone/src/__tests__/none.test.ts | 23 +- packages/anyone/src/__tests__/one.test.ts | 23 +- .../src/__tests__/runAnyoneMethods.test.ts | 12 +- packages/context/README.md | 2 +- .../__snapshots__/cascade.test.ts.snap | 8 +- .../context/src/__tests__/cascade.test.ts | 28 +- .../context/src/__tests__/context.test.ts | 2 + packages/context/src/context.ts | 6 +- packages/n4s/src/__tests__/enforce.test.ts | 29 +- .../n4s/src/__tests__/enforceEager.test.ts | 2 + .../n4s/src/exports/__tests__/compose.test.ts | 26 +- .../n4s/src/exports/__tests__/date.test.ts | 58 +- .../n4s/src/exports/__tests__/email.test.ts | 16 +- .../n4s/src/exports/__tests__/isUrl.test.ts | 75 +- packages/n4s/src/exports/compose.ts | 8 +- packages/n4s/src/exports/schema.ts | 1 - packages/n4s/src/lib/ruleReturn.ts | 6 +- packages/n4s/src/lib/runLazyRule.ts | 2 +- packages/n4s/src/lib/transformResult.ts | 4 +- .../plugins/compounds/__tests__/allOf.test.ts | 6 +- .../compounds/__tests__/noneOf.test.ts | 8 +- .../plugins/compounds/__tests__/oneOf.test.ts | 6 +- packages/n4s/src/plugins/compounds/allOf.ts | 2 +- packages/n4s/src/plugins/compounds/anyOf.ts | 2 +- packages/n4s/src/plugins/compounds/noneOf.ts | 2 +- .../schema/__tests__/isArrayOf.test.ts | 32 +- .../plugins/schema/__tests__/loose.test.ts | 4 +- .../plugins/schema/__tests__/optional.test.ts | 20 +- .../plugins/schema/__tests__/partial.test.ts | 36 +- .../schema/__tests__/shape&loose.test.ts | 2 + .../plugins/schema/__tests__/shape.test.ts | 4 +- packages/n4s/src/plugins/schema/isArrayOf.ts | 6 +- packages/n4s/src/plugins/schema/loose.ts | 4 +- packages/n4s/src/plugins/schema/shape.ts | 2 +- .../n4s/src/rules/__tests__/endsWith.test.ts | 4 +- .../n4s/src/rules/__tests__/equals.test.ts | 1 + .../__tests__/greaterThanOrEquals.test.ts | 3 +- .../n4s/src/rules/__tests__/inside.test.ts | 6 +- .../n4s/src/rules/__tests__/isBetween.test.ts | 2 + .../n4s/src/rules/__tests__/isBlank.test.ts | 2 + .../n4s/src/rules/__tests__/isBoolean.test.ts | 2 + .../n4s/src/rules/__tests__/isEven.test.ts | 1 + .../n4s/src/rules/__tests__/isKeyOf.test.ts | 4 +- .../n4s/src/rules/__tests__/isNaN.test.ts | 2 + .../src/rules/__tests__/isNegative.test.ts | 2 + .../n4s/src/rules/__tests__/isNullish.test.ts | 2 + .../n4s/src/rules/__tests__/isNumber.test.ts | 2 + .../n4s/src/rules/__tests__/isOdd.test.ts | 1 + .../n4s/src/rules/__tests__/isTruthy.test.ts | 2 + .../n4s/src/rules/__tests__/isValueOf.test.ts | 2 + .../n4s/src/rules/__tests__/lessThan.test.ts | 3 +- .../rules/__tests__/lessThanOrEquals.test.ts | 3 +- .../__tests__/longerThanOrEquals.test.ts | 1 + .../n4s/src/rules/__tests__/matches.test.ts | 2 + .../src/rules/__tests__/ruleCondition.test.ts | 12 +- .../n4s/src/rules/__tests__/rules.test.ts | 1 + .../src/rules/__tests__/shorterThan.test.ts | 2 +- .../__tests__/shorterThanOrEquals.test.ts | 2 +- .../src/rules/__tests__/startsWith.test.ts | 1 + packages/n4s/src/rules/greaterThanOrEquals.ts | 2 +- packages/n4s/src/rules/isBetween.ts | 2 +- packages/n4s/src/rules/lessThanOrEquals.ts | 2 +- packages/n4s/src/rules/longerThanOrEquals.ts | 2 +- packages/n4s/src/rules/ruleCondition.ts | 2 +- packages/n4s/src/rules/shorterThan.ts | 2 +- packages/n4s/src/rules/shorterThanOrEquals.ts | 2 +- .../runtime/__tests__/enforceContext.test.ts | 19 +- .../n4s/src/runtime/__tests__/message.test.ts | 17 +- packages/n4s/src/runtime/genEnforceLazy.ts | 8 +- packages/vast/README.md | 2 +- packages/vast/src/__tests__/vast.test.ts | 20 +- packages/vast/src/vast.ts | 12 +- packages/vest-utils/src/SimpleStateMachine.ts | 2 +- .../src/__tests__/Predicates.test.ts | 23 +- .../src/__tests__/SimpleStateMachine.test.ts | 1 + .../src/__tests__/StringObject.test.ts | 1 + .../vest-utils/src/__tests__/asArray.test.ts | 1 + .../vest-utils/src/__tests__/bindNot.test.ts | 8 +- packages/vest-utils/src/__tests__/bus.test.ts | 35 +- .../vest-utils/src/__tests__/cache.test.ts | 11 +- .../vest-utils/src/__tests__/callEach.test.ts | 7 +- .../src/__tests__/defaultTo.test.ts | 8 +- .../src/__tests__/deferThrow.test.ts | 5 +- .../vest-utils/src/__tests__/either.test.ts | 1 + .../src/__tests__/greaterThan.test.ts | 4 +- .../src/__tests__/invariant.test.ts | 2 + .../vest-utils/src/__tests__/isArray.test.ts | 1 + .../src/__tests__/isBoolean.test.ts | 1 + .../vest-utils/src/__tests__/isEmpty.test.ts | 2 + .../vest-utils/src/__tests__/isNull.test.ts | 1 + .../src/__tests__/isNumeric.test.ts | 1 + .../src/__tests__/isPositive.test.ts | 1 + .../src/__tests__/isPromise.test.ts | 1 + .../vest-utils/src/__tests__/isString.test.ts | 1 + .../src/__tests__/isUndefined.test.ts | 1 + .../src/__tests__/lengthEquals.test.ts | 2 +- .../src/__tests__/longerThan.test.ts | 2 +- .../vest-utils/src/__tests__/mapFirst.test.ts | 2 + .../src/__tests__/nonnullish.test.ts | 1 + .../src/__tests__/numberEquals.test.ts | 4 +- .../__tests__/optionalFunctionValue.test.ts | 8 +- packages/vest-utils/src/__tests__/seq.test.ts | 1 + .../vest-utils/src/__tests__/text.test.ts | 5 +- .../src/__tests__/tinyState.test.ts | 1 + packages/vest-utils/src/cache.ts | 4 +- packages/vest-utils/src/defaultTo.ts | 2 +- .../exports/__tests__/minifyObject.test.ts | 1 + packages/vest-utils/src/greaterThan.ts | 2 +- packages/vest-utils/src/hasOwnProperty.ts | 2 +- packages/vest-utils/src/invariant.ts | 2 +- packages/vest-utils/src/isFunction.ts | 2 +- packages/vest-utils/src/lengthEquals.ts | 2 +- packages/vest-utils/src/longerThan.ts | 2 +- packages/vest-utils/src/mapFirst.ts | 4 +- packages/vest-utils/src/numberEquals.ts | 2 +- packages/vest-utils/src/tinyState.ts | 4 +- .../integration.async-tests.test.ts.snap | 4 +- .../integration.base.test.ts.snap | 4 +- .../integration.stateful-async.test.ts.snap | 8 +- .../integration.stateful-tests.test.ts.snap | 16 +- .../__tests__/integration.async-tests.test.ts | 21 +- .../src/__tests__/integration.base.test.ts | 6 +- .../__tests__/integration.exclusive.test.ts | 2 + .../integration.stateful-async.test.ts | 33 +- .../integration.stateful-tests.test.ts | 9 +- packages/vest/src/__tests__/isolate.test.ts | 47 +- .../vest/src/__tests__/state_refill.test.ts | 2 + .../__snapshots__/runtime.test.ts.snap | 6 +- .../vest/src/core/__tests__/runtime.test.ts | 2 + .../vest/src/core/context/SuiteContext.ts | 2 +- .../core/isolate/IsolateEach/IsolateEach.ts | 2 +- .../core/isolate/IsolateTest/IsolateTest.ts | 12 +- .../src/core/isolate/IsolateTest/VestTest.ts | 10 +- .../__tests__/VestTestInspector.test.ts | 1 + .../__tests__/hasRemainingTests.test.ts | 3 +- .../cancelOverriddenPendingTest.ts | 2 +- .../core/test/__tests__/IsolateTest.test.ts | 15 +- .../__snapshots__/IsolateTest.test.ts.snap | 10 +- .../__tests__/__snapshots__/memo.test.ts.snap | 6 +- .../__tests__/__snapshots__/test.test.ts.snap | 10 +- .../vest/src/core/test/__tests__/key.test.ts | 40 +- .../vest/src/core/test/__tests__/memo.test.ts | 31 +- .../merging_of_previous_test_runs.test.ts | 35 +- .../core/test/__tests__/runAsyncTest.test.ts | 25 +- .../vest/src/core/test/__tests__/test.test.ts | 11 +- .../__tests__/testFunctionPayload.test.ts | 20 +- .../nonMatchingSeverityProfile.test.ts | 12 +- .../core/test/helpers/matchingGroupName.ts | 2 +- .../helpers/nonMatchingSeverityProfile.ts | 2 +- .../test/helpers/shouldUseErrorMessage.ts | 2 +- packages/vest/src/core/test/test.memo.ts | 4 +- packages/vest/src/core/test/test.ts | 10 +- .../exports/__tests__/SuiteSerializer.test.ts | 2 + .../SuiteSerializer.test.ts.snap | 6 +- .../src/exports/__tests__/classnames.test.ts | 32 +- .../src/exports/__tests__/debounce.test.ts | 21 +- .../vest/src/exports/__tests__/parser.test.ts | 124 +- .../src/exports/__tests__/promisify.test.ts | 17 +- packages/vest/src/exports/classnames.ts | 2 +- packages/vest/src/exports/debounce.ts | 2 +- packages/vest/src/exports/parser.ts | 2 +- packages/vest/src/exports/promisify.ts | 2 +- .../__snapshots__/include.test.ts.snap | 36 +- .../vest/src/hooks/__tests__/include.test.ts | 20 +- .../vest/src/hooks/__tests__/mode.test.ts | 1 + .../vest/src/hooks/__tests__/warn.test.ts | 5 +- .../__snapshots__/focused.test.ts.snap | 6 +- .../hooks/focused/__tests__/focused.test.ts | 1 + packages/vest/src/hooks/focused/focused.ts | 6 +- .../src/hooks/focused/useHasOnliedTests.ts | 4 +- packages/vest/src/hooks/include.ts | 6 +- .../hooks/optional/__tests__/optional.test.ts | 15 +- .../src/hooks/optional/omitOptionalFields.ts | 2 +- packages/vest/src/hooks/optional/optional.ts | 2 +- .../__tests__/__snapshots__/each.test.ts.snap | 4 +- .../__snapshots__/group.test.ts.snap | 28 +- .../__snapshots__/omitWhen.test.ts.snap | 22 +- .../__snapshots__/skipWhen.test.ts.snap | 8 +- .../vest/src/isolates/__tests__/each.test.ts | 34 +- .../vest/src/isolates/__tests__/group.test.ts | 76 +- .../src/isolates/__tests__/omitWhen.test.ts | 23 +- .../src/isolates/__tests__/skipWhen.test.ts | 9 +- packages/vest/src/isolates/each.ts | 4 +- packages/vest/src/isolates/group.ts | 11 +- packages/vest/src/isolates/omitWhen.ts | 6 +- packages/vest/src/isolates/skipWhen.ts | 6 +- .../__snapshots__/create.test.ts.snap | 8 +- .../__snapshots__/staticSuite.test.ts.snap | 4 +- .../vest/src/suite/__tests__/create.test.ts | 23 +- .../vest/src/suite/__tests__/remove.test.ts | 1 + .../src/suite/__tests__/resetField.test.ts | 2 + .../src/suite/__tests__/staticSuite.test.ts | 5 +- .../src/suite/__tests__/subscribe.test.ts | 7 +- .../__tests__/suiteSelectorsOnSuite.test.ts | 18 +- .../src/suite/__tests__/typedSuite.test.ts | 2 + packages/vest/src/suite/getTypedMethods.ts | 4 +- .../validateParams/validateSuiteParams.ts | 6 +- .../vest/src/suiteResult/SummaryFailure.ts | 4 +- .../useProduceSuiteSummary.test.ts.snap | 6 +- .../__tests__/useProduceSuiteSummary.test.ts | 3 +- .../suiteResult/done/__tests__/done.test.ts | 37 +- .../src/suiteResult/done/deferDoneCallback.ts | 4 +- .../done/shouldSkipDoneRegistration.ts | 4 +- .../collectFailureMessages.test.ts.snap | 34 +- .../__tests__/collectFailureMessages.test.ts | 1 + .../selectors/__tests__/getFailure.test.ts | 2 + .../selectors/__tests__/getFailures.test.ts | 4 +- .../__tests__/getFailuresByGroup.test.ts | 11 +- .../selectors/__tests__/hasFailures.test.ts | 1 + .../__tests__/hasFailuresByGroup.test.ts | 7 +- .../__tests__/hasFailuresByTestObject.test.ts | 2 +- .../selectors/__tests__/isPending.test.ts | 1 + .../selectors/__tests__/isTested.test.ts | 1 + .../selectors/__tests__/isValid.test.ts | 19 +- .../__tests__/isValidByGroup.test.ts | 33 +- .../__tests__/summaryFailures.test.ts | 1 + .../suiteResult/selectors/collectFailures.ts | 6 +- .../src/testUtils/__tests__/partition.test.ts | 2 + packages/vest/src/testUtils/mockThrowError.ts | 16 - packages/vest/src/testUtils/partition.ts | 4 +- packages/vest/src/testUtils/suiteDummy.ts | 12 +- packages/vest/src/testUtils/testDummy.ts | 52 +- packages/vest/src/testUtils/vestMocks.ts | 4 +- packages/vest/tsconfig.json | 1 - .../src/Isolate/IsolateInspector.ts | 4 +- .../src/Isolate/IsolateSelectors.ts | 6 +- .../src/Isolate/__tests__/Isolate.test.ts | 7 +- .../__tests__/IsolateInspector.test.ts | 2 + .../Isolate/__tests__/IsolateMutator.test.ts | 5 +- .../__snapshots__/asyncIsolate.test.ts.snap | 4 +- .../Isolate/__tests__/asyncIsolate.test.ts | 17 +- packages/vestjs-runtime/src/VestRuntime.ts | 2 +- .../src/__tests__/IsolateWalker.test.ts | 2 +- .../__tests__/IsolateSerializer.test.ts | 8 +- .../IsolateSerializer.test.ts.snap | 6 +- tsconfig.json | 2 +- vitest.config.ts | 17 + vitest.workspace.js | 1 + vx/cli.js | 6 +- vx/commands/dev/dev.js | 4 +- vx/commands/init/prompt/index.js | 11 +- vx/commands/init/template/tsconfig.json | 46 - vx/commands/init/template/tsconfig.json.tmpl | 11 + vx/commands/prepare/prepare.js | 3 + vx/commands/test/test.js | 9 +- vx/config/jest/globals.d.ts | 8 - vx/config/jest/jest.config.js | 89 - vx/config/jest/jest.setup.ts | 6 - vx/config/rollup/format.js | 2 +- vx/config/rollup/getPlugins.js | 4 +- vx/config/rollup/plugins/addCJSPackageJson.js | 2 +- .../rollup/plugins/addModulePackageJson.js | 2 +- vx/config/rollup/plugins/handleExports.js | 16 +- vx/config/rollup/rollup.config.cjs | 18 +- .../customMatchers.ts} | 22 +- vx/config/vitest/vitest.d.ts | 12 + vx/exec.js | 2 +- vx/opts.js | 6 +- vx/package.json | 4 +- vx/packageExports.js | 2 +- vx/packageNames.js | 2 +- vx/scripts/build/buildPackage.js | 2 +- vx/scripts/genTsConfig.js | 20 +- vx/scripts/genVitestConfig.js | 117 + vx/scripts/release/depsTree.js | 4 +- vx/scripts/release/genDiffData.js | 4 +- .../release/github/commitIgnorePattern.js | 2 +- vx/scripts/release/packagesToRelease.js | 10 +- .../release/steps/commitChangesToGit.js | 6 +- vx/scripts/release/steps/publishPackage.js | 4 +- vx/scripts/release/steps/setNextVersion.js | 6 +- .../release/steps/updateLocalDepsToLatest.js | 4 +- vx/util/pathsPerPackage.js | 24 +- vx/util/rootPackageJson.js | 2 +- vx/util/runOnActivePackages.js | 2 +- vx/util/taggedBranch.js | 2 +- vx/vxPath.js | 23 +- .../builtin-enforce-plugins/compound_rules.md | 2 +- .../builtin-enforce-plugins/schema_rules.md | 2 +- .../docs/enforce/composing_enforce_rules.md | 10 +- .../advanced_test_features/dynamic_tests.md | 2 +- .../advanced_test_features/grouping_tests.md | 6 +- .../advanced_test_features/test.memo.md | 2 +- website/docs/writing_tests/warn_only_tests.md | 4 +- .../including_and_excluding/omitWhen.md | 5 +- .../including_and_excluding/skipWhen.md | 2 +- .../writing_your_suite/optional_fields.md | 4 +- website/docusaurus.config.js | 6 +- .../builtin-enforce-plugins/compound_rules.md | 2 +- .../builtin-enforce-plugins/schema_rules.md | 2 +- .../enforce/composing_enforce_rules.md | 10 +- .../version-4.x/upgrade_guide.md | 6 +- .../advanced_test_features/dynamic_tests.md | 2 +- .../advanced_test_features/grouping_tests.md | 8 +- .../advanced_test_features/test.memo.md | 2 +- .../writing_tests/warn_only_tests.md | 4 +- .../including_and_excluding/omitWhen.md | 2 +- .../including_and_excluding/skipWhen.md | 2 +- .../skip_and_only_group.md | 2 +- .../writing_your_suite/optional_fields.md | 4 +- .../writing_your_suite/result_object.md | 4 +- yarn.lock | 2132 +++++++---------- 312 files changed, 2379 insertions(+), 2680 deletions(-) delete mode 100644 packages/vest/src/testUtils/mockThrowError.ts create mode 100644 vitest.config.ts create mode 100644 vitest.workspace.js delete mode 100644 vx/commands/init/template/tsconfig.json create mode 100644 vx/commands/init/template/tsconfig.json.tmpl delete mode 100644 vx/config/jest/globals.d.ts delete mode 100644 vx/config/jest/jest.config.js delete mode 100644 vx/config/jest/jest.setup.ts rename vx/config/{jest/jest.setupAfterEnv.ts => vitest/customMatchers.ts} (91%) create mode 100644 vx/config/vitest/vitest.d.ts create mode 100644 vx/scripts/genVitestConfig.js diff --git a/.eslintrc.js b/.eslintrc.js index 5e966ce44..c786e5384 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,13 +1,12 @@ +const vitest = require('eslint-plugin-vitest'); + module.exports = { env: { es6: true, - jest: true, node: true, }, extends: [ 'eslint:recommended', - 'plugin:jest/recommended', - 'plugin:jest/style', 'plugin:import/errors', 'plugin:import/warnings', 'prettier', @@ -16,6 +15,11 @@ module.exports = { __DEV__: true, __LIB_VERSION__: true, ENV_DEVELOPMENT: true, + afterEach: true, + beforeEach: true, + describe: true, + expect: true, + vi: true, }, ignorePatterns: ['*.d.ts', '/website/'], overrides: [ @@ -58,9 +62,6 @@ module.exports = { { excludedFiles: ['./**/__tests__/**/*.*'], files: ['*.ts'], - rules: { - 'jest/no-export': 0, - }, }, { files: ['./**/vest/src/**/*.*'], @@ -69,9 +70,21 @@ module.exports = { 'vest-internal/use-use': 2, }, }, + { + files: ['./**/__tests__/**/*.*'], + rules: { + ...vitest.configs.recommended.rules, + 'vitest/expect-expect': [ + 'error', + { + assertFunctionNames: ['expect', 'assert', 'enforce'], + }, + ], + }, + }, ], parser: '@typescript-eslint/parser', - plugins: ['jest', 'vest-internal'], + plugins: ['vitest', 'vest-internal'], rules: { complexity: [2, { max: 5 }], 'import/extensions': [0, 'ignorePackages'], @@ -100,9 +113,9 @@ module.exports = { ], }, ], - 'jest/expect-expect': 0, - 'jest/no-identical-title': 0, - 'jest/no-standalone-expect': 0, + 'vitest/expect-expect': 0, + 'vitest/no-identical-title': 0, + 'vitest/no-standalone-expect': 0, 'max-params': [1, { max: 4 }], 'no-console': 2, 'no-else-return': 1, diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 04723ab29..37a00ee6e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,8 +6,8 @@ CONTRIBUTING.md Please fill the following form (leave what's relevant) --> -| Q | A | -| ---------------- | --- | +| Q | A | +| ---------------- | ----- | | Bug fix? | ✔/✖ | | New feature? | ✔/✖ | | Breaking change? | ✔/✖ | @@ -15,6 +15,6 @@ Please fill the following form (leave what's relevant) | Documentation? | ✔/✖ | | Tests added? | ✔/✖ | | Types added? | ✔/✖ | -| Related issues | | +| Related issues | | diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 724eb2d93..8ce9f4638 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,6 +36,8 @@ jobs: run: yarn build - name: Test run: yarn test + - name: Format + run: yarn format - name: Lint run: yarn lint - name: Release diff --git a/.prettierignore b/.prettierignore index 04c01ba7b..14b59e1d8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +.yarn/ diff --git a/.yarnrc.yml b/.yarnrc.yml index 223104e17..f7d4bcced 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -4,6 +4,6 @@ nodeLinker: node-modules plugins: - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs - spec: "@yarnpkg/plugin-interactive-tools" + spec: '@yarnpkg/plugin-interactive-tools' yarnPath: .yarn/releases/yarn-3.5.1.cjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab8647fc9..8d81a4b2c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ The naming convention for a test file is `moduleName.test.ts`. #### Running tests -To run tests, you need to run `vx test`. This will run all tests in all packages. The tests are being run by jest. +To run tests, you need to run `vx test`. This will run all tests in all packages. The tests are being run by vitest. You can narrow it down by specifying the package name: diff --git a/package.json b/package.json index fc6f355b3..73f05e9b3 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "build": "vx build", "test": "vx test", "release": "vx release", + "format": "prettier -c .", "lint": "eslint . --ignore-path .gitignore", "prepare": "husky install", "dev": "vx dev", @@ -34,6 +35,7 @@ "eslint-plugin-jest": "^27.9.0", "husky": "^8.0.3", "lodash": "^4.17.21", + "prettier": "^3.3.1", "pretty-quick": "^3.3.1", "tsc": "^2.0.4", "tslib": "^2.6.3", diff --git a/packages/anyone/README.md b/packages/anyone/README.md index ea09fde2d..700455667 100644 --- a/packages/anyone/README.md +++ b/packages/anyone/README.md @@ -31,7 +31,7 @@ if (one(var1, var2, var3)) { all( validateInput1, // returns true validateInput2, // returns false - validateInput3 // no need to run this, we already know our validation failed + validateInput3, // no need to run this, we already know our validation failed ); ``` @@ -60,7 +60,7 @@ import all from 'anyone/all'; any( someFunction, // evaluates to false 1, - someVar // truthy + someVar, // truthy ); // true @@ -69,7 +69,7 @@ any( any( someFunction, // evaluates to false 0, - someVar // falsy + someVar, // falsy ); // false @@ -78,7 +78,7 @@ any( one( someFunction, // evaluates to false 0, - someVar // truthy + someVar, // truthy ); // true @@ -87,7 +87,7 @@ one( none( someFunction, // evaluates to false 1, - someVar // truthy + someVar, // truthy ); // false @@ -96,7 +96,7 @@ none( none( someFunction, // evaluates to false 0, - someVar // falsy + someVar, // falsy ); // true @@ -105,7 +105,7 @@ none( all( someFunction, // evaluates to false 0, - someVar // truthy + someVar, // truthy ); // false @@ -114,7 +114,7 @@ all( all( someFunction, // evaluates to true 1, - someVar // truthy + someVar, // truthy ); // true ``` diff --git a/packages/anyone/src/__tests__/all.test.ts b/packages/anyone/src/__tests__/all.test.ts index b8ff286fd..b89981a09 100644 --- a/packages/anyone/src/__tests__/all.test.ts +++ b/packages/anyone/src/__tests__/all.test.ts @@ -1,4 +1,5 @@ import { sample, random } from 'lodash'; +import { describe, it, expect } from 'vitest'; import { TRUTHY_VALUES, FALSY_VALUES } from './anyoneTestValues'; @@ -10,9 +11,9 @@ describe('methods/all', () => { expect( all( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) - ) - ) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), + ), + ), ).toBe(false); }); }); @@ -22,9 +23,9 @@ describe('methods/all', () => { expect( all( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) - ) - ) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), + ), + ), ).toBe(true); }); }); @@ -34,12 +35,12 @@ describe('methods/all', () => { expect( all.apply(null, [ ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), ), - ]) + ]), ).toBe(false); }); }); diff --git a/packages/anyone/src/__tests__/any.test.ts b/packages/anyone/src/__tests__/any.test.ts index 2a3de7fc2..590e86e96 100644 --- a/packages/anyone/src/__tests__/any.test.ts +++ b/packages/anyone/src/__tests__/any.test.ts @@ -1,4 +1,5 @@ import { sample, random } from 'lodash'; +import { describe, it, expect } from 'vitest'; import { TRUTHY_VALUES, FALSY_VALUES } from './anyoneTestValues'; @@ -10,9 +11,9 @@ describe('methods/any', () => { expect( any( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) - ) - ) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), + ), + ), ).toBe(false); }); }); @@ -22,9 +23,9 @@ describe('methods/any', () => { expect( any( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) - ) - ) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), + ), + ), ).toBe(true); }); }); @@ -34,10 +35,10 @@ describe('methods/any', () => { expect( any.apply(null, [ ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), sample(TRUTHY_VALUES), - ]) + ]), ).toBe(true); }); }); @@ -47,12 +48,12 @@ describe('methods/any', () => { expect( any.apply(null, [ ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), ), - ]) + ]), ).toBe(true); }); }); diff --git a/packages/anyone/src/__tests__/none.test.ts b/packages/anyone/src/__tests__/none.test.ts index 86aad6105..3ffd88288 100644 --- a/packages/anyone/src/__tests__/none.test.ts +++ b/packages/anyone/src/__tests__/none.test.ts @@ -1,4 +1,5 @@ import { sample, random } from 'lodash'; +import { describe, it, expect } from 'vitest'; import { TRUTHY_VALUES, FALSY_VALUES } from './anyoneTestValues'; @@ -10,9 +11,9 @@ describe('methods/none', () => { expect( none( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) - ) - ) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), + ), + ), ).toBe(true); }); }); @@ -22,9 +23,9 @@ describe('methods/none', () => { expect( none( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) - ) - ) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), + ), + ), ).toBe(false); }); }); @@ -34,10 +35,10 @@ describe('methods/none', () => { expect( none.apply(null, [ ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), sample(TRUTHY_VALUES), - ]) + ]), ).toBe(false); }); }); @@ -47,12 +48,12 @@ describe('methods/none', () => { expect( none.apply(null, [ ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), ), - ]) + ]), ).toBe(false); }); }); diff --git a/packages/anyone/src/__tests__/one.test.ts b/packages/anyone/src/__tests__/one.test.ts index a8367619c..f5a1c5216 100644 --- a/packages/anyone/src/__tests__/one.test.ts +++ b/packages/anyone/src/__tests__/one.test.ts @@ -1,4 +1,5 @@ import { sample, random } from 'lodash'; +import { describe, it, expect } from 'vitest'; import { TRUTHY_VALUES, FALSY_VALUES } from './anyoneTestValues'; @@ -10,9 +11,9 @@ describe('methods/one', () => { expect( one( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) - ) - ) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), + ), + ), ).toBe(false); }); }); @@ -22,9 +23,9 @@ describe('methods/one', () => { expect( one( ...Array.from({ length: random(2, 10) }, (_, i) => - i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES) - ) - ) + i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES), + ), + ), ).toBe(false); }); }); @@ -34,10 +35,10 @@ describe('methods/one', () => { expect( one( ...Array.from({ length: random(1, 10) }, (_, i) => - i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES) + i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES), ), - sample(TRUTHY_VALUES) - ) + sample(TRUTHY_VALUES), + ), ).toBe(true); }); }); @@ -47,8 +48,8 @@ describe('methods/one', () => { expect( one( ...Array.from({ length: random(2, 10) }, () => sample(TRUTHY_VALUES)), - ...Array.from({ length: random(1, 10) }, () => sample(FALSY_VALUES)) - ) + ...Array.from({ length: random(1, 10) }, () => sample(FALSY_VALUES)), + ), ).toBe(false); }); }); diff --git a/packages/anyone/src/__tests__/runAnyoneMethods.test.ts b/packages/anyone/src/__tests__/runAnyoneMethods.test.ts index c255744b7..259860de9 100644 --- a/packages/anyone/src/__tests__/runAnyoneMethods.test.ts +++ b/packages/anyone/src/__tests__/runAnyoneMethods.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { FALSY_VALUES, TRUTHY_VALUES } from './anyoneTestValues'; import run from 'runAnyoneMethods'; @@ -5,26 +7,26 @@ import run from 'runAnyoneMethods'; describe('lib/run', () => { describe('When value is falsy', () => { it.each([FALSY_VALUES])('Should return `false` ("%s")', value => - expect(run(value)).toBe(false) + expect(run(value)).toBe(false), ); }); describe('When value is truthy', () => { it.each([TRUTHY_VALUES])('Should return `true` ("%s")', value => - expect(run(value)).toBe(true) + expect(run(value)).toBe(true), ); }); describe('When value is a function', () => { describe('When value is falsy', () => { it.each([FALSY_VALUES])('Should return `false` ("%s")', value => - expect(run(() => value)).toBe(false) + expect(run(() => value)).toBe(false), ); }); describe('When value is truthy', () => { it.each([TRUTHY_VALUES])('Should return `true` ("%s")', value => - expect(run(() => value)).toBe(true) + expect(run(() => value)).toBe(true), ); }); }); @@ -34,7 +36,7 @@ describe('lib/run', () => { expect( run(() => { throw new Error(); - }) + }), ).toBe(false); }); }); diff --git a/packages/context/README.md b/packages/context/README.md index 0c61f2ba4..b5b9f59f7 100644 --- a/packages/context/README.md +++ b/packages/context/README.md @@ -146,7 +146,7 @@ import ctx from './ctx'; function handleCart() { const context = ctx.useX( - 'handleCart was called outside of a running context' + 'handleCart was called outside of a running context', ); // { cart: { items: [ 'foo', 'bar' ] } } // This throws an error if we're not within a `run` call. // You should catch this error and handle it somewhere above this function. diff --git a/packages/context/src/__tests__/__snapshots__/cascade.test.ts.snap b/packages/context/src/__tests__/__snapshots__/cascade.test.ts.snap index e8e84c468..2116e67f9 100644 --- a/packages/context/src/__tests__/__snapshots__/cascade.test.ts.snap +++ b/packages/context/src/__tests__/__snapshots__/cascade.test.ts.snap @@ -1,19 +1,19 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Cascading Context context.run Should clear context after callback run 1`] = ` +exports[`Cascading Context > context.run > Should clear context after callback run 1`] = ` { "a": 1, } `; -exports[`Cascading Context context.run Should clear context after callback run 2`] = ` +exports[`Cascading Context > context.run > Should clear context after callback run 2`] = ` { "a": 1, "b": 2, } `; -exports[`Cascading Context createCascade Should return all methods 1`] = ` +exports[`Cascading Context > createCascade > Should return all methods 1`] = ` { "bind": [Function], "run": [Function], diff --git a/packages/context/src/__tests__/cascade.test.ts b/packages/context/src/__tests__/cascade.test.ts index bbf756e40..376cf5511 100644 --- a/packages/context/src/__tests__/cascade.test.ts +++ b/packages/context/src/__tests__/cascade.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, beforeEach, vi } from 'vitest'; + import { createCascade, CtxCascadeApi } from 'context'; describe('Cascading Context', () => { @@ -40,7 +42,7 @@ describe('Cascading Context', () => { () => { expect(ctx.use().id).toBe(55); expect(ctx.use().user).toBe('boomsa'); - } + }, ); }); @@ -52,7 +54,7 @@ describe('Cascading Context', () => { () => { expect(ctx.use().id).toBe(55); expect(ctx.use().user).toBeUndefined(); - } + }, ); }); @@ -93,9 +95,9 @@ describe('Cascading Context', () => { expect(ctx.use().name).toBe('Emanuelle'); expect(ctx.use().color).toBe('blue'); }); - } + }, ); - } + }, ); }); @@ -123,7 +125,7 @@ describe('Cascading Context', () => { "name": "Emanuelle", } `); - } + }, ); expect(ctx.use().id).toBe(99); expect(ctx.use().name).toBe('watermelonbunny'); @@ -133,7 +135,7 @@ describe('Cascading Context', () => { "name": "watermelonbunny", } `); - } + }, ); }); }); @@ -141,7 +143,7 @@ describe('Cascading Context', () => { describe('context.bind', () => { it('Returns a function', () => { - expect(typeof ctx.bind({}, jest.fn())).toBe('function'); + expect(typeof ctx.bind({}, vi.fn())).toBe('function'); }); it('Wraps the function with context', () => { @@ -160,7 +162,7 @@ describe('Cascading Context', () => { }); it('Passes runtime arguments to bound function', () => { - const fn = jest.fn(); + const fn = vi.fn(); const args = Array.from({ length: 100 }, (_, i) => `${i}`); // 1-100 ctx.bind({}, fn)(...args); @@ -244,7 +246,7 @@ describe('Cascading Context', () => { it('Should allow a custom context message', () => { expect(() => ctx.useX('Custom Failure Message')).toThrow( - 'Custom Failure Message' + 'Custom Failure Message', ); }); }); @@ -260,7 +262,7 @@ describe('Cascading Context', () => { it('Should allow a custom context message', () => { expect(() => ctx.useX('Custom Failure Message')).toThrow( - 'Custom Failure Message' + 'Custom Failure Message', ); }); }); @@ -269,7 +271,7 @@ describe('Cascading Context', () => { describe('init argument', () => { it('Should run init function on every context.run', () => { - const init = jest.fn(); + const init = vi.fn(); const ctx = createCascade(init); @@ -293,7 +295,7 @@ describe('Cascading Context', () => { }); it('Should accept ctxRef as first argument', () => { - const init = jest.fn(); + const init = vi.fn(); const ctx = createCascade(init); const ref1 = { a: 1, b: 2 }; @@ -307,7 +309,7 @@ describe('Cascading Context', () => { }); it('Should accept parentContext as second argument', () => { - const init = jest.fn(); + const init = vi.fn(); const ctx = createCascade(init); let p1; diff --git a/packages/context/src/__tests__/context.test.ts b/packages/context/src/__tests__/context.test.ts index b0bb0d957..52b428711 100644 --- a/packages/context/src/__tests__/context.test.ts +++ b/packages/context/src/__tests__/context.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, beforeEach } from 'vitest'; + import { createContext, CtxApi } from 'context'; describe('Context', () => { diff --git a/packages/context/src/context.ts b/packages/context/src/context.ts index a51d841e2..973157258 100644 --- a/packages/context/src/context.ts +++ b/packages/context/src/context.ts @@ -29,7 +29,7 @@ export function createContext(defaultContextValue?: T): CtxApi { function useX(errorMessage?: string): T { invariant( isInsideContext(), - defaultTo(errorMessage, USEX_DEFAULT_ERROR_MESSAGE) + defaultTo(errorMessage, USEX_DEFAULT_ERROR_MESSAGE), ); return contextValue as T; } @@ -55,7 +55,7 @@ export function createContext(defaultContextValue?: T): CtxApi { * When nesting context runs, the the values of the current layer merges with the layers above it. */ export function createCascade>( - init?: (value: Partial, parentContext: Maybe) => Nullable + init?: (value: Partial, parentContext: Maybe) => Nullable, ): CtxCascadeApi { const ctx = createContext(); @@ -72,7 +72,7 @@ export function createCascade>( const out = assign( {}, parentContext ? parentContext : {}, - optionalFunctionValue(init, value, parentContext) ?? value + optionalFunctionValue(init, value, parentContext) ?? value, ) as T; return ctx.run(Object.freeze(out), fn) as R; diff --git a/packages/n4s/src/__tests__/enforce.test.ts b/packages/n4s/src/__tests__/enforce.test.ts index bf2877501..c4941e299 100644 --- a/packages/n4s/src/__tests__/enforce.test.ts +++ b/packages/n4s/src/__tests__/enforce.test.ts @@ -1,21 +1,10 @@ -import { TEnforceMock } from '../../testUtils/TEnforceMock'; +import { describe, it, expect, beforeEach } from 'vitest'; -import * as ruleReturn from 'ruleReturn'; +import { enforce } from 'enforce'; -const _proxy = global.Proxy; -let enforce: TEnforceMock; +import * as ruleReturn from 'ruleReturn'; describe(`enforce`, () => { - beforeEach(() => { - jest.resetModules(); - enforce = require('enforce').enforce as TEnforceMock; - }); - - afterEach(() => { - jest.resetModules(); - global.Proxy = _proxy; - }); - describe('eager assertions', () => { it('Should throw an error when invalid', () => { expect(() => enforce('4').isNumber()).toThrow(); @@ -45,10 +34,10 @@ describe(`enforce`, () => { it('should throw message string when rule fails', () => { expect(() => enforce(':(').startsWithUnderscore()).toThrow( - ':( does not start with underscore' + ':( does not start with underscore', ); expect(() => - enforce(':(').isString().startsWithUnderscore().isNumber() + enforce(':(').isString().startsWithUnderscore().isNumber(), ).toThrow(':( does not start with underscore'); }); }); @@ -76,7 +65,7 @@ describe(`enforce`, () => { expect(enforce.isArray().run([])).toEqual(ruleReturn.passing()); expect(enforce.greaterThan(5).run(6)).toEqual(ruleReturn.passing()); expect(enforce.greaterThan(5).lessThan(7).run(6)).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); }); @@ -85,7 +74,7 @@ describe(`enforce`, () => { expect(enforce.isArray().run({})).toEqual(ruleReturn.failing()); expect(enforce.greaterThan(6).run(5)).toEqual(ruleReturn.failing()); expect(enforce.greaterThan(7).lessThan(5).run(6)).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); }); }); @@ -105,14 +94,14 @@ describe(`enforce`, () => { it('Should return true when valid', () => { expect(enforce.isEmail().test('example@gmail.com')).toBe(true); expect(enforce.isEmail().isString().test('example@gmail.com')).toBe( - true + true, ); }); it('Should return false when invalid', () => { expect(enforce.isEmail().test('example!gmail.com')).toBe(false); expect(enforce.isEmail().isString().test('example!gmail.com')).toBe( - false + false, ); }); }); diff --git a/packages/n4s/src/__tests__/enforceEager.test.ts b/packages/n4s/src/__tests__/enforceEager.test.ts index dcbb3feb6..9f0970f3d 100644 --- a/packages/n4s/src/__tests__/enforceEager.test.ts +++ b/packages/n4s/src/__tests__/enforceEager.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, afterEach } from 'vitest'; + import enforceEager from 'enforceEager'; describe(`enforce eager`, () => { diff --git a/packages/n4s/src/exports/__tests__/compose.test.ts b/packages/n4s/src/exports/__tests__/compose.test.ts index 5abe6d821..8d4cc25dd 100644 --- a/packages/n4s/src/exports/__tests__/compose.test.ts +++ b/packages/n4s/src/exports/__tests__/compose.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import compose from 'compose'; import { enforce } from 'n4s'; import * as ruleReturn from 'ruleReturn'; @@ -19,17 +21,17 @@ describe('compose', () => { enforce.isNumeric(), enforce.isString(), enforce.greaterThan(3), - enforce.lessThan(5) + enforce.lessThan(5), ); expect(NumericStringBetweenThreeAndFive.run('4')).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); expect(NumericStringBetweenThreeAndFive.run('3')).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); expect(NumericStringBetweenThreeAndFive.run(5)).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); expect(NumericStringBetweenThreeAndFive.test('4')).toBe(true); expect(NumericStringBetweenThreeAndFive.test('3')).toBe(false); @@ -42,7 +44,7 @@ describe('compose', () => { first: enforce.isString().isNotEmpty(), last: enforce.isString().isNotEmpty(), middle: enforce.optional(enforce.isString().isNotEmpty()), - }) + }), ); expect( @@ -55,7 +57,7 @@ describe('compose', () => { first: 'John', last: 'Doe', }, - }) + }), ).toEqual(ruleReturn.passing()); expect( @@ -69,7 +71,7 @@ describe('compose', () => { last: 'Doe', middle: '', }, - }) + }), ).toEqual(ruleReturn.failing()); }); it('Should allow composing compositions', () => { @@ -80,13 +82,13 @@ describe('compose', () => { last: enforce.isString().isNotEmpty(), middle: enforce.optional(enforce.isString().isNotEmpty()), }), - }) + }), ); const Entity = compose( enforce.loose({ id: enforce.isNumeric(), - }) + }), ); const User = compose(Name, Entity); @@ -99,7 +101,7 @@ describe('compose', () => { middle: 'M', last: 'Doe', }, - }) + }), ).toEqual(ruleReturn.passing()); User({ id: '1', @@ -117,7 +119,7 @@ describe('compose', () => { name: { first: 'John', }, - }) + }), ).toEqual(ruleReturn.failing()); expect(() => @@ -126,7 +128,7 @@ describe('compose', () => { first: 'John', }, id: '__', - }) + }), ).toThrow(); }); }); diff --git a/packages/n4s/src/exports/__tests__/date.test.ts b/packages/n4s/src/exports/__tests__/date.test.ts index 4c36f3252..fe0f637d3 100644 --- a/packages/n4s/src/exports/__tests__/date.test.ts +++ b/packages/n4s/src/exports/__tests__/date.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'n4s'; import 'date'; @@ -42,34 +44,34 @@ describe('date', () => { */ it('Should pass for valid dates', () => { expect(() => - enforce('2002-07-15').isDate({ format: 'YYYY-MM-DD' }) + enforce('2002-07-15').isDate({ format: 'YYYY-MM-DD' }), ).not.toThrow(); expect(() => - enforce('2002/07/15').isDate({ format: 'YYYY/MM/DD' }) + enforce('2002/07/15').isDate({ format: 'YYYY/MM/DD' }), ).not.toThrow(); expect(() => - enforce('07/15/2002').isDate({ format: 'MM/DD/YYYY' }) + enforce('07/15/2002').isDate({ format: 'MM/DD/YYYY' }), ).not.toThrow(); expect(() => - enforce('07-15-2002').isDate({ format: 'MM-DD-YYYY' }) + enforce('07-15-2002').isDate({ format: 'MM-DD-YYYY' }), ).not.toThrow(); expect(() => - enforce('15/07/2002').isDate({ format: 'DD/MM/YYYY' }) + enforce('15/07/2002').isDate({ format: 'DD/MM/YYYY' }), ).not.toThrow(); expect(() => - enforce('15-07-2002').isDate({ format: 'DD-MM-YYYY' }) + enforce('15-07-2002').isDate({ format: 'DD-MM-YYYY' }), ).not.toThrow(); expect(() => - enforce('02-07-15').isDate({ format: 'YY-MM-DD' }) + enforce('02-07-15').isDate({ format: 'YY-MM-DD' }), ).not.toThrow(); expect(() => - enforce('02/07/15').isDate({ format: 'YY/MM/DD' }) + enforce('02/07/15').isDate({ format: 'YY/MM/DD' }), ).not.toThrow(); expect(() => - enforce('07/15/02').isDate({ format: 'MM/DD/YY' }) + enforce('07/15/02').isDate({ format: 'MM/DD/YY' }), ).not.toThrow(); expect(() => - enforce('07-15-02').isDate({ format: 'MM-DD-YY' }) + enforce('07-15-02').isDate({ format: 'MM-DD-YY' }), ).not.toThrow(); }); @@ -77,7 +79,7 @@ describe('date', () => { expect(() => enforce('2002-07-15').isDate({ format: 'YYYY-MM-DDTHH:mm:ss.SSSZ', - }) + }), ).toThrow(); }); }); @@ -87,7 +89,7 @@ describe('date', () => { enforce('2002-07-15').isDate({ strictMode: true, format: 'YYYY-MM-DD', - }) + }), ).not.toThrow(); }); @@ -96,7 +98,7 @@ describe('date', () => { enforce('2002-07-15').isDate({ strictMode: true, format: 'YYYY/MM/DD', - }) + }), ).toThrow(); }); }); @@ -157,19 +159,19 @@ describe('date', () => { it('Should pass for valid ISO8601 dates', () => { expect(() => - enforce('2020-07-10 15:00:00.000').isISO8601() + enforce('2020-07-10 15:00:00.000').isISO8601(), ).not.toThrow(); expect(() => enforce('2020-07-10').isISO8601()).not.toThrow(); expect(() => - enforce('2020-07-10T15:00:00.000').isISO8601() + enforce('2020-07-10T15:00:00.000').isISO8601(), ).not.toThrow(); expect(() => enforce('2020-07-10T15:00:00Z').isISO8601()).not.toThrow(); expect(() => - enforce('2020-07-10T15:00:00+05:00').isISO8601() + enforce('2020-07-10T15:00:00+05:00').isISO8601(), ).not.toThrow(); }); @@ -182,23 +184,23 @@ describe('date', () => { describe('strict', () => { it('Should pass for valid ISO8601 dates', () => { expect(() => - enforce('2020-07-10 15:00:00.000').isISO8601({ strict: true }) + enforce('2020-07-10 15:00:00.000').isISO8601({ strict: true }), ).not.toThrow(); expect(() => - enforce('2020-07-10').isISO8601({ strict: true }) + enforce('2020-07-10').isISO8601({ strict: true }), ).not.toThrow(); expect(() => - enforce('2020-07-10T15:00:00.000').isISO8601({ strict: true }) + enforce('2020-07-10T15:00:00.000').isISO8601({ strict: true }), ).not.toThrow(); expect(() => - enforce('2020-07-10T15:00:00Z').isISO8601({ strict: true }) + enforce('2020-07-10T15:00:00Z').isISO8601({ strict: true }), ).not.toThrow(); expect(() => - enforce('2020-07-10T15:00:00+05:00').isISO8601({ strict: true }) + enforce('2020-07-10T15:00:00+05:00').isISO8601({ strict: true }), ).not.toThrow(); }); @@ -206,7 +208,7 @@ describe('date', () => { expect(() => enforce(0).isISO8601({ strict: true })).toThrow(); expect(() => enforce(new Date()).isISO8601({ strict: true })).toThrow(); expect(() => - enforce('2020/07/10T15:00:00.000Z').isISO8601({ strict: true }) + enforce('2020/07/10T15:00:00.000Z').isISO8601({ strict: true }), ).toThrow(); }); }); @@ -216,29 +218,29 @@ describe('date', () => { expect(() => enforce('2002-07-15T00:00:00.000Z').isISO8601({ strictSeparator: true, - }) + }), ).not.toThrow(); expect(() => - enforce('2020-07-10').isISO8601({ strictSeparator: true }) + enforce('2020-07-10').isISO8601({ strictSeparator: true }), ).not.toThrow(); expect(() => enforce('2020-07-10T15:00:00.000').isISO8601({ strictSeparator: true, - }) + }), ).not.toThrow(); expect(() => enforce('2020-07-10T15:00:00Z').isISO8601({ strictSeparator: true, - }) + }), ).not.toThrow(); expect(() => enforce('2020-07-10T15:00:00+05:00').isISO8601({ strictSeparator: true, - }) + }), ).not.toThrow(); }); @@ -246,7 +248,7 @@ describe('date', () => { expect(() => enforce('2020/07/10T15:00:00.000Z').isISO8601({ strictSeparator: true, - }) + }), ).toThrow(); }); }); diff --git a/packages/n4s/src/exports/__tests__/email.test.ts b/packages/n4s/src/exports/__tests__/email.test.ts index 3c4ff19dc..15426381e 100644 --- a/packages/n4s/src/exports/__tests__/email.test.ts +++ b/packages/n4s/src/exports/__tests__/email.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'n4s'; import 'email'; @@ -8,7 +10,7 @@ describe('isEmail', () => { expect(() => enforce('user@mail.example.com').isEmail()).not.toThrow(); expect(() => enforce('user+tag@mail.example.com').isEmail()).not.toThrow(); expect(() => - enforce('verylongemailaddress1234567890@mail.example.com').isEmail() + enforce('verylongemailaddress1234567890@mail.example.com').isEmail(), ).not.toThrow(); expect(() => enforce('user@example.co').isEmail()).not.toThrow(); expect(() => enforce('user@example.io').isEmail()).not.toThrow(); @@ -30,19 +32,19 @@ describe('isEmail', () => { expect(() => enforce('Display Name ').isEmail({ allow_display_name: true, - }) + }), ).not.toThrow(); expect(() => enforce('Display Name ').isEmail({ allow_display_name: true, require_display_name: true, - }) + }), ).not.toThrow(); expect(() => - enforce('user@192.168.0.1').isEmail({ allow_ip_domain: true }) + enforce('user@192.168.0.1').isEmail({ allow_ip_domain: true }), ).not.toThrow(); expect(() => - enforce('user@example').isEmail({ require_tld: false }) + enforce('user@example').isEmail({ require_tld: false }), ).not.toThrow(); }); @@ -51,10 +53,10 @@ describe('isEmail', () => { enforce('Display Name user@example.com').isEmail({ allow_display_name: true, require_display_name: true, - }) + }), ).toThrow(); expect(() => - enforce('user@192.168.0.1').isEmail({ allow_ip_domain: false }) + enforce('user@192.168.0.1').isEmail({ allow_ip_domain: false }), ).toThrow(); }); }); diff --git a/packages/n4s/src/exports/__tests__/isUrl.test.ts b/packages/n4s/src/exports/__tests__/isUrl.test.ts index 639f0af44..e48ef328e 100644 --- a/packages/n4s/src/exports/__tests__/isUrl.test.ts +++ b/packages/n4s/src/exports/__tests__/isUrl.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'n4s'; import 'isURL'; @@ -6,13 +8,23 @@ describe('isURL', () => { expect(() => enforce('http://www.google.com').isURL()).not.toThrow(); expect(() => enforce('https://google.com').isURL()).not.toThrow(); expect(() => enforce('google.com').isURL()).not.toThrow(); - expect(() => enforce('https://www.wikipedia.org/wiki/Main_Page').isURL()).not.toThrow(); + expect(() => + enforce('https://www.wikipedia.org/wiki/Main_Page').isURL(), + ).not.toThrow(); expect(() => enforce('ftp://myserver.net').isURL()).not.toThrow(); - expect(() => enforce('https://www.example.com/query?search=AI').isURL()).not.toThrow(); - expect(() => enforce('https://username:password@hostname.com:8080').isURL()).not.toThrow(); + expect(() => + enforce('https://www.example.com/query?search=AI').isURL(), + ).not.toThrow(); + expect(() => + enforce('https://username:password@hostname.com:8080').isURL(), + ).not.toThrow(); expect(() => enforce('http://233.233.233.233').isURL()).not.toThrow(); - expect(() => enforce('https://www.example.com/foo/?bar=baz&inga=42&quux').isURL()).not.toThrow(); - expect(() => enforce('http://www.example.com/index.html#section1').isURL()).not.toThrow(); + expect(() => + enforce('https://www.example.com/foo/?bar=baz&inga=42&quux').isURL(), + ).not.toThrow(); + expect(() => + enforce('http://www.example.com/index.html#section1').isURL(), + ).not.toThrow(); }); it('Should fail for invalid URLs', () => { @@ -28,24 +40,51 @@ describe('isURL', () => { expect(() => enforce('http://www.goo gle.com').isURL()).toThrow(); expect(() => enforce('://www.google.com').isURL()).toThrow(); expect(() => enforce('http://localhost').isURL()).toThrow(); - expect(() => enforce('www.com').isURL({ require_host: false })).not.toThrow(); - }) + expect(() => + enforce('www.com').isURL({ require_host: false }), + ).not.toThrow(); + }); describe('With options', () => { it('should pass for valid URLs', () => { - expect(() => enforce('myprotocol://customdomain.com').isURL({ protocols: ['myprotocol'] })).not.toThrow(); - expect(() => enforce('http://localhost:8080').isURL({ require_tld: false })).not.toThrow(); - expect(() => enforce('invalid://www.google.com').isURL({ require_valid_protocol: false })).not.toThrow(); - expect(() => enforce('http://my_server.com').isURL({ allow_underscores: true })).not.toThrow(); + expect(() => + enforce('myprotocol://customdomain.com').isURL({ + protocols: ['myprotocol'], + }), + ).not.toThrow(); + expect(() => + enforce('http://localhost:8080').isURL({ require_tld: false }), + ).not.toThrow(); + expect(() => + enforce('invalid://www.google.com').isURL({ + require_valid_protocol: false, + }), + ).not.toThrow(); + expect(() => + enforce('http://my_server.com').isURL({ allow_underscores: true }), + ).not.toThrow(); }); it('should fail for invalid URLs', () => { - expect(() => enforce('myprotocol://customdomain.com').isURL({ protocols: ['http'] })).toThrow(); - expect(() => enforce('http://localhost:8080').isURL({ require_tld: true })).toThrow(); - expect(() => enforce('invalid://www.google.com').isURL({ require_valid_protocol: true })).toThrow(); - expect(() => enforce('http://my_server.com').isURL({ allow_underscores: false })).toThrow(); - expect(() => enforce('http://www.example.com/index.html#section1').isURL({ allow_fragments: false })).toThrow(); + expect(() => + enforce('myprotocol://customdomain.com').isURL({ protocols: ['http'] }), + ).toThrow(); + expect(() => + enforce('http://localhost:8080').isURL({ require_tld: true }), + ).toThrow(); + expect(() => + enforce('invalid://www.google.com').isURL({ + require_valid_protocol: true, + }), + ).toThrow(); + expect(() => + enforce('http://my_server.com').isURL({ allow_underscores: false }), + ).toThrow(); + expect(() => + enforce('http://www.example.com/index.html#section1').isURL({ + allow_fragments: false, + }), + ).toThrow(); }); }); - -}); \ No newline at end of file +}); diff --git a/packages/n4s/src/exports/compose.ts b/packages/n4s/src/exports/compose.ts index b608080f5..44762f04a 100644 --- a/packages/n4s/src/exports/compose.ts +++ b/packages/n4s/src/exports/compose.ts @@ -19,7 +19,7 @@ export default function compose( { run, test: (value: any) => run(value).pass, - } + }, ); function run(value: any): RuleDetailedResult { @@ -29,7 +29,7 @@ export default function compose( composites, ( composite: LazyRuleRunners, - breakout: (conditional: boolean, res: RuleDetailedResult) => void + breakout: (conditional: boolean, res: RuleDetailedResult) => void, ) => { /* HACK: Just a small white lie. ~~HELP WANTED~~. The ideal is that instead of `LazyRuleRunners` We would simply use `Lazy` to begin with. @@ -40,8 +40,8 @@ export default function compose( const res = runLazyRule(composite, value); breakout(!res.pass, res); - } - ) + }, + ), ); }); } diff --git a/packages/n4s/src/exports/schema.ts b/packages/n4s/src/exports/schema.ts index 2a026d8a7..1f6d315c8 100644 --- a/packages/n4s/src/exports/schema.ts +++ b/packages/n4s/src/exports/schema.ts @@ -1,6 +1,5 @@ import { enforce } from 'n4s'; - import { EnforceCustomMatcher } from 'enforceUtilityTypes'; import { isArrayOf } from 'isArrayOf'; import { loose } from 'loose'; diff --git a/packages/n4s/src/lib/ruleReturn.ts b/packages/n4s/src/lib/ruleReturn.ts index fef7075ce..5b30d61bc 100644 --- a/packages/n4s/src/lib/ruleReturn.ts +++ b/packages/n4s/src/lib/ruleReturn.ts @@ -3,7 +3,7 @@ import { defaultTo } from 'vest-utils'; export default function ruleReturn( pass: boolean, - message?: string + message?: string, ): RuleDetailedResult { const output: RuleDetailedResult = { pass }; @@ -23,13 +23,13 @@ export function passing(): RuleDetailedResult { } export function defaultToFailing( - callback: (...args: any[]) => RuleDetailedResult + callback: (...args: any[]) => RuleDetailedResult, ): RuleDetailedResult { return defaultTo(callback, failing()); } export function defaultToPassing( - callback: (...args: any[]) => RuleDetailedResult + callback: (...args: any[]) => RuleDetailedResult, ): RuleDetailedResult { return defaultTo(callback, passing()); } diff --git a/packages/n4s/src/lib/runLazyRule.ts b/packages/n4s/src/lib/runLazyRule.ts index d53fde05b..2e9e49a7f 100644 --- a/packages/n4s/src/lib/runLazyRule.ts +++ b/packages/n4s/src/lib/runLazyRule.ts @@ -4,7 +4,7 @@ import * as ruleReturn from 'ruleReturn'; export default function runLazyRule( lazyRule: LazyRuleRunners, - currentValue: any + currentValue: any, ): RuleDetailedResult { try { return lazyRule.run(currentValue); diff --git a/packages/n4s/src/lib/transformResult.ts b/packages/n4s/src/lib/transformResult.ts index 1627f07b6..e8542a0a9 100644 --- a/packages/n4s/src/lib/transformResult.ts +++ b/packages/n4s/src/lib/transformResult.ts @@ -20,7 +20,7 @@ export function transformResult( } return ruleReturn( result.pass, - optionalFunctionValue(result.message, ruleName, value, ...args) + optionalFunctionValue(result.message, ruleName, value, ...args), ); } @@ -28,6 +28,6 @@ function validateResult(result: RuleReturn): void { // if result is boolean, or if result.pass is boolean invariant( isBoolean(result) || (result && isBoolean(result.pass)), - 'Incorrect return value for rule: ' + JSON.stringify(result) + 'Incorrect return value for rule: ' + JSON.stringify(result), ); } diff --git a/packages/n4s/src/plugins/compounds/__tests__/allOf.test.ts b/packages/n4s/src/plugins/compounds/__tests__/allOf.test.ts index 58edc636f..824135d1c 100644 --- a/packages/n4s/src/plugins/compounds/__tests__/allOf.test.ts +++ b/packages/n4s/src/plugins/compounds/__tests__/allOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'compounds'; @@ -7,7 +9,9 @@ describe('allOf', () => { describe('When all rules are satisfied', () => { it('Should return a passing result', () => { expect( - enforce.allOf(enforce.isArray(), enforce.longerThan(2)).run([1, 2, 3]) + enforce + .allOf(enforce.isArray(), enforce.longerThan(2)) + .run([1, 2, 3]), ).toEqual(ruleReturn.passing()); }); }); diff --git a/packages/n4s/src/plugins/compounds/__tests__/noneOf.test.ts b/packages/n4s/src/plugins/compounds/__tests__/noneOf.test.ts index 1de8a0fb1..cba74ae6f 100644 --- a/packages/n4s/src/plugins/compounds/__tests__/noneOf.test.ts +++ b/packages/n4s/src/plugins/compounds/__tests__/noneOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'compounds'; @@ -7,7 +9,7 @@ describe('noneOf', () => { describe('When none of the rules are satisfied', () => { it('Should return a passing result', () => { expect( - enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run('x') + enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run('x'), ).toEqual(ruleReturn.passing()); }); }); @@ -15,7 +17,7 @@ describe('noneOf', () => { describe('When some of the rules are satisfied', () => { it('Should return a failing result', () => { expect( - enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run([2]) + enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run([2]), ).toEqual(ruleReturn.failing()); }); }); @@ -23,7 +25,7 @@ describe('noneOf', () => { describe('When all of the rules are satisfied', () => { it('Should return a failing result', () => { expect( - enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run([2, 3]) + enforce.noneOf(enforce.isArray(), enforce.longerThan(2)).run([2, 3]), ).toEqual(ruleReturn.failing()); }); }); diff --git a/packages/n4s/src/plugins/compounds/__tests__/oneOf.test.ts b/packages/n4s/src/plugins/compounds/__tests__/oneOf.test.ts index 980639937..47793f978 100644 --- a/packages/n4s/src/plugins/compounds/__tests__/oneOf.test.ts +++ b/packages/n4s/src/plugins/compounds/__tests__/oneOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; @@ -7,7 +9,7 @@ import 'compounds'; describe('enforce.oneOf', () => { it('Should fail when multiple enforcements are met', () => { expect( - enforce.oneOf(enforce.isNumber(), enforce.greaterThan(2)).run(3) + enforce.oneOf(enforce.isNumber(), enforce.greaterThan(2)).run(3), ).toEqual(ruleReturn.failing()); }); @@ -18,7 +20,7 @@ describe('enforce.oneOf', () => { first: 'John', last: 'Doe', }, - }) + }), ).toEqual(ruleReturn.passing()); expect(User.run({ id: 11 })).toEqual(ruleReturn.passing()); }); diff --git a/packages/n4s/src/plugins/compounds/allOf.ts b/packages/n4s/src/plugins/compounds/allOf.ts index a56c006b4..2d03b49be 100644 --- a/packages/n4s/src/plugins/compounds/allOf.ts +++ b/packages/n4s/src/plugins/compounds/allOf.ts @@ -10,6 +10,6 @@ export function allOf(value: unknown, ...rules: Lazy[]): RuleDetailedResult { mapFirst(rules, (rule, breakout) => { const res = runLazyRule(rule, value); breakout(!res.pass, res); - }) + }), ); } diff --git a/packages/n4s/src/plugins/compounds/anyOf.ts b/packages/n4s/src/plugins/compounds/anyOf.ts index 24c8ea037..e29e72681 100644 --- a/packages/n4s/src/plugins/compounds/anyOf.ts +++ b/packages/n4s/src/plugins/compounds/anyOf.ts @@ -10,6 +10,6 @@ export function anyOf(value: unknown, ...rules: Lazy[]): RuleDetailedResult { mapFirst(rules, (rule, breakout) => { const res = runLazyRule(rule, value); breakout(res.pass, res); - }) + }), ); } diff --git a/packages/n4s/src/plugins/compounds/noneOf.ts b/packages/n4s/src/plugins/compounds/noneOf.ts index fc2fc05b2..0e59ef617 100644 --- a/packages/n4s/src/plugins/compounds/noneOf.ts +++ b/packages/n4s/src/plugins/compounds/noneOf.ts @@ -11,6 +11,6 @@ export function noneOf(value: unknown, ...rules: Lazy[]): RuleDetailedResult { const res = runLazyRule(rule, value); breakout(res.pass, ruleReturn.failing()); - }) + }), ); } diff --git a/packages/n4s/src/plugins/schema/__tests__/isArrayOf.test.ts b/packages/n4s/src/plugins/schema/__tests__/isArrayOf.test.ts index cbcb99061..badeea74e 100644 --- a/packages/n4s/src/plugins/schema/__tests__/isArrayOf.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/isArrayOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import 'schema'; import 'compounds'; @@ -7,19 +9,19 @@ describe('enforce.isArrayOf', () => { describe('lazy interface', () => { it('Should return a passing return for an empty array', () => { expect(enforce.isArrayOf(enforce.isString()).run([])).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); }); it('Should return a passing return for valid arrays', () => { expect( - enforce.isArrayOf(enforce.isString()).run(['a', 'b', 'c']) + enforce.isArrayOf(enforce.isString()).run(['a', 'b', 'c']), ).toEqual(ruleReturn.passing()); expect( enforce .isArrayOf(enforce.anyOf(enforce.isString(), enforce.isNumber())) - .run([1, 'b', 'c']) + .run([1, 'b', 'c']), ).toEqual(ruleReturn.passing()); expect( @@ -28,24 +30,24 @@ describe('enforce.isArrayOf', () => { enforce.shape({ id: enforce.isNumber(), username: enforce.isString(), - }) + }), ) .run([ { id: 1, username: 'b' }, { id: 2, username: 'c' }, - ]) + ]), ).toEqual(ruleReturn.passing()); }); it('Should return a failing return for invalid arrays', () => { expect(enforce.isArrayOf(enforce.isString()).run([1, 2, 3])).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); expect( enforce .isArrayOf(enforce.allOf(enforce.isString(), enforce.isNumber())) - .run([1, 2, 3]) + .run([1, 2, 3]), ).toEqual(ruleReturn.failing()); expect( @@ -54,13 +56,13 @@ describe('enforce.isArrayOf', () => { enforce.shape({ id: enforce.isNumber(), username: enforce.isString(), - }) + }), ) .run([ { id: '1', username: 'b' }, { id: '2', username: 'c' }, { id: '3', username: 'd' }, - ]) + ]), ).toEqual(ruleReturn.failing()); }); }); @@ -74,7 +76,7 @@ describe('enforce.isArrayOf', () => { enforce(['a', 'b', 'c']).isArrayOf(enforce.isString()); enforce([1, 'b', 'c']).isArrayOf( - enforce.anyOf(enforce.isString(), enforce.isNumber()) + enforce.anyOf(enforce.isString(), enforce.isNumber()), ); enforce([ @@ -84,7 +86,7 @@ describe('enforce.isArrayOf', () => { enforce.shape({ id: enforce.isNumber(), username: enforce.isString(), - }) + }), ); }); @@ -93,8 +95,8 @@ describe('enforce.isArrayOf', () => { expect(() => enforce([1, 2, 3]).isArrayOf( - enforce.allOf(enforce.isString(), enforce.isNumber()) - ) + enforce.allOf(enforce.isString(), enforce.isNumber()), + ), ).toThrow(); expect(() => @@ -106,8 +108,8 @@ describe('enforce.isArrayOf', () => { enforce.shape({ id: enforce.isNumber(), username: enforce.isString(), - }) - ) + }), + ), ).toThrow(); }); }); diff --git a/packages/n4s/src/plugins/schema/__tests__/loose.test.ts b/packages/n4s/src/plugins/schema/__tests__/loose.test.ts index 2f1590c83..0eb2085d0 100644 --- a/packages/n4s/src/plugins/schema/__tests__/loose.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/loose.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'schema'; @@ -8,7 +10,7 @@ describe('enforce.loose for loose matching', () => { expect( enforce .loose({ username: enforce.isString(), age: enforce.isNumber() }) - .run({ username: 'ealush', age: 31, foo: 'bar' }) + .run({ username: 'ealush', age: 31, foo: 'bar' }), ).toEqual(ruleReturn.passing()); }); }); diff --git a/packages/n4s/src/plugins/schema/__tests__/optional.test.ts b/packages/n4s/src/plugins/schema/__tests__/optional.test.ts index 674f68e13..e4cf15430 100644 --- a/packages/n4s/src/plugins/schema/__tests__/optional.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/optional.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'schema'; @@ -7,10 +9,10 @@ describe('enforce.optional', () => { describe('lazy interface', () => { it('Should return a passing result for nullable values', () => { expect(enforce.optional(enforce.isNumber()).run(null)).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); expect(enforce.optional(enforce.isArray()).run(undefined)).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); expect( @@ -23,16 +25,16 @@ describe('enforce.optional', () => { .run({ firstName: 'John', lastName: 'Doe', - }) + }), ).toEqual(ruleReturn.passing()); }); it('Should return passing result for non-nullable values that satisfy the tests', () => { expect(enforce.optional(enforce.isNumber()).run(2)).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); expect(enforce.optional(enforce.isArray()).run([1, 2])).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); expect( enforce @@ -45,16 +47,16 @@ describe('enforce.optional', () => { firstName: 'John', middleName: 'H.', lastName: 'Doe', - }) + }), ).toEqual(ruleReturn.passing()); }); it('Should return a failing result for non-nullable values that do not satisfy the tests', () => { expect(enforce.optional(enforce.isNumber()).run('2')).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); expect(enforce.optional(enforce.isArray()).run('2')).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); expect( enforce @@ -67,7 +69,7 @@ describe('enforce.optional', () => { firstName: 'John', middleName: 'H.', lastName: 'Doe', - }) + }), ).toEqual(ruleReturn.failing()); }); }); diff --git a/packages/n4s/src/plugins/schema/__tests__/partial.test.ts b/packages/n4s/src/plugins/schema/__tests__/partial.test.ts index d42d06e5e..106afcfea 100644 --- a/packages/n4s/src/plugins/schema/__tests__/partial.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/partial.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import { partial } from 'schema'; @@ -11,7 +13,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); partial({}); @@ -21,7 +23,7 @@ describe('partial', () => { rules.run({ username: null, id: null, - }) + }), ).toEqual(ruleReturn.passing()); }); @@ -30,11 +32,11 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); expect(rules.run({ username: 'foobar', id: 1 })).toEqual( - ruleReturn.passing() + ruleReturn.passing(), ); }); @@ -43,7 +45,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); expect(rules.run({ username: 'foobar' })).toEqual(ruleReturn.passing()); @@ -54,11 +56,11 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); expect(rules.run({ username: 'foo', id: '1' })).toEqual( - ruleReturn.failing() + ruleReturn.failing(), ); }); }); @@ -69,7 +71,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); enforce({ @@ -79,7 +81,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); }); @@ -88,7 +90,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); }); @@ -97,7 +99,7 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ); }); @@ -107,8 +109,8 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) - ) + }), + ), ).toThrow(); }); }); @@ -120,9 +122,9 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ) - .run({ username: 'foobar', id: '1', foo: 'bar' }) + .run({ username: 'foobar', id: '1', foo: 'bar' }), ).toEqual(ruleReturn.failing()); expect( @@ -131,9 +133,9 @@ describe('partial', () => { partial({ username: enforce.isString().longerThan(3), id: enforce.isNumeric(), - }) + }), ) - .run({ username: 'foobar', id: '1', foo: 'bar' }) + .run({ username: 'foobar', id: '1', foo: 'bar' }), ).toEqual(ruleReturn.passing()); }); }); diff --git a/packages/n4s/src/plugins/schema/__tests__/shape&loose.test.ts b/packages/n4s/src/plugins/schema/__tests__/shape&loose.test.ts index caff29e3e..eb47d1501 100644 --- a/packages/n4s/src/plugins/schema/__tests__/shape&loose.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/shape&loose.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'schema'; diff --git a/packages/n4s/src/plugins/schema/__tests__/shape.test.ts b/packages/n4s/src/plugins/schema/__tests__/shape.test.ts index b3dd49298..3407a6452 100644 --- a/packages/n4s/src/plugins/schema/__tests__/shape.test.ts +++ b/packages/n4s/src/plugins/schema/__tests__/shape.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; import 'schema'; @@ -9,7 +11,7 @@ describe('enforce.shape exact matching', () => { expect( enforce .shape({ username: enforce.isString(), age: enforce.isNumber() }) - .run({ username: 'ealush', age: 31, foo: 'bar' }) + .run({ username: 'ealush', age: 31, foo: 'bar' }), ).toEqual(ruleReturn.failing()); }); }); diff --git a/packages/n4s/src/plugins/schema/isArrayOf.ts b/packages/n4s/src/plugins/schema/isArrayOf.ts index 78e4bd7d7..9644d2ef5 100644 --- a/packages/n4s/src/plugins/schema/isArrayOf.ts +++ b/packages/n4s/src/plugins/schema/isArrayOf.ts @@ -8,16 +8,16 @@ import runLazyRule from 'runLazyRule'; export function isArrayOf( inputArray: any[], - currentRule: LazyRuleRunners + currentRule: LazyRuleRunners, ): RuleDetailedResult { return ruleReturn.defaultToPassing( mapFirst(inputArray, (currentValue, breakout, index) => { const res = ctx.run( { value: currentValue, set: true, meta: { index } }, - () => runLazyRule(currentRule, currentValue) + () => runLazyRule(currentRule, currentValue), ); breakout(!res.pass, res); - }) + }), ); } diff --git a/packages/n4s/src/plugins/schema/loose.ts b/packages/n4s/src/plugins/schema/loose.ts index b94e872a2..a88ab012b 100644 --- a/packages/n4s/src/plugins/schema/loose.ts +++ b/packages/n4s/src/plugins/schema/loose.ts @@ -7,14 +7,14 @@ import type { ShapeObject } from 'schemaTypes'; export function loose( inputObject: Record, - shapeObject: ShapeObject + shapeObject: ShapeObject, ): RuleDetailedResult { for (const key in shapeObject) { const currentValue = inputObject[key]; const currentRule = shapeObject[key]; const res = ctx.run({ value: currentValue, set: true, meta: { key } }, () => - runLazyRule(currentRule, currentValue) + runLazyRule(currentRule, currentValue), ); if (!res.pass) { diff --git a/packages/n4s/src/plugins/schema/shape.ts b/packages/n4s/src/plugins/schema/shape.ts index e7c64adc0..aa2dd4fdb 100644 --- a/packages/n4s/src/plugins/schema/shape.ts +++ b/packages/n4s/src/plugins/schema/shape.ts @@ -7,7 +7,7 @@ import type { ShapeObject } from 'schemaTypes'; export function shape( inputObject: Record, - shapeObject: ShapeObject + shapeObject: ShapeObject, ): RuleDetailedResult { const baseRes = loose(inputObject, shapeObject); if (!baseRes.pass) { diff --git a/packages/n4s/src/rules/__tests__/endsWith.test.ts b/packages/n4s/src/rules/__tests__/endsWith.test.ts index e341bbbd5..bc854f861 100644 --- a/packages/n4s/src/rules/__tests__/endsWith.test.ts +++ b/packages/n4s/src/rules/__tests__/endsWith.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { endsWith } from 'endsWith'; describe('Tests isArray rule', () => { @@ -9,7 +11,7 @@ describe('Tests isArray rule', () => { it('Should return true for a suffix', () => { expect(endsWith(word, word.substring(word.length / 2, word.length))).toBe( - true + true, ); }); diff --git a/packages/n4s/src/rules/__tests__/equals.test.ts b/packages/n4s/src/rules/__tests__/equals.test.ts index 95966f4d5..fd7d1ef9e 100644 --- a/packages/n4s/src/rules/__tests__/equals.test.ts +++ b/packages/n4s/src/rules/__tests__/equals.test.ts @@ -1,5 +1,6 @@ import { faker } from '@faker-js/faker'; import { sample } from 'lodash'; +import { describe, it, expect } from 'vitest'; import { equals } from 'equals'; diff --git a/packages/n4s/src/rules/__tests__/greaterThanOrEquals.test.ts b/packages/n4s/src/rules/__tests__/greaterThanOrEquals.test.ts index 60cab3a08..cfcb7ca47 100644 --- a/packages/n4s/src/rules/__tests__/greaterThanOrEquals.test.ts +++ b/packages/n4s/src/rules/__tests__/greaterThanOrEquals.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect, beforeEach } from 'vitest'; import { greaterThanOrEquals } from 'greaterThanOrEquals'; @@ -55,7 +56,7 @@ describe('Tests greaterThanOrEquals rule', () => { // @ts-expect-error - Testing invalid input expect(greaterThanOrEquals(element, 0)).toBe(false); }); - } + }, ); }); }); diff --git a/packages/n4s/src/rules/__tests__/inside.test.ts b/packages/n4s/src/rules/__tests__/inside.test.ts index e855cbbfd..4ae425092 100644 --- a/packages/n4s/src/rules/__tests__/inside.test.ts +++ b/packages/n4s/src/rules/__tests__/inside.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { inside } from 'inside'; describe('Inside rule', () => { @@ -9,7 +11,7 @@ describe('Inside rule', () => { it('Should fail to find a string inside an array in which it does not exist', () => { expect(inside('going to', ["I'm", 'gonna', 'pop', 'some', 'tags'])).toBe( - false + false, ); }); @@ -35,7 +37,7 @@ describe('Inside rule', () => { it('Should fail to find array elements in another array in which they do not exist', () => { expect(inside(['no', 'treble'], ['all', 'about', 'the', 'bass'])).toBe( - false + false, ); }); diff --git a/packages/n4s/src/rules/__tests__/isBetween.test.ts b/packages/n4s/src/rules/__tests__/isBetween.test.ts index 45f56838d..4a2cc3598 100644 --- a/packages/n4s/src/rules/__tests__/isBetween.test.ts +++ b/packages/n4s/src/rules/__tests__/isBetween.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isBetween } from 'isBetween'; describe('Tests isBetween rule', () => { diff --git a/packages/n4s/src/rules/__tests__/isBlank.test.ts b/packages/n4s/src/rules/__tests__/isBlank.test.ts index fd166d4a5..11ea85a18 100644 --- a/packages/n4s/src/rules/__tests__/isBlank.test.ts +++ b/packages/n4s/src/rules/__tests__/isBlank.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isBlank, isNotBlank } from 'isBlank'; describe('isBlank', () => { diff --git a/packages/n4s/src/rules/__tests__/isBoolean.test.ts b/packages/n4s/src/rules/__tests__/isBoolean.test.ts index 565da2793..8e32b7520 100644 --- a/packages/n4s/src/rules/__tests__/isBoolean.test.ts +++ b/packages/n4s/src/rules/__tests__/isBoolean.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; describe('isBoolean', () => { diff --git a/packages/n4s/src/rules/__tests__/isEven.test.ts b/packages/n4s/src/rules/__tests__/isEven.test.ts index c96438f06..bc30d0efb 100644 --- a/packages/n4s/src/rules/__tests__/isEven.test.ts +++ b/packages/n4s/src/rules/__tests__/isEven.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect, beforeAll } from 'vitest'; import { isEven } from 'isEven'; diff --git a/packages/n4s/src/rules/__tests__/isKeyOf.test.ts b/packages/n4s/src/rules/__tests__/isKeyOf.test.ts index 011a9b8f7..febf89bd9 100644 --- a/packages/n4s/src/rules/__tests__/isKeyOf.test.ts +++ b/packages/n4s/src/rules/__tests__/isKeyOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import { isKeyOf, isNotKeyOf } from 'isKeyOf'; @@ -38,7 +40,7 @@ describe('Tests isKeyOf rule', () => { 'Should throw when %s is an object', v => { expect(() => enforce(DUMMY_KEY).isKeyOf({ v })).toThrow(); - } + }, ); }); }); diff --git a/packages/n4s/src/rules/__tests__/isNaN.test.ts b/packages/n4s/src/rules/__tests__/isNaN.test.ts index 4b384c4da..248fa85fd 100644 --- a/packages/n4s/src/rules/__tests__/isNaN.test.ts +++ b/packages/n4s/src/rules/__tests__/isNaN.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import * as NaNRule from 'isNaN'; describe('Tests isNaN rule', () => { diff --git a/packages/n4s/src/rules/__tests__/isNegative.test.ts b/packages/n4s/src/rules/__tests__/isNegative.test.ts index 192cbd5e5..b8502b634 100644 --- a/packages/n4s/src/rules/__tests__/isNegative.test.ts +++ b/packages/n4s/src/rules/__tests__/isNegative.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isNegative } from 'isNegative'; describe('Tests isNegative rule', () => { diff --git a/packages/n4s/src/rules/__tests__/isNullish.test.ts b/packages/n4s/src/rules/__tests__/isNullish.test.ts index 56f8e0b2b..3d0117cc4 100644 --- a/packages/n4s/src/rules/__tests__/isNullish.test.ts +++ b/packages/n4s/src/rules/__tests__/isNullish.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'n4s'; describe('enforce.isNullish', () => { diff --git a/packages/n4s/src/rules/__tests__/isNumber.test.ts b/packages/n4s/src/rules/__tests__/isNumber.test.ts index e9dd869db..da3d626e0 100644 --- a/packages/n4s/src/rules/__tests__/isNumber.test.ts +++ b/packages/n4s/src/rules/__tests__/isNumber.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isNumber } from 'isNumber'; describe('Tests isNumber rule', () => { diff --git a/packages/n4s/src/rules/__tests__/isOdd.test.ts b/packages/n4s/src/rules/__tests__/isOdd.test.ts index a4cf24efb..a80a57a8c 100644 --- a/packages/n4s/src/rules/__tests__/isOdd.test.ts +++ b/packages/n4s/src/rules/__tests__/isOdd.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect } from 'vitest'; import { isOdd } from 'isOdd'; diff --git a/packages/n4s/src/rules/__tests__/isTruthy.test.ts b/packages/n4s/src/rules/__tests__/isTruthy.test.ts index 41c6d478a..91ebdc5f1 100644 --- a/packages/n4s/src/rules/__tests__/isTruthy.test.ts +++ b/packages/n4s/src/rules/__tests__/isTruthy.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isTruthy } from 'isTruthy'; describe('Tests isTruthy rule', () => { diff --git a/packages/n4s/src/rules/__tests__/isValueOf.test.ts b/packages/n4s/src/rules/__tests__/isValueOf.test.ts index 57515b63e..c9d71b9bb 100644 --- a/packages/n4s/src/rules/__tests__/isValueOf.test.ts +++ b/packages/n4s/src/rules/__tests__/isValueOf.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { enforce } from 'enforce'; import { isValueOf, isNotValueOf } from 'isValueOf'; diff --git a/packages/n4s/src/rules/__tests__/lessThan.test.ts b/packages/n4s/src/rules/__tests__/lessThan.test.ts index a79f53b7c..eb7a4e099 100644 --- a/packages/n4s/src/rules/__tests__/lessThan.test.ts +++ b/packages/n4s/src/rules/__tests__/lessThan.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect, beforeEach } from 'vitest'; import { lessThan } from 'lessThan'; @@ -59,7 +60,7 @@ describe('Tests lessThan rule', () => { // @ts-expect-error - Testing invalid input expect(lessThan(element, 0)).toBe(false); }); - } + }, ); }); }); diff --git a/packages/n4s/src/rules/__tests__/lessThanOrEquals.test.ts b/packages/n4s/src/rules/__tests__/lessThanOrEquals.test.ts index 8cddf08e7..ec01f8c6f 100644 --- a/packages/n4s/src/rules/__tests__/lessThanOrEquals.test.ts +++ b/packages/n4s/src/rules/__tests__/lessThanOrEquals.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect, beforeEach } from 'vitest'; import { lessThanOrEquals } from 'lessThanOrEquals'; @@ -59,7 +60,7 @@ describe('Tests lessThanOrEquals rule', () => { // @ts-expect-error - Testing invalid input expect(lessThanOrEquals(element, 0)).toBe(false); }); - } + }, ); }); }); diff --git a/packages/n4s/src/rules/__tests__/longerThanOrEquals.test.ts b/packages/n4s/src/rules/__tests__/longerThanOrEquals.test.ts index 132297d37..d8d9699e2 100644 --- a/packages/n4s/src/rules/__tests__/longerThanOrEquals.test.ts +++ b/packages/n4s/src/rules/__tests__/longerThanOrEquals.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect } from 'vitest'; import { longerThanOrEquals } from 'longerThanOrEquals'; diff --git a/packages/n4s/src/rules/__tests__/matches.test.ts b/packages/n4s/src/rules/__tests__/matches.test.ts index 48464e318..48a495c69 100644 --- a/packages/n4s/src/rules/__tests__/matches.test.ts +++ b/packages/n4s/src/rules/__tests__/matches.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { matches } from 'matches'; const URL = diff --git a/packages/n4s/src/rules/__tests__/ruleCondition.test.ts b/packages/n4s/src/rules/__tests__/ruleCondition.test.ts index b34635cc3..3e880e5ea 100644 --- a/packages/n4s/src/rules/__tests__/ruleCondition.test.ts +++ b/packages/n4s/src/rules/__tests__/ruleCondition.test.ts @@ -1,9 +1,11 @@ +import { describe, it, expect, vi } from 'vitest'; + import { enforce } from 'n4s'; import ruleReturn, { failing, passing } from 'ruleReturn'; describe('enforce.condition', () => { it('Should pass down enforced value to condition as the first argument', () => { - const condition = jest.fn(() => true); + const condition = vi.fn(() => true); enforce(1).condition(condition); expect(condition).toHaveBeenCalledWith(1); @@ -17,7 +19,7 @@ describe('enforce.condition', () => { expect(enforce.condition(() => false).run(1)).toEqual(failing()); expect(enforce.condition(() => failing()).run(1)).toEqual(failing()); expect( - enforce.condition(() => ruleReturn(false, 'failure message')).run(1) + enforce.condition(() => ruleReturn(false, 'failure message')).run(1), ).toEqual(ruleReturn(false, 'failure message')); }); @@ -25,7 +27,7 @@ describe('enforce.condition', () => { expect(enforce.condition(() => true).run(1)).toEqual(passing()); expect(enforce.condition(() => passing()).run(1)).toEqual(passing()); expect( - enforce.condition(() => ruleReturn(true, 'success message')).run(1) + enforce.condition(() => ruleReturn(true, 'success message')).run(1), ).toEqual(passing()); }); }); @@ -37,7 +39,7 @@ describe('enforce.condition', () => { expect(() => enforce(1).condition(() => failing())).toThrow(); expect(() => - enforce(1).condition(() => ruleReturn(false, 'failure message')) + enforce(1).condition(() => ruleReturn(false, 'failure message')), ).toThrow(); }); @@ -47,7 +49,7 @@ describe('enforce.condition', () => { expect(() => enforce(1).condition(() => passing())).not.toThrow(); expect(() => - enforce(1).condition(() => ruleReturn(true, 'success message')) + enforce(1).condition(() => ruleReturn(true, 'success message')), ).not.toThrow(); }); }); diff --git a/packages/n4s/src/rules/__tests__/rules.test.ts b/packages/n4s/src/rules/__tests__/rules.test.ts index e2cdab9a7..58c8bc46d 100644 --- a/packages/n4s/src/rules/__tests__/rules.test.ts +++ b/packages/n4s/src/rules/__tests__/rules.test.ts @@ -1,4 +1,5 @@ import rules from 'rules'; +import { describe, it, expect } from 'vitest'; describe('Tests enforce rules API', () => { it('Should expose all enforce rules', () => { diff --git a/packages/n4s/src/rules/__tests__/shorterThan.test.ts b/packages/n4s/src/rules/__tests__/shorterThan.test.ts index 59e9faff8..d4a76e934 100644 --- a/packages/n4s/src/rules/__tests__/shorterThan.test.ts +++ b/packages/n4s/src/rules/__tests__/shorterThan.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { shorterThan } from 'shorterThan'; +import { describe, it, expect } from 'vitest'; describe('Tests shorterThan rule', () => { const length = 10; diff --git a/packages/n4s/src/rules/__tests__/shorterThanOrEquals.test.ts b/packages/n4s/src/rules/__tests__/shorterThanOrEquals.test.ts index 17fa41a34..bfc48df18 100644 --- a/packages/n4s/src/rules/__tests__/shorterThanOrEquals.test.ts +++ b/packages/n4s/src/rules/__tests__/shorterThanOrEquals.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { shorterThanOrEquals } from 'shorterThanOrEquals'; +import { describe, it, expect } from 'vitest'; describe('Tests shorterThanOrEquals rule', () => { const length = 10; diff --git a/packages/n4s/src/rules/__tests__/startsWith.test.ts b/packages/n4s/src/rules/__tests__/startsWith.test.ts index 7e9714053..ab964bc94 100644 --- a/packages/n4s/src/rules/__tests__/startsWith.test.ts +++ b/packages/n4s/src/rules/__tests__/startsWith.test.ts @@ -1,4 +1,5 @@ import { startsWith } from 'startsWith'; +import { describe, it, expect } from 'vitest'; describe('Tests isArray rule', () => { const word = 'meow'; diff --git a/packages/n4s/src/rules/greaterThanOrEquals.ts b/packages/n4s/src/rules/greaterThanOrEquals.ts index c2ee07d7e..43b099cc8 100644 --- a/packages/n4s/src/rules/greaterThanOrEquals.ts +++ b/packages/n4s/src/rules/greaterThanOrEquals.ts @@ -2,7 +2,7 @@ import { greaterThan, numberEquals } from 'vest-utils'; export function greaterThanOrEquals( value: string | number, - gte: string | number + gte: string | number, ): boolean { return numberEquals(value, gte) || greaterThan(value, gte); } diff --git a/packages/n4s/src/rules/isBetween.ts b/packages/n4s/src/rules/isBetween.ts index d3b75bfb8..e3293a10b 100644 --- a/packages/n4s/src/rules/isBetween.ts +++ b/packages/n4s/src/rules/isBetween.ts @@ -6,7 +6,7 @@ import { lessThanOrEquals as lte } from 'lessThanOrEquals'; export function isBetween( value: number | string, min: number | string, - max: number | string + max: number | string, ): boolean { return gte(value, min) && lte(value, max); } diff --git a/packages/n4s/src/rules/lessThanOrEquals.ts b/packages/n4s/src/rules/lessThanOrEquals.ts index c48771105..c7aff9e94 100644 --- a/packages/n4s/src/rules/lessThanOrEquals.ts +++ b/packages/n4s/src/rules/lessThanOrEquals.ts @@ -4,7 +4,7 @@ import { lessThan } from 'lessThan'; export function lessThanOrEquals( value: string | number, - lte: string | number + lte: string | number, ): boolean { return numberEquals(value, lte) || lessThan(value, lte); } diff --git a/packages/n4s/src/rules/longerThanOrEquals.ts b/packages/n4s/src/rules/longerThanOrEquals.ts index 7a1e8dec3..4e4855dde 100644 --- a/packages/n4s/src/rules/longerThanOrEquals.ts +++ b/packages/n4s/src/rules/longerThanOrEquals.ts @@ -2,7 +2,7 @@ import { greaterThanOrEquals } from 'greaterThanOrEquals'; export function longerThanOrEquals( value: string | unknown[], - arg1: string | number + arg1: string | number, ): boolean { return greaterThanOrEquals(value.length, arg1); } diff --git a/packages/n4s/src/rules/ruleCondition.ts b/packages/n4s/src/rules/ruleCondition.ts index 7cf682df4..690faf835 100644 --- a/packages/n4s/src/rules/ruleCondition.ts +++ b/packages/n4s/src/rules/ruleCondition.ts @@ -2,7 +2,7 @@ import type { RuleReturn } from 'ruleReturn'; export function condition( value: any, - callback: (value: any) => RuleReturn + callback: (value: any) => RuleReturn, ): RuleReturn { try { return callback(value); diff --git a/packages/n4s/src/rules/shorterThan.ts b/packages/n4s/src/rules/shorterThan.ts index 6e1169ca1..def0f72f6 100644 --- a/packages/n4s/src/rules/shorterThan.ts +++ b/packages/n4s/src/rules/shorterThan.ts @@ -2,7 +2,7 @@ import { lessThan } from 'lessThan'; export function shorterThan( value: string | unknown[], - arg1: string | number + arg1: string | number, ): boolean { return lessThan(value.length, arg1); } diff --git a/packages/n4s/src/rules/shorterThanOrEquals.ts b/packages/n4s/src/rules/shorterThanOrEquals.ts index 93a89ad90..af317db43 100644 --- a/packages/n4s/src/rules/shorterThanOrEquals.ts +++ b/packages/n4s/src/rules/shorterThanOrEquals.ts @@ -2,7 +2,7 @@ import { lessThanOrEquals } from 'lessThanOrEquals'; export function shorterThanOrEquals( value: string | unknown[], - arg1: string | number + arg1: string | number, ): boolean { return lessThanOrEquals(value.length, arg1); } diff --git a/packages/n4s/src/runtime/__tests__/enforceContext.test.ts b/packages/n4s/src/runtime/__tests__/enforceContext.test.ts index 0eeb5a608..8dfce618f 100644 --- a/packages/n4s/src/runtime/__tests__/enforceContext.test.ts +++ b/packages/n4s/src/runtime/__tests__/enforceContext.test.ts @@ -1,13 +1,14 @@ import { enforce } from 'enforce'; import * as ruleReturn from 'ruleReturn'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import 'schema'; import 'compounds'; -let keepContext = jest.fn(); +let keepContext = vi.fn(); describe('enforce.context', () => { beforeEach(() => { - keepContext = jest.fn(); + keepContext = vi.fn(); }); describe('base structure', () => { @@ -56,12 +57,12 @@ describe('enforce.context', () => { // first.parent() === name expect(keepContext.mock.calls[0][0].parent()).toEqual( - keepContext.mock.calls[1][0] + keepContext.mock.calls[1][0], ); // siblings[0].parent() === siblings expect(keepContext.mock.calls[2][0].parent()).toEqual( - keepContext.mock.calls[3][0] + keepContext.mock.calls[3][0], ); }); @@ -85,7 +86,7 @@ describe('enforce.context', () => { .someCustomRule(); expect( - keepContext.mock.calls[0][0].parent().parent().parent() + keepContext.mock.calls[0][0].parent().parent().parent(), ).toBeNull(); expect(keepContext.mock.calls[1][0].parent().parent()).toBeNull(); expect(keepContext.mock.calls[4][0].parent()).toBeNull(); @@ -152,7 +153,7 @@ describe('enforce.context', () => { describe('enforce.isArrayOf', () => { it('passes the current value into the context', () => { enforce(['Elle', 'Tester', 'Sophie']).isArrayOf( - enforce.isString().someCustomRule() + enforce.isString().someCustomRule(), ); expect(keepContext.mock.calls[0][0].value).toBe('Elle'); @@ -162,7 +163,7 @@ describe('enforce.context', () => { it('passes the current index into the context meta field', () => { enforce(['Elle', 'Tester', 'Sophie']).isArrayOf( - enforce.isString().someCustomRule() + enforce.isString().someCustomRule(), ); expect(keepContext.mock.calls[0][0].meta).toEqual({ index: 0 }); expect(keepContext.mock.calls[1][0].meta).toEqual({ index: 1 }); @@ -180,9 +181,9 @@ describe('enforce.context', () => { }).shape({ username: enforce.isString(), friends: enforce.isArrayOf( - enforce.isString().isFriendTheSameAsUser() + enforce.isString().isFriendTheSameAsUser(), ), - }) + }), ).toThrow(); }); diff --git a/packages/n4s/src/runtime/__tests__/message.test.ts b/packages/n4s/src/runtime/__tests__/message.test.ts index 8c9ca70b0..d8a40a93c 100644 --- a/packages/n4s/src/runtime/__tests__/message.test.ts +++ b/packages/n4s/src/runtime/__tests__/message.test.ts @@ -1,48 +1,49 @@ import { enforce } from 'enforce'; import ruleReturn from 'ruleReturn'; +import { describe, it, expect, vi } from 'vitest'; describe('enforce..message()', () => { it('Should set the failure message in builtin rules', () => { expect( - enforce.equals(false).message('oof. Expected true to be false').run(true) + enforce.equals(false).message('oof. Expected true to be false').run(true), ).toEqual(ruleReturn(false, 'oof. Expected true to be false')); expect( enforce .equals(false) .message(() => 'oof. Expected true to be false') - .run(true) + .run(true), ).toEqual(ruleReturn(false, 'oof. Expected true to be false')); }); it('Should set the failure message in custom rules', () => { expect( - enforce.ruleWithFailureMessage().message('oof. Failed again!').run(true) + enforce.ruleWithFailureMessage().message('oof. Failed again!').run(true), ).toEqual(ruleReturn(false, 'oof. Failed again!')); expect( enforce .ruleWithFailureMessage() .message(() => 'oof. Failed again!') - .run(true) + .run(true), ).toEqual(ruleReturn(false, 'oof. Failed again!')); }); describe('.message callback', () => { it('Should be passed the rule value as the first argument', () => { - const msg = jest.fn(() => 'some message'); + const msg = vi.fn(() => 'some message'); const arg = {}; expect(enforce.equals(false).message(msg).run(arg)).toEqual( - ruleReturn(false, 'some message') + ruleReturn(false, 'some message'), ); expect(msg).toHaveBeenCalledWith(arg, undefined); }); it('Should pass original messages the second argument if exists', () => { - const msg = jest.fn(() => 'some message'); + const msg = vi.fn(() => 'some message'); const arg = {}; expect( - enforce.ruleWithFailureMessage(false).message(msg).run(arg) + enforce.ruleWithFailureMessage(false).message(msg).run(arg), ).toEqual(ruleReturn(false, 'some message')); expect(msg).toHaveBeenCalledWith(arg, 'This should not be seen!'); }); diff --git a/packages/n4s/src/runtime/genEnforceLazy.ts b/packages/n4s/src/runtime/genEnforceLazy.ts index c0aedc535..70e2c2a81 100644 --- a/packages/n4s/src/runtime/genEnforceLazy.ts +++ b/packages/n4s/src/runtime/genEnforceLazy.ts @@ -26,7 +26,7 @@ export default function genEnforceLazy(key: string) { const rule = getRule(ruleName); registeredRules.push((value: RuleValue) => - transformResult(rule(value, ...args), ruleName, value, ...args) + transformResult(rule(value, ...args), ruleName, value, ...args), ); let proxy = { @@ -40,10 +40,10 @@ export default function genEnforceLazy(key: string) { ruleReturn( !!res.pass, optionalFunctionValue(lazyMessage, value, res.message) ?? - res.message - ) + res.message, + ), ); - }) + }), ); }, test: (value: RuleValue): boolean => proxy.run(value).pass, diff --git a/packages/vast/README.md b/packages/vast/README.md index 0274aa523..45758925a 100644 --- a/packages/vast/README.md +++ b/packages/vast/README.md @@ -58,7 +58,7 @@ const useColor = state.registerStateKey( 'red', (currentState, previousState) => { console.log(`the color changed from ${previousState} to ${currentState}!`); - } + }, ); ``` diff --git a/packages/vast/src/__tests__/vast.test.ts b/packages/vast/src/__tests__/vast.test.ts index da3d21c3a..c9f49998e 100644 --- a/packages/vast/src/__tests__/vast.test.ts +++ b/packages/vast/src/__tests__/vast.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, beforeEach } from 'vitest'; + import { createState } from 'vast'; let state = createState(); @@ -26,12 +28,12 @@ describe('vast state', () => { it('Should append another state key on each call', () => { const stateValues = Array.from({ length: 100 }, () => Math.random()); const stateGetters = stateValues.map(value => - state.registerStateKey(value) + state.registerStateKey(value), ); expect( stateGetters.every( - (stateGetter, i) => stateGetter()[0] === stateValues[i] - ) + (stateGetter, i) => stateGetter()[0] === stateValues[i], + ), ).toBe(true); expect(stateGetters).toHaveLength(100); }); @@ -120,7 +122,7 @@ describe('vast state', () => { describe('onStateChange and onUpdate handlers', () => { it('Should run onStateChange handler when updating the state', () => { - const onStateChange = jest.fn(); + const onStateChange = vi.fn(); state = createState(onStateChange); const useKey1 = state.registerStateKey('v1'); @@ -134,8 +136,8 @@ describe('vast state', () => { }); it('Should run onUpdate handler when updating the key', () => { - const onUpdate1 = jest.fn(); - const onUpdate2 = jest.fn(); + const onUpdate1 = vi.fn(); + const onUpdate2 = vi.fn(); state = createState(); const useKey1 = state.registerStateKey('v1', onUpdate1); @@ -159,13 +161,13 @@ describe('vast state', () => { }); it('Should first run onUpdate and then onStateChange', () => { - const onUpdate = jest.fn(); - const onChange = jest.fn(); + const onUpdate = vi.fn(); + const onChange = vi.fn(); state = createState(onChange); state.registerStateKey('v1', onUpdate); expect(onUpdate.mock.invocationCallOrder[0]).toBeLessThan( - onChange.mock.invocationCallOrder[0] + onChange.mock.invocationCallOrder[0], ); }); }); diff --git a/packages/vast/src/vast.ts b/packages/vast/src/vast.ts index 6f663b432..f776ca766 100644 --- a/packages/vast/src/vast.ts +++ b/packages/vast/src/vast.ts @@ -8,7 +8,7 @@ import { // eslint-disable-next-line max-lines-per-function export function createState( - onStateChange?: (...args: unknown[]) => unknown + onStateChange?: (...args: unknown[]) => unknown, ): CreateStateReturn { const state: { references: unknown[]; @@ -18,7 +18,7 @@ export function createState( const registrations: [ unknown, - ((currentState: S, prevState: S) => void)? + ((currentState: S, prevState: S) => void)?, ][] = []; return { @@ -41,7 +41,7 @@ export function createState( */ function registerStateKey( initialState?: Maybe>, - onUpdate?: () => void + onUpdate?: () => void, ): CB> { const key = registrations.length; registrations.push([initialState, onUpdate]); @@ -52,14 +52,14 @@ export function createState( const prev = current(); state.references = []; registrations.forEach(([initialValue], index) => - initKey(index, initialValue, prev[index]) + initKey(index, initialValue, prev[index]), ); } function initKey( key: number, initialState?: Maybe>, - prevState?: Maybe + prevState?: Maybe, ) { current().push(); set(key, optionalFunctionValue(initialState, prevState)); @@ -104,6 +104,6 @@ type CreateStateReturn = { reset: () => void; registerStateKey: ( initialState?: Maybe>, - onUpdate?: () => void + onUpdate?: () => void, ) => CB>; }; diff --git a/packages/vest-utils/src/SimpleStateMachine.ts b/packages/vest-utils/src/SimpleStateMachine.ts index 9f07939d6..9d9ca8c61 100644 --- a/packages/vest-utils/src/SimpleStateMachine.ts +++ b/packages/vest-utils/src/SimpleStateMachine.ts @@ -20,7 +20,7 @@ export type TStateMachineApi = { }; export function StateMachine( - machine: TStateMachine + machine: TStateMachine, ): TStateMachineApi { let state = machine.initial; diff --git a/packages/vest-utils/src/__tests__/Predicates.test.ts b/packages/vest-utils/src/__tests__/Predicates.test.ts index 7b2b23d3f..cd2918afb 100644 --- a/packages/vest-utils/src/__tests__/Predicates.test.ts +++ b/packages/vest-utils/src/__tests__/Predicates.test.ts @@ -1,4 +1,5 @@ import { all, any } from 'Predicates'; +import { describe, it, vi, expect } from 'vitest'; describe('Predicates', () => { describe('all', () => { @@ -9,7 +10,7 @@ describe('Predicates', () => { it('Should return true if all predicates return true', () => { const predicate = all( value => value > 0, - value => value < 10 + value => value < 10, ); expect(predicate(5)).toBe(true); @@ -18,7 +19,7 @@ describe('Predicates', () => { it('Should return false if any predicate returns false', () => { const predicate = all( value => value > 0, - value => value < 10 + value => value < 10, ); expect(predicate(15)).toBe(false); @@ -35,15 +36,15 @@ describe('Predicates', () => { value => value > 0, value => value < 10, // @ts-ignore - Testing invalid input - 'not a function' + 'not a function', ); expect(predicate(15)).toBe(false); }); it('Should pass each predicate the value', () => { - const spy1 = jest.fn(value => value > 0); - const spy2 = jest.fn(value => value < 10); + const spy1 = vi.fn(value => value > 0); + const spy2 = vi.fn(value => value < 10); const predicate = all(spy1, spy2); @@ -71,21 +72,21 @@ describe('Predicates', () => { expect( any( value => value > 0, - value => value === 10 - )(5) + value => value === 10, + )(5), ).toBe(true); expect( any( value => value === 10, - value => value > 0 - )(5) + value => value > 0, + )(5), ).toBe(true); }); it('Should return true if all predicates return true', () => { const predicate = any( value => value > 0, - value => value === 10 + value => value === 10, ); expect(predicate(10)).toBe(true); @@ -94,7 +95,7 @@ describe('Predicates', () => { it('Should return false if all predicates return false', () => { const predicate = any( value => value > 0, - value => value === 10 + value => value === 10, ); expect(predicate(-5)).toBe(false); diff --git a/packages/vest-utils/src/__tests__/SimpleStateMachine.test.ts b/packages/vest-utils/src/__tests__/SimpleStateMachine.test.ts index 276903c7b..2380a290f 100644 --- a/packages/vest-utils/src/__tests__/SimpleStateMachine.test.ts +++ b/packages/vest-utils/src/__tests__/SimpleStateMachine.test.ts @@ -1,4 +1,5 @@ import { StateMachine } from 'SimpleStateMachine'; +import { describe, test, it, expect } from 'vitest'; describe('SimpleStateMachine', () => { test('sample', () => { diff --git a/packages/vest-utils/src/__tests__/StringObject.test.ts b/packages/vest-utils/src/__tests__/StringObject.test.ts index 3bc262cb6..92234f19c 100644 --- a/packages/vest-utils/src/__tests__/StringObject.test.ts +++ b/packages/vest-utils/src/__tests__/StringObject.test.ts @@ -1,4 +1,5 @@ import { StringObject } from 'StringObject'; +import { describe, test, expect } from 'vitest'; describe('StringObject', () => { test('returns an instance of String', () => { diff --git a/packages/vest-utils/src/__tests__/asArray.test.ts b/packages/vest-utils/src/__tests__/asArray.test.ts index 837ffa26d..79397f068 100644 --- a/packages/vest-utils/src/__tests__/asArray.test.ts +++ b/packages/vest-utils/src/__tests__/asArray.test.ts @@ -1,4 +1,5 @@ import asArray from 'asArray'; +import { describe, it, expect } from 'vitest'; describe('asArray', () => { it('should return an array', () => { diff --git a/packages/vest-utils/src/__tests__/bindNot.test.ts b/packages/vest-utils/src/__tests__/bindNot.test.ts index 2a1bb00b9..88d9aa150 100644 --- a/packages/vest-utils/src/__tests__/bindNot.test.ts +++ b/packages/vest-utils/src/__tests__/bindNot.test.ts @@ -1,12 +1,14 @@ +import { describe, test, expect, vi } from 'vitest'; + import { bindNot } from 'vest-utils'; describe('bindNot', () => { it('Should return return a function', () => { - expect(typeof bindNot(jest.fn())).toBe('function'); + expect(typeof bindNot(vi.fn())).toBe('function'); }); test('calling returned function runs accepted function', () => { - const fn = jest.fn(); + const fn = vi.fn(); expect(fn).not.toHaveBeenCalled(); const not = bindNot(fn); @@ -16,7 +18,7 @@ describe('bindNot', () => { }); it('Should pass arguments to accepted function', () => { - const fn = jest.fn(); + const fn = vi.fn(); const not = bindNot(fn); not(1, 2, 3, 4); diff --git a/packages/vest-utils/src/__tests__/bus.test.ts b/packages/vest-utils/src/__tests__/bus.test.ts index 48d3980d7..9f0ff92af 100644 --- a/packages/vest-utils/src/__tests__/bus.test.ts +++ b/packages/vest-utils/src/__tests__/bus.test.ts @@ -1,4 +1,5 @@ import { createBus } from 'bus'; +import { describe, it, expect, vi } from 'vitest'; describe('bus', () => { it('should be a function', () => { @@ -14,7 +15,7 @@ describe('bus', () => { it('should emit events', () => { const bus = createBus(); - const spy = jest.fn(); + const spy = vi.fn(); bus.on('test', spy); bus.emit('test'); expect(spy).toHaveBeenCalled(); @@ -22,7 +23,7 @@ describe('bus', () => { it('should emit events with data', () => { const bus = createBus(); - const spy = jest.fn(); + const spy = vi.fn(); bus.on('test', spy); bus.emit('test', 'testData'); expect(spy).toHaveBeenCalledWith('testData'); @@ -30,8 +31,8 @@ describe('bus', () => { it('should emit events with multiple listeners', () => { const bus = createBus(); - const spy1 = jest.fn(); - const spy2 = jest.fn(); + const spy1 = vi.fn(); + const spy2 = vi.fn(); bus.on('test', spy1); bus.on('test', spy2); bus.emit('test'); @@ -41,8 +42,8 @@ describe('bus', () => { it('should emit events with multiple listeners and data', () => { const bus = createBus(); - const spy1 = jest.fn(); - const spy2 = jest.fn(); + const spy1 = vi.fn(); + const spy2 = vi.fn(); bus.on('test', spy1); bus.on('test', spy2); bus.emit('test', 'test1'); @@ -52,7 +53,7 @@ describe('bus', () => { test('on returns an object with an `off` function', () => { const bus = createBus(); - const spy = jest.fn(); + const spy = vi.fn(); const off = bus.on('test', spy); expect(off).toBeInstanceOf(Object); expect(off.off).toBeInstanceOf(Function); @@ -60,7 +61,7 @@ describe('bus', () => { test('off should remove a listener', () => { const bus = createBus(); - const spy = jest.fn(); + const spy = vi.fn(); const off = bus.on('test', spy); off.off(); bus.emit('test'); @@ -69,8 +70,8 @@ describe('bus', () => { test('off should only remove specific handler', () => { const bus = createBus(); - const spy1 = jest.fn(); - const spy2 = jest.fn(); + const spy1 = vi.fn(); + const spy2 = vi.fn(); const off = bus.on('test', spy1); bus.on('test', spy2); off.off(); @@ -82,9 +83,9 @@ describe('bus', () => { describe('"ANY" wildcard (*)', () => { it('Should run the wildcard handler on any event', () => { const bus = createBus(); - const spy1 = jest.fn(); - const spy2 = jest.fn(); - const spy3 = jest.fn(); + const spy1 = vi.fn(); + const spy2 = vi.fn(); + const spy3 = vi.fn(); bus.on('t1', spy1); bus.on('t2', spy2); bus.on('*', spy3); @@ -103,10 +104,10 @@ describe('bus', () => { it('Should call the wildcard last, regardless of when it was defined', () => { const bus = createBus(); - const spy1 = jest.fn(); - const spy2 = jest.fn(); - const spy3 = jest.fn(); - const spy4 = jest.fn(); + const spy1 = vi.fn(); + const spy2 = vi.fn(); + const spy3 = vi.fn(); + const spy4 = vi.fn(); bus.on('t1', spy1); bus.on('*', spy4); bus.on('t1', spy2); diff --git a/packages/vest-utils/src/__tests__/cache.test.ts b/packages/vest-utils/src/__tests__/cache.test.ts index d8eae24e1..3a696bd36 100644 --- a/packages/vest-utils/src/__tests__/cache.test.ts +++ b/packages/vest-utils/src/__tests__/cache.test.ts @@ -1,4 +1,5 @@ import _ from 'lodash'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import { cache } from 'vest-utils'; @@ -18,7 +19,7 @@ describe('lib: cache', () => { describe('on cache miss', () => { it('Should call passed cache action function and return its value', () => { - const cacheAction = jest.fn(() => ({})); + const cacheAction = vi.fn(() => ({})); const res = c([{}], cacheAction); expect(cacheAction).toHaveBeenCalledTimes(1); expect(res).toBe(cacheAction.mock.results[0].value); @@ -27,7 +28,7 @@ describe('lib: cache', () => { describe('On cache hit', () => { it('Should return cached result', () => { - const cacheAction = jest.fn(() => { + const cacheAction = vi.fn(() => { Math.random(); }); const depsArray = [true, false, {}]; @@ -38,7 +39,7 @@ describe('lib: cache', () => { }); it('Should return without calling the cache action', () => { - const cacheAction = jest.fn(); + const cacheAction = vi.fn(); const depsArray = [Math.random()]; c(depsArray, cacheAction); expect(cacheAction).toHaveBeenCalledTimes(1); @@ -59,7 +60,7 @@ describe('lib: cache', () => { Array.from({ length: callCount }, (_, i) => { const c = cache(/*maxSize*/ cacheSize); const results = Array.from({ length: callCount }, (_, j) => - c([j], Math.random) + c([j], Math.random), ); if (i < diff) { @@ -74,7 +75,7 @@ describe('lib: cache', () => { }); it('Should take into account the deps array in its entirety', () => { const deps = Array.from({ length: 100 }, () => - _.sample([{}, false, Math.random(), true, () => null]) + _.sample([{}, false, Math.random(), true, () => null]), ); const c = cache(); const res = c([...deps], Math.random); diff --git a/packages/vest-utils/src/__tests__/callEach.test.ts b/packages/vest-utils/src/__tests__/callEach.test.ts index c4eb7e916..a96122581 100644 --- a/packages/vest-utils/src/__tests__/callEach.test.ts +++ b/packages/vest-utils/src/__tests__/callEach.test.ts @@ -1,10 +1,11 @@ import callEach from 'callEach'; +import { describe, it, expect, vi } from 'vitest'; describe('callEach', () => { it('should call all functions in the array', () => { - const mockFn1 = jest.fn(); - const mockFn2 = jest.fn(); - const mockFn3 = jest.fn(); + const mockFn1 = vi.fn(); + const mockFn2 = vi.fn(); + const mockFn3 = vi.fn(); callEach([mockFn1, mockFn2, mockFn3]); diff --git a/packages/vest-utils/src/__tests__/defaultTo.test.ts b/packages/vest-utils/src/__tests__/defaultTo.test.ts index 8886e3d47..9b06ea18e 100644 --- a/packages/vest-utils/src/__tests__/defaultTo.test.ts +++ b/packages/vest-utils/src/__tests__/defaultTo.test.ts @@ -1,9 +1,11 @@ +import { describe, it, expect, vi } from 'vitest'; + import { defaultTo } from 'vest-utils'; describe('defaultTo', () => { describe('When value is a function', () => { it('Should call the function', () => { - const value = jest.fn(() => 'return value'); + const value = vi.fn(() => 'return value'); expect(defaultTo(value, 'fallback value')).toBe('return value'); expect(value).toHaveBeenCalled(); @@ -34,14 +36,14 @@ describe('defaultTo', () => { 'Should return the same value', value => { expect(defaultTo(value, 'fallback value')).toBe(value); - } + }, ); }); }); describe('When the fallback value is a function', () => { it('Should call the function and return its return value', () => { - const fallbackValue = jest.fn(() => 'fallback value'); + const fallbackValue = vi.fn(() => 'fallback value'); expect(defaultTo(null, fallbackValue)).toBe('fallback value'); expect(fallbackValue).toHaveBeenCalled(); diff --git a/packages/vest-utils/src/__tests__/deferThrow.test.ts b/packages/vest-utils/src/__tests__/deferThrow.test.ts index 875ad3e79..9eea1c19a 100644 --- a/packages/vest-utils/src/__tests__/deferThrow.test.ts +++ b/packages/vest-utils/src/__tests__/deferThrow.test.ts @@ -1,11 +1,12 @@ -import { deferThrow } from 'vest-utils'; +import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; +import { deferThrow } from 'vest-utils'; // @ts-ignore const _to = global.setTimeout; describe('deferThrow', () => { beforeEach(() => { // @ts-ignore - global.setTimeout = jest.fn(); + global.setTimeout = vi.fn(); }); afterEach(() => { diff --git a/packages/vest-utils/src/__tests__/either.test.ts b/packages/vest-utils/src/__tests__/either.test.ts index dbabe589b..176887a2e 100644 --- a/packages/vest-utils/src/__tests__/either.test.ts +++ b/packages/vest-utils/src/__tests__/either.test.ts @@ -1,4 +1,5 @@ import either from 'either'; +import { describe, it, expect } from 'vitest'; describe('either', () => { it('returns true if one argument is truthy and the other is falsy', () => { diff --git a/packages/vest-utils/src/__tests__/greaterThan.test.ts b/packages/vest-utils/src/__tests__/greaterThan.test.ts index 8badeedb8..c94eb9b07 100644 --- a/packages/vest-utils/src/__tests__/greaterThan.test.ts +++ b/packages/vest-utils/src/__tests__/greaterThan.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { greaterThan } from 'greaterThan'; +import { describe, it, expect, beforeEach } from 'vitest'; describe('Tests greaterThan rule', () => { describe('Arguments are numbers', () => { @@ -62,7 +62,7 @@ describe('Tests greaterThan rule', () => { // @ts-expect-error - testing invalid input expect(greaterThan(element, 0)).toBe(false); }); - } + }, ); }); }); diff --git a/packages/vest-utils/src/__tests__/invariant.test.ts b/packages/vest-utils/src/__tests__/invariant.test.ts index 4ac8e0972..7137152dc 100644 --- a/packages/vest-utils/src/__tests__/invariant.test.ts +++ b/packages/vest-utils/src/__tests__/invariant.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { invariant } from 'vest-utils'; describe('invariant', () => { diff --git a/packages/vest-utils/src/__tests__/isArray.test.ts b/packages/vest-utils/src/__tests__/isArray.test.ts index 4897f856b..b6a16cc15 100644 --- a/packages/vest-utils/src/__tests__/isArray.test.ts +++ b/packages/vest-utils/src/__tests__/isArray.test.ts @@ -1,4 +1,5 @@ import { isArray } from 'isArrayValue'; +import { describe, it, expect } from 'vitest'; describe('Tests isArray rule', () => { it('Should return true for an empty array', () => { diff --git a/packages/vest-utils/src/__tests__/isBoolean.test.ts b/packages/vest-utils/src/__tests__/isBoolean.test.ts index 41e541c65..6efb96c1f 100644 --- a/packages/vest-utils/src/__tests__/isBoolean.test.ts +++ b/packages/vest-utils/src/__tests__/isBoolean.test.ts @@ -1,4 +1,5 @@ import isBoolean from 'isBooleanValue'; +import { describe, it, expect } from 'vitest'; describe('isBoolean', () => { it('Should pass for a boolean value', () => { diff --git a/packages/vest-utils/src/__tests__/isEmpty.test.ts b/packages/vest-utils/src/__tests__/isEmpty.test.ts index 297661ac9..e254a56af 100644 --- a/packages/vest-utils/src/__tests__/isEmpty.test.ts +++ b/packages/vest-utils/src/__tests__/isEmpty.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { isEmpty } from 'vest-utils'; describe('Tests isEmpty rule', () => { diff --git a/packages/vest-utils/src/__tests__/isNull.test.ts b/packages/vest-utils/src/__tests__/isNull.test.ts index 7e0b09455..8d5b5e746 100644 --- a/packages/vest-utils/src/__tests__/isNull.test.ts +++ b/packages/vest-utils/src/__tests__/isNull.test.ts @@ -1,4 +1,5 @@ import { isNull } from 'isNull'; +import { describe, it, expect } from 'vitest'; describe('Tests isNull rule', () => { it('Should return true for `null` value', () => { diff --git a/packages/vest-utils/src/__tests__/isNumeric.test.ts b/packages/vest-utils/src/__tests__/isNumeric.test.ts index f6f908064..3c461d512 100644 --- a/packages/vest-utils/src/__tests__/isNumeric.test.ts +++ b/packages/vest-utils/src/__tests__/isNumeric.test.ts @@ -1,4 +1,5 @@ import { isNumeric } from 'isNumeric'; +import { describe, it, expect } from 'vitest'; const NUMERICS = ['-10', '0', 0xff, '0xFF', '8e5', '3.1415', +10, '0144']; diff --git a/packages/vest-utils/src/__tests__/isPositive.test.ts b/packages/vest-utils/src/__tests__/isPositive.test.ts index f6cb36fc3..8a3360d32 100644 --- a/packages/vest-utils/src/__tests__/isPositive.test.ts +++ b/packages/vest-utils/src/__tests__/isPositive.test.ts @@ -1,4 +1,5 @@ import { isPositive } from 'isPositive'; +import { describe, it, expect } from 'vitest'; describe('Test isPositive rule', () => { it('Should return false for zero', () => { diff --git a/packages/vest-utils/src/__tests__/isPromise.test.ts b/packages/vest-utils/src/__tests__/isPromise.test.ts index 848da2fa6..abe6b7eaa 100644 --- a/packages/vest-utils/src/__tests__/isPromise.test.ts +++ b/packages/vest-utils/src/__tests__/isPromise.test.ts @@ -1,4 +1,5 @@ import isPromise from 'isPromise'; +import { describe, it, expect } from 'vitest'; describe('isPromise', () => { it('should return true for a Promise', () => { diff --git a/packages/vest-utils/src/__tests__/isString.test.ts b/packages/vest-utils/src/__tests__/isString.test.ts index 68475b2c9..c67ef5ee1 100644 --- a/packages/vest-utils/src/__tests__/isString.test.ts +++ b/packages/vest-utils/src/__tests__/isString.test.ts @@ -1,4 +1,5 @@ import isStringValue from 'isStringValue'; +import { describe, it, expect } from 'vitest'; describe('Tests isString rule', () => { it('Should return false for non-string values', () => { diff --git a/packages/vest-utils/src/__tests__/isUndefined.test.ts b/packages/vest-utils/src/__tests__/isUndefined.test.ts index fda820080..8db80887e 100644 --- a/packages/vest-utils/src/__tests__/isUndefined.test.ts +++ b/packages/vest-utils/src/__tests__/isUndefined.test.ts @@ -1,4 +1,5 @@ import { isUndefined } from 'isUndefined'; +import { describe, it, expect } from 'vitest'; describe('Tests isUndefined rule', () => { it('Should return true for `undefined` value', () => { diff --git a/packages/vest-utils/src/__tests__/lengthEquals.test.ts b/packages/vest-utils/src/__tests__/lengthEquals.test.ts index 4127820ae..21b8c1343 100644 --- a/packages/vest-utils/src/__tests__/lengthEquals.test.ts +++ b/packages/vest-utils/src/__tests__/lengthEquals.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { lengthEquals } from 'lengthEquals'; +import { describe, it, expect } from 'vitest'; describe('Tests lengthEquals rule', () => { const length = 10; diff --git a/packages/vest-utils/src/__tests__/longerThan.test.ts b/packages/vest-utils/src/__tests__/longerThan.test.ts index f0fe31f2e..06ca319ea 100644 --- a/packages/vest-utils/src/__tests__/longerThan.test.ts +++ b/packages/vest-utils/src/__tests__/longerThan.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { longerThan } from 'longerThan'; +import { describe, it, expect } from 'vitest'; describe('Tests longerThan rule', () => { const length = 10; diff --git a/packages/vest-utils/src/__tests__/mapFirst.test.ts b/packages/vest-utils/src/__tests__/mapFirst.test.ts index cca6ba150..2a411ca1a 100644 --- a/packages/vest-utils/src/__tests__/mapFirst.test.ts +++ b/packages/vest-utils/src/__tests__/mapFirst.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { mapFirst } from 'vest-utils'; describe('mapFirst', () => { diff --git a/packages/vest-utils/src/__tests__/nonnullish.test.ts b/packages/vest-utils/src/__tests__/nonnullish.test.ts index c1d5c0b96..9c4626427 100644 --- a/packages/vest-utils/src/__tests__/nonnullish.test.ts +++ b/packages/vest-utils/src/__tests__/nonnullish.test.ts @@ -1,4 +1,5 @@ import { nonnullish } from 'nonnullish'; +import { describe, it, expect } from 'vitest'; describe('nonnullish', () => { it('should return the value if it is not null or undefined', () => { diff --git a/packages/vest-utils/src/__tests__/numberEquals.test.ts b/packages/vest-utils/src/__tests__/numberEquals.test.ts index 9dda865d2..edf00bcbb 100644 --- a/packages/vest-utils/src/__tests__/numberEquals.test.ts +++ b/packages/vest-utils/src/__tests__/numberEquals.test.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; - import { numberEquals } from 'numberEquals'; +import { describe, it, expect, beforeEach } from 'vitest'; describe('Tests numberEquals rule', () => { describe('Arguments are numbers', () => { @@ -61,7 +61,7 @@ describe('Tests numberEquals rule', () => { // @ts-expect-error - testing invalid input expect(numberEquals(element, 0)).toBe(false); }); - } + }, ); }); }); diff --git a/packages/vest-utils/src/__tests__/optionalFunctionValue.test.ts b/packages/vest-utils/src/__tests__/optionalFunctionValue.test.ts index ec973a01f..60f4b3b91 100644 --- a/packages/vest-utils/src/__tests__/optionalFunctionValue.test.ts +++ b/packages/vest-utils/src/__tests__/optionalFunctionValue.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, vi } from 'vitest'; + import { optionalFunctionValue } from 'vest-utils'; describe('optionalFunctionValue', () => { @@ -6,19 +8,19 @@ describe('optionalFunctionValue', () => { 'Should return the same value', value => { expect(optionalFunctionValue(value)).toBe(value); - } + }, ); }); describe('When value is a function', () => { it('Should call the function and return its return value', () => { - const value = jest.fn(() => 'return value'); + const value = vi.fn(() => 'return value'); expect(optionalFunctionValue(value)).toBe('return value'); expect(value).toHaveBeenCalled(); }); it('Should run with arguments array', () => { - const value = jest.fn((...args) => args.join('|')); + const value = vi.fn((...args) => args.join('|')); const args = [1, 2, 3, 4]; expect(optionalFunctionValue(value, ...args)).toBe('1|2|3|4'); expect(value).toHaveBeenCalledWith(...args); diff --git a/packages/vest-utils/src/__tests__/seq.test.ts b/packages/vest-utils/src/__tests__/seq.test.ts index 6aa8d9de1..9bf15d59b 100644 --- a/packages/vest-utils/src/__tests__/seq.test.ts +++ b/packages/vest-utils/src/__tests__/seq.test.ts @@ -1,4 +1,5 @@ import seq, { genSeq } from 'seq'; +import { describe, it, expect } from 'vitest'; describe('lib:seq', () => { it('Should return a new id on each run', () => { diff --git a/packages/vest-utils/src/__tests__/text.test.ts b/packages/vest-utils/src/__tests__/text.test.ts index 0da573924..30cc7f03c 100644 --- a/packages/vest-utils/src/__tests__/text.test.ts +++ b/packages/vest-utils/src/__tests__/text.test.ts @@ -1,14 +1,15 @@ import { text } from 'text'; +import { describe, it, expect } from 'vitest'; describe('text', () => { describe('named substitutions (object)', () => { describe('When all substitutions exist', () => { it('Should replace delimited placeholders', () => { expect(text('this {t} an example', { t: 'was' })).toBe( - 'this was an example' + 'this was an example', ); expect(text('this {t1} {t2} example', { t1: 'was', t2: 'one' })).toBe( - 'this was one example' + 'this was one example', ); }); }); diff --git a/packages/vest-utils/src/__tests__/tinyState.test.ts b/packages/vest-utils/src/__tests__/tinyState.test.ts index 3b0e29bf1..aa3240159 100644 --- a/packages/vest-utils/src/__tests__/tinyState.test.ts +++ b/packages/vest-utils/src/__tests__/tinyState.test.ts @@ -1,4 +1,5 @@ import { createTinyState } from 'tinyState'; +import { describe, it, expect } from 'vitest'; describe('tinyTest', () => { it('Should be a function', () => { diff --git a/packages/vest-utils/src/cache.ts b/packages/vest-utils/src/cache.ts index 0b750e1ea..4ac2cc2c9 100644 --- a/packages/vest-utils/src/cache.ts +++ b/packages/vest-utils/src/cache.ts @@ -10,7 +10,7 @@ export default function createCache(maxSize = 1): CacheApi { const cache = ( deps: unknown[], - cacheAction: (...args: unknown[]) => T + cacheAction: (...args: unknown[]) => T, ): T => { const cacheHit = cache.get(deps); // cache hit is not null @@ -40,7 +40,7 @@ export default function createCache(maxSize = 1): CacheApi { return cacheStorage.findIndex( ([cachedDeps]) => lengthEquals(deps, cachedDeps.length) && - deps.every((dep, i) => dep === cachedDeps[i]) + deps.every((dep, i) => dep === cachedDeps[i]), ); } } diff --git a/packages/vest-utils/src/defaultTo.ts b/packages/vest-utils/src/defaultTo.ts index 08c04def4..f4a9a417f 100644 --- a/packages/vest-utils/src/defaultTo.ts +++ b/packages/vest-utils/src/defaultTo.ts @@ -3,7 +3,7 @@ import { DynamicValue, Nullish } from 'utilityTypes'; export default function defaultTo( value: DynamicValue>, - defaultValue: DynamicValue + defaultValue: DynamicValue, ): T { return optionalFunctionValue(value) ?? optionalFunctionValue(defaultValue); } diff --git a/packages/vest-utils/src/exports/__tests__/minifyObject.test.ts b/packages/vest-utils/src/exports/__tests__/minifyObject.test.ts index 06ff16d96..cd2afdcd0 100644 --- a/packages/vest-utils/src/exports/__tests__/minifyObject.test.ts +++ b/packages/vest-utils/src/exports/__tests__/minifyObject.test.ts @@ -1,4 +1,5 @@ import { expandObject, minifyObject } from 'minifyObject'; +import { describe, it, expect } from 'vitest'; describe('minifyObject', () => { it('should be a function', () => { diff --git a/packages/vest-utils/src/greaterThan.ts b/packages/vest-utils/src/greaterThan.ts index 04dc56707..8201db164 100644 --- a/packages/vest-utils/src/greaterThan.ts +++ b/packages/vest-utils/src/greaterThan.ts @@ -2,7 +2,7 @@ import { isNumeric } from 'isNumeric'; export function greaterThan( value: number | string, - gt: number | string + gt: number | string, ): boolean { return isNumeric(value) && isNumeric(gt) && Number(value) > Number(gt); } diff --git a/packages/vest-utils/src/hasOwnProperty.ts b/packages/vest-utils/src/hasOwnProperty.ts index 7f6330e51..f2f9a12dc 100644 --- a/packages/vest-utils/src/hasOwnProperty.ts +++ b/packages/vest-utils/src/hasOwnProperty.ts @@ -3,7 +3,7 @@ */ export default function hasOwnProperty( obj: T, - key: string | number | symbol + key: string | number | symbol, ): key is keyof T { return Object.prototype.hasOwnProperty.call(obj, key); } diff --git a/packages/vest-utils/src/invariant.ts b/packages/vest-utils/src/invariant.ts index acbe2b792..556e3977d 100644 --- a/packages/vest-utils/src/invariant.ts +++ b/packages/vest-utils/src/invariant.ts @@ -4,7 +4,7 @@ import type { Stringable } from 'utilityTypes'; export default function invariant( condition: any, // eslint-disable-next-line @typescript-eslint/ban-types - message?: String | Stringable + message?: String | Stringable, ): asserts condition { if (condition) { return; diff --git a/packages/vest-utils/src/isFunction.ts b/packages/vest-utils/src/isFunction.ts index aafbf70c3..3378daea0 100644 --- a/packages/vest-utils/src/isFunction.ts +++ b/packages/vest-utils/src/isFunction.ts @@ -1,5 +1,5 @@ export default function isFunction( - value: unknown + value: unknown, ): value is (...args: unknown[]) => unknown { return typeof value === 'function'; } diff --git a/packages/vest-utils/src/lengthEquals.ts b/packages/vest-utils/src/lengthEquals.ts index b3a73dd76..031bccc68 100644 --- a/packages/vest-utils/src/lengthEquals.ts +++ b/packages/vest-utils/src/lengthEquals.ts @@ -3,7 +3,7 @@ import { numberEquals } from 'numberEquals'; export function lengthEquals( value: string | unknown[], - arg1: string | number + arg1: string | number, ): boolean { return numberEquals(value.length, arg1); } diff --git a/packages/vest-utils/src/longerThan.ts b/packages/vest-utils/src/longerThan.ts index 1bbeef245..9bcb3fce7 100644 --- a/packages/vest-utils/src/longerThan.ts +++ b/packages/vest-utils/src/longerThan.ts @@ -2,7 +2,7 @@ import { greaterThan } from 'greaterThan'; export function longerThan( value: string | unknown[], - arg1: string | number + arg1: string | number, ): boolean { return greaterThan(value.length, arg1); } diff --git a/packages/vest-utils/src/mapFirst.ts b/packages/vest-utils/src/mapFirst.ts index cd989f8c1..55f42e80f 100644 --- a/packages/vest-utils/src/mapFirst.ts +++ b/packages/vest-utils/src/mapFirst.ts @@ -3,8 +3,8 @@ export default function mapFirst( callback: ( item: T, breakout: (conditional: boolean, value: unknown) => void, - index: number - ) => unknown + index: number, + ) => unknown, ): any { let broke = false; let breakoutValue = null; diff --git a/packages/vest-utils/src/numberEquals.ts b/packages/vest-utils/src/numberEquals.ts index c2951b386..bc32b4e59 100644 --- a/packages/vest-utils/src/numberEquals.ts +++ b/packages/vest-utils/src/numberEquals.ts @@ -3,7 +3,7 @@ import { isNumeric } from 'isNumeric'; export function numberEquals( value: string | number, - eq: string | number + eq: string | number, ): boolean { return isNumeric(value) && isNumeric(eq) && Number(value) === Number(eq); } diff --git a/packages/vest-utils/src/tinyState.ts b/packages/vest-utils/src/tinyState.ts index 8a6f7ee9f..f1d898e95 100644 --- a/packages/vest-utils/src/tinyState.ts +++ b/packages/vest-utils/src/tinyState.ts @@ -2,7 +2,7 @@ import optionalFunctionValue from 'optionalFunctionValue'; import { DynamicValue } from 'utilityTypes'; export function createTinyState( - initialValue: SetValueInput + initialValue: SetValueInput, ): TinyState { let value: S; @@ -22,7 +22,7 @@ export function createTinyState( export type TinyState = () => [ value: S, setValue: (next: SetValueInput) => void, - resetValue: () => void + resetValue: () => void, ]; type SetValueInput = DynamicValue; diff --git a/packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap b/packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap index 419afc8d7..6075e869a 100644 --- a/packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap +++ b/packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Stateful behavior Should have all fields 1`] = ` +exports[`Stateful behavior > Should have all fields 1`] = ` { "field_1": SummaryBase { "errorCount": 1, diff --git a/packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap b/packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap index 8a3f0265f..97d0c36ac 100644 --- a/packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap +++ b/packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Base behavior Should produce correct validation result 1`] = ` +exports[`Base behavior > Should produce correct validation result 1`] = ` { "done": [Function], "errorCount": 2, diff --git a/packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap b/packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap index 2548791fa..038af42aa 100644 --- a/packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap +++ b/packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Stateful async tests Merges skipped validations from previous suite 1`] = ` +exports[`Stateful async tests > Merges skipped validations from previous suite 1`] = ` { "done": [Function], "errorCount": 1, @@ -97,7 +97,7 @@ exports[`Stateful async tests Merges skipped validations from previous suite 1`] } `; -exports[`Stateful async tests Merges skipped validations from previous suite 2`] = ` +exports[`Stateful async tests > Merges skipped validations from previous suite 2`] = ` SuiteSummary { "errorCount": 2, "errors": [ @@ -200,7 +200,7 @@ SuiteSummary { } `; -exports[`Stateful async tests Merges skipped validations from previous suite 3`] = ` +exports[`Stateful async tests > Merges skipped validations from previous suite 3`] = ` SuiteSummary { "errorCount": 5, "errors": [ diff --git a/packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap b/packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap index 4ce52ac93..75fa4d93a 100644 --- a/packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap +++ b/packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Stateful behavior Should merge skipped fields with previous values 1`] = ` +exports[`Stateful behavior > Should merge skipped fields with previous values 1`] = ` { "done": [Function], "errorCount": 1, @@ -85,7 +85,7 @@ exports[`Stateful behavior Should merge skipped fields with previous values 1`] } `; -exports[`Stateful behavior Should merge skipped fields with previous values 2`] = ` +exports[`Stateful behavior > Should merge skipped fields with previous values 2`] = ` { "done": [Function], "errorCount": 3, @@ -183,7 +183,7 @@ exports[`Stateful behavior Should merge skipped fields with previous values 2`] } `; -exports[`Stateful behavior Should merge skipped fields with previous values 3`] = ` +exports[`Stateful behavior > Should merge skipped fields with previous values 3`] = ` { "done": [Function], "errorCount": 4, @@ -296,7 +296,7 @@ exports[`Stateful behavior Should merge skipped fields with previous values 3`] } `; -exports[`more complex Should run correctly 1`] = ` +exports[`more complex > Should run correctly 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -326,7 +326,7 @@ SuiteSummary { } `; -exports[`more complex Should run correctly 2`] = ` +exports[`more complex > Should run correctly 2`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -384,7 +384,7 @@ SuiteSummary { } `; -exports[`more complex Should run correctly 4`] = ` +exports[`more complex > Should run correctly 4`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -450,7 +450,7 @@ SuiteSummary { } `; -exports[`more complex Should run correctly 6`] = ` +exports[`more complex > Should run correctly 6`] = ` SuiteSummary { "errorCount": 1, "errors": [ diff --git a/packages/vest/src/__tests__/integration.async-tests.test.ts b/packages/vest/src/__tests__/integration.async-tests.test.ts index 748a0d180..3b3848fd7 100644 --- a/packages/vest/src/__tests__/integration.async-tests.test.ts +++ b/packages/vest/src/__tests__/integration.async-tests.test.ts @@ -1,9 +1,10 @@ +import { Modes } from 'Modes'; import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach, beforeAll, test, vi } from 'vitest'; import wait from 'wait'; import { TestPromise } from '../testUtils/testPromise'; -import { Modes } from 'Modes'; import * as vest from 'vest'; function genSuite() { @@ -13,7 +14,7 @@ function genSuite() { vest.test('field_2', 'field_statement_2', () => { vest.enforce(2).equals(3); }); - vest.test('field_3', 'field_statement_3', jest.fn()); + vest.test('field_3', 'field_statement_3', vi.fn()); vest.test('field_4', 'field_statement_4', () => { vest.warn(); throw new Error(); @@ -33,20 +34,20 @@ function genSuite() { let suite: TTestSuite; describe('Stateful behavior', () => { let result, - callback_1 = jest.fn(), - callback_2 = jest.fn(), - callback_3 = jest.fn(), - control = jest.fn(); + callback_1 = vi.fn(), + callback_2 = vi.fn(), + callback_3 = vi.fn(), + control = vi.fn(); beforeEach(() => { suite = genSuite(); }); beforeAll(() => { - callback_1 = jest.fn(); - callback_2 = jest.fn(); - callback_3 = jest.fn(); - control = jest.fn(); + callback_1 = vi.fn(); + callback_2 = vi.fn(); + callback_3 = vi.fn(); + control = vi.fn(); }); test('Should have all fields', () => diff --git a/packages/vest/src/__tests__/integration.base.test.ts b/packages/vest/src/__tests__/integration.base.test.ts index 9e780d7ca..f5ab731c0 100644 --- a/packages/vest/src/__tests__/integration.base.test.ts +++ b/packages/vest/src/__tests__/integration.base.test.ts @@ -1,3 +1,5 @@ +import { describe, test, beforeEach, it, expect } from 'vitest'; + import * as vest from 'vest'; const suite = () => @@ -7,7 +9,7 @@ const suite = () => vest.test('field_2', 'field_statement_2', () => { expect(2).toBe(3); }); - vest.test('field_3', 'field_statement_3', jest.fn()); + vest.test('field_3', 'field_statement_3', vi.fn()); vest.test('field_4', 'field_statement_4', () => { vest.warn(); throw new Error(); @@ -37,7 +39,7 @@ describe('Base behavior', () => { }); it('Should run done callbacks immediately', () => { - const callback = jest.fn(); + const callback = vi.fn(); res.done(callback); expect(callback).toHaveBeenCalled(); diff --git a/packages/vest/src/__tests__/integration.exclusive.test.ts b/packages/vest/src/__tests__/integration.exclusive.test.ts index 6ff6882c5..57ef340eb 100644 --- a/packages/vest/src/__tests__/integration.exclusive.test.ts +++ b/packages/vest/src/__tests__/integration.exclusive.test.ts @@ -1,4 +1,6 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach, test } from 'vitest'; + import * as vest from 'vest'; let suite: TTestSuite; diff --git a/packages/vest/src/__tests__/integration.stateful-async.test.ts b/packages/vest/src/__tests__/integration.stateful-async.test.ts index a30fa266d..e72cec1bb 100644 --- a/packages/vest/src/__tests__/integration.stateful-async.test.ts +++ b/packages/vest/src/__tests__/integration.stateful-async.test.ts @@ -1,12 +1,13 @@ +import { TIsolateTest } from 'IsolateTest'; +import { Modes } from 'Modes'; +import { TFieldName, TGroupName } from 'SuiteResultTypes'; +import { VestTest } from 'VestTest'; +import { describe, it, expect, vi, beforeEach } from 'vitest'; import wait from 'wait'; import { dummyTest } from '../testUtils/testDummy'; import { TestPromise } from '../testUtils/testPromise'; -import { TIsolateTest } from 'IsolateTest'; -import { Modes } from 'Modes'; -import { TFieldName, TGroupName } from 'SuiteResultTypes'; -import { VestTest } from 'VestTest'; import * as vest from 'vest'; type SuiteParams = { skip?: string; skipGroup?: true }; @@ -41,19 +42,19 @@ let validate: vest.Suite< TGroupName, ({ skip, skipGroup }: SuiteParams) => void >; -let callback_1 = jest.fn(), - callback_2 = jest.fn(), - callback_3 = jest.fn(), - callback_4 = jest.fn(), - control = jest.fn(); +let callback_1 = vi.fn(), + callback_2 = vi.fn(), + callback_3 = vi.fn(), + callback_4 = vi.fn(), + control = vi.fn(); describe('Stateful async tests', () => { beforeEach(() => { - callback_1 = jest.fn(); - callback_2 = jest.fn(); - callback_3 = jest.fn(); - callback_4 = jest.fn(); - control = jest.fn(); + callback_1 = vi.fn(); + callback_2 = vi.fn(); + callback_3 = vi.fn(); + callback_4 = vi.fn(); + control = vi.fn(); validate = suite(); }); @@ -121,13 +122,13 @@ describe('Stateful async tests', () => { it('Should discard of re-tested async tests', async () => { const tests: Array = []; - const control = jest.fn(); + const control = vi.fn(); const suite = vest.create(() => { tests.push( vest.test('field_1', tests.length.toString(), async () => { await wait(100); throw new Error(); - }) + }), ); }); suite().done(() => { diff --git a/packages/vest/src/__tests__/integration.stateful-tests.test.ts b/packages/vest/src/__tests__/integration.stateful-tests.test.ts index 9cf0463f9..488b2f45f 100644 --- a/packages/vest/src/__tests__/integration.stateful-tests.test.ts +++ b/packages/vest/src/__tests__/integration.stateful-tests.test.ts @@ -1,6 +1,7 @@ +import { Modes } from 'Modes'; import { enforce } from 'n4s'; +import { describe, it, expect, test } from 'vitest'; -import { Modes } from 'Modes'; import * as vest from 'vest'; describe('Stateful behavior', () => { @@ -133,9 +134,9 @@ describe('more complex', () => { vest.test('confirm', 'passwords do not match', () => { enforce(data.confirm).equals(data.password); }); - } + }, ); - } + }, ); }); @@ -147,7 +148,7 @@ function genSuite() { vest.test('field_2', 'field_statement_2', () => { enforce(2).equals(3); }); - vest.test('field_3', 'field_statement_3', jest.fn()); + vest.test('field_3', 'field_statement_3', vi.fn()); vest.test('field_4', 'field_statement_4', () => { vest.warn(); throw new Error(); diff --git a/packages/vest/src/__tests__/isolate.test.ts b/packages/vest/src/__tests__/isolate.test.ts index a90ae4825..6d8ce5c53 100644 --- a/packages/vest/src/__tests__/isolate.test.ts +++ b/packages/vest/src/__tests__/isolate.test.ts @@ -1,36 +1,23 @@ -import { CB } from 'vest-utils'; -import { TDeferThrow } from 'vest-utils/src/deferThrow'; +import { CB, deferThrow } from 'vest-utils'; import { Isolate } from 'vestjs-runtime'; +import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { TVestMock } from '../testUtils/TVestMock'; -import mockThrowError from '../testUtils/mockThrowError'; -import { TDummyTest } from '../testUtils/testDummy'; +import { dummyTest } from 'testDummy'; +import * as vest from 'vest'; + +vi.mock('vest-utils', async () => { + const vu = await vi.importActual('vest-utils'); + return { + ...vu, + deferThrow: vi.fn(), + }; +}); describe('isolate', () => { - let vest: TVestMock; let firstRun = true; - // eslint-disable-next-line no-unused-expressions - require('IsolateTest').IsolateTest; - // eslint-disable-next-line no-unused-expressions - require('IsolateEach').IsolateEach; - let dummyTest: TDummyTest; - let deferThrow: TDeferThrow; beforeEach(() => { firstRun = true; - const mock = mockThrowError(); - deferThrow = mock.deferThrow; - // eslint-disable-next-line no-unused-expressions - require('IsolateTest').IsolateTest; - // eslint-disable-next-line no-unused-expressions - require('IsolateEach').IsolateEach; - vest = mock.vest; - dummyTest = require('../testUtils/testDummy').dummyTest; - }); - - afterEach(() => { - jest.resetModules(); - jest.resetAllMocks(); }); describe('Base behavior', () => { @@ -40,8 +27,8 @@ describe('isolate', () => { }); it('Should retain test results between runs', () => { - const f1 = jest.fn(() => false); - const f2 = jest.fn(() => false); + const f1 = vi.fn(() => false); + const f2 = vi.fn(() => false); const suite = genSuite(() => { vest.skipWhen(!firstRun, () => { vest.test('f1', f1); @@ -254,13 +241,11 @@ describe('isolate', () => { }); suite(); - expect(deferThrow).toHaveBeenCalledTimes(0); suite(); - expect(deferThrow).toHaveBeenCalledTimes(1); expect(deferThrow).toHaveBeenCalledWith( expect.stringContaining( - 'Vest Critical Error: Tests called in different order than previous run' - ) + 'Vest Critical Error: Tests called in different order than previous run', + ), ); }); }); diff --git a/packages/vest/src/__tests__/state_refill.test.ts b/packages/vest/src/__tests__/state_refill.test.ts index 66cc0f1a0..1cf53194c 100644 --- a/packages/vest/src/__tests__/state_refill.test.ts +++ b/packages/vest/src/__tests__/state_refill.test.ts @@ -1,4 +1,6 @@ import { Modes } from 'Modes'; +import { describe, it, expect } from 'vitest'; + import * as vest from 'vest'; describe('state refill', () => { diff --git a/packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap b/packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap index 7f6d7f260..07e283703 100644 --- a/packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap +++ b/packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`useLoadSuite Calling useLoadSuite should resume from loaded state 1`] = ` +exports[`useLoadSuite > Calling useLoadSuite should resume from loaded state 1`] = ` { "$type": "Suite", "abortController": AbortController {}, @@ -354,7 +354,7 @@ exports[`useLoadSuite Calling useLoadSuite should resume from loaded state 1`] = } `; -exports[`useLoadSuite Calling useLoadSuite should resume from loaded state 2`] = ` +exports[`useLoadSuite > Calling useLoadSuite should resume from loaded state 2`] = ` SuiteSummary { "errorCount": 4, "errors": [ diff --git a/packages/vest/src/core/__tests__/runtime.test.ts b/packages/vest/src/core/__tests__/runtime.test.ts index 3738151be..0fea460d1 100644 --- a/packages/vest/src/core/__tests__/runtime.test.ts +++ b/packages/vest/src/core/__tests__/runtime.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import * as vest from 'vest'; describe('useLoadSuite', () => { diff --git a/packages/vest/src/core/context/SuiteContext.ts b/packages/vest/src/core/context/SuiteContext.ts index ef541e01a..1fd43c707 100644 --- a/packages/vest/src/core/context/SuiteContext.ts +++ b/packages/vest/src/core/context/SuiteContext.ts @@ -23,7 +23,7 @@ export const SuiteContext = createCascade((ctxRef, parentContext) => { suiteParams: [], testMemoCache, }, - ctxRef + ctxRef, ); }); diff --git a/packages/vest/src/core/isolate/IsolateEach/IsolateEach.ts b/packages/vest/src/core/isolate/IsolateEach/IsolateEach.ts index 2099bff6f..8d089051d 100644 --- a/packages/vest/src/core/isolate/IsolateEach/IsolateEach.ts +++ b/packages/vest/src/core/isolate/IsolateEach/IsolateEach.ts @@ -6,7 +6,7 @@ import { VestIsolateType } from 'VestIsolateType'; type TIsolateEach = TIsolate; export function IsolateEach( - callback: Callback + callback: Callback, ): TIsolateEach { return Isolate.create(VestIsolateType.Each, callback, { allowReorder: true, diff --git a/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts b/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts index f601819ce..988d95cac 100644 --- a/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts +++ b/packages/vest/src/core/isolate/IsolateTest/IsolateTest.ts @@ -9,16 +9,16 @@ import { VestIsolateType } from 'VestIsolateType'; export type TIsolateTest< F extends TFieldName = TFieldName, - G extends TGroupName = TGroupName + G extends TGroupName = TGroupName, > = TIsolate & IsolateTestPayload>; export function IsolateTest< F extends TFieldName = TFieldName, - G extends TGroupName = TGroupName + G extends TGroupName = TGroupName, >( callback: CB, input: CommonTestFields, - key?: IsolateKey + key?: IsolateKey, ): TIsolateTest { const payload: IsolateTestPayload = { ...IsolateTestBase(), @@ -37,7 +37,7 @@ export function IsolateTest< VestIsolateType.Test, callback, payload, - key ?? null + key ?? null, ); return isolate as TIsolateTest; @@ -52,7 +52,7 @@ export function IsolateTestBase() { export type IsolateTestPayload< F extends TFieldName = TFieldName, - G extends TGroupName = TGroupName + G extends TGroupName = TGroupName, > = CommonTestFields & { severity: TestSeverity; status: TestStatus; @@ -61,7 +61,7 @@ export type IsolateTestPayload< type CommonTestFields< F extends TFieldName = TFieldName, - G extends TGroupName = TGroupName + G extends TGroupName = TGroupName, > = { message?: Maybe; groupName?: G; diff --git a/packages/vest/src/core/isolate/IsolateTest/VestTest.ts b/packages/vest/src/core/isolate/IsolateTest/VestTest.ts index 908894d83..2a01093f5 100644 --- a/packages/vest/src/core/isolate/IsolateTest/VestTest.ts +++ b/packages/vest/src/core/isolate/IsolateTest/VestTest.ts @@ -20,7 +20,7 @@ export class VestTest extends VestIsolate { static getData< F extends TFieldName = TFieldName, - G extends TGroupName = TGroupName + G extends TGroupName = TGroupName, >(test: TIsolateTest) { invariant(test.data); return test.data; @@ -29,7 +29,7 @@ export class VestTest extends VestIsolate { static is(isolate?: Maybe): isolate is TIsolateTest { return IsolateSelectors.isIsolateType( isolate, - VestIsolateType.Test + VestIsolateType.Test, ); } @@ -38,7 +38,7 @@ export class VestTest extends VestIsolate { } static cast( - isolate?: Maybe + isolate?: Maybe, ): TIsolateTest { VestTest.isX(isolate); return isolate as TIsolateTest; @@ -115,7 +115,7 @@ export class VestTest extends VestIsolate { static fail(test: TIsolateTest): void { VestTest.setStatus( test, - VestTest.warns(test) ? TestStatus.WARNING : TestStatus.FAILED + VestTest.warns(test) ? TestStatus.WARNING : TestStatus.FAILED, ); } @@ -134,7 +134,7 @@ export class VestTest extends VestIsolate { test: TIsolateTest, setter: | ((current: TIsolateTest['data']) => TIsolateTest['data']) - | TIsolateTest['data'] + | TIsolateTest['data'], ): void { test.data = optionalFunctionValue(setter, VestTest.getData(test)); } diff --git a/packages/vest/src/core/isolate/IsolateTest/__tests__/VestTestInspector.test.ts b/packages/vest/src/core/isolate/IsolateTest/__tests__/VestTestInspector.test.ts index 167c47d06..16b8bd1f5 100644 --- a/packages/vest/src/core/isolate/IsolateTest/__tests__/VestTestInspector.test.ts +++ b/packages/vest/src/core/isolate/IsolateTest/__tests__/VestTestInspector.test.ts @@ -2,6 +2,7 @@ import { TIsolateTest } from 'IsolateTest'; import { TestStatus } from 'IsolateTestStateMachine'; import { VestTest } from 'VestTest'; import { mockIsolateTest } from 'vestMocks'; +import { describe, it, expect, beforeEach } from 'vitest'; describe('VestTest', () => { let testObject: TIsolateTest; diff --git a/packages/vest/src/core/isolate/IsolateTest/__tests__/hasRemainingTests.test.ts b/packages/vest/src/core/isolate/IsolateTest/__tests__/hasRemainingTests.test.ts index 11de5a269..40a1cc4de 100644 --- a/packages/vest/src/core/isolate/IsolateTest/__tests__/hasRemainingTests.test.ts +++ b/packages/vest/src/core/isolate/IsolateTest/__tests__/hasRemainingTests.test.ts @@ -1,6 +1,7 @@ +import { SuiteWalker } from 'SuiteWalker'; +import { describe, it, expect, beforeEach } from 'vitest'; import wait from 'wait'; -import { SuiteWalker } from 'SuiteWalker'; import * as vest from 'vest'; describe('SuiteWalker.useHasRemainingWithTestNameMatching', () => { diff --git a/packages/vest/src/core/isolate/IsolateTest/cancelOverriddenPendingTest.ts b/packages/vest/src/core/isolate/IsolateTest/cancelOverriddenPendingTest.ts index 2ca3479a3..af2da2b56 100644 --- a/packages/vest/src/core/isolate/IsolateTest/cancelOverriddenPendingTest.ts +++ b/packages/vest/src/core/isolate/IsolateTest/cancelOverriddenPendingTest.ts @@ -4,7 +4,7 @@ import { isSameProfileTest } from 'isSameProfileTest'; export default function cancelOverriddenPendingTest( prevRunTestObject: TIsolateTest, - currentRunTestObject: TIsolateTest + currentRunTestObject: TIsolateTest, ): void { if ( currentRunTestObject !== prevRunTestObject && diff --git a/packages/vest/src/core/test/__tests__/IsolateTest.test.ts b/packages/vest/src/core/test/__tests__/IsolateTest.test.ts index 44e6e4d58..2ab6ea20e 100644 --- a/packages/vest/src/core/test/__tests__/IsolateTest.test.ts +++ b/packages/vest/src/core/test/__tests__/IsolateTest.test.ts @@ -1,11 +1,12 @@ +import { TIsolateTest } from 'IsolateTest'; +import { VestTest } from 'VestTest'; +import { mockIsolateTest } from 'vestMocks'; +import { describe, it, expect, beforeEach, test, vi } from 'vitest'; import wait from 'wait'; import { TestPromise } from '../../../testUtils/testPromise'; -import { TIsolateTest } from 'IsolateTest'; -import { VestTest } from 'VestTest'; import * as vest from 'vest'; -import { mockIsolateTest } from 'vestMocks'; const fieldName = 'unicycle'; const message = 'I am Root.'; @@ -38,10 +39,6 @@ describe('IsolateTest', () => { testObject = mockIsolateTest({ fieldName, message }); }); - afterEach(() => { - jest.resetAllMocks(); - }); - it('Should set status to failed', () => { expect(VestTest.isFailing(testObject)).toBe(false); VestTest.fail(testObject); @@ -70,9 +67,9 @@ describe('IsolateTest', () => { }); describe('final statuses', () => { - let control = jest.fn(); + const control = vi.fn(); beforeEach(() => { - control = jest.fn(); + vi.resetAllMocks(); }); it('keep status unchanged when `failed`', () => { vest.create(() => { diff --git a/packages/vest/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap b/packages/vest/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap index cca6b3055..e2772cba1 100644 --- a/packages/vest/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap +++ b/packages/vest/src/core/test/__tests__/__snapshots__/IsolateTest.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`IsolateTest TestObject constructor 1`] = ` +exports[`IsolateTest > TestObject constructor 1`] = ` { "$type": "UnitTest", "children": [], @@ -8,7 +8,7 @@ exports[`IsolateTest TestObject constructor 1`] = ` "fieldName": "unicycle", "message": "I am Root.", "severity": "error", - "testFn": [MockFunction], + "testFn": [MockFunction spy], "type": "Test", }, "key": null, @@ -19,7 +19,7 @@ exports[`IsolateTest TestObject constructor 1`] = ` } `; -exports[`IsolateTest testObject.warn Should mark the test as warning 1`] = ` +exports[`IsolateTest > testObject.warn > Should mark the test as warning 1`] = ` { "$type": "UnitTest", "children": [], @@ -27,7 +27,7 @@ exports[`IsolateTest testObject.warn Should mark the test as warning 1`] = ` "fieldName": "unicycle", "message": "I am Root.", "severity": "warning", - "testFn": [MockFunction], + "testFn": [MockFunction spy], "type": "Test", }, "key": null, diff --git a/packages/vest/src/core/test/__tests__/__snapshots__/memo.test.ts.snap b/packages/vest/src/core/test/__tests__/__snapshots__/memo.test.ts.snap index 7a6958c86..ac111b588 100644 --- a/packages/vest/src/core/test/__tests__/__snapshots__/memo.test.ts.snap +++ b/packages/vest/src/core/test/__tests__/__snapshots__/memo.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`test.memo cache hit Should produce correct initial result 1`] = ` +exports[`test.memo > cache hit > Should produce correct initial result 1`] = ` { "done": [Function], "errorCount": 1, @@ -73,7 +73,7 @@ exports[`test.memo cache hit Should produce correct initial result 1`] = ` } `; -exports[`test.memo cache hit sync Should restore previous result on re-run 1`] = ` +exports[`test.memo > cache hit > sync > Should restore previous result on re-run 1`] = ` { "done": [Function], "errorCount": 1, diff --git a/packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap b/packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap index 405ce559f..3fa46eb27 100644 --- a/packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap +++ b/packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap @@ -1,8 +1,8 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Test Vest's \`test\` function test params creates a test with a message and with a key 1`] = `"[{"$type":"Test","data":{"severity":"error","fieldName":"field_name","message":"failure message"},"status":"PASSING","key":"keyboardcat"},{}]"`; +exports[`Test Vest's \`test\` function > test params > creates a test with a message and with a key 1`] = `"[{"$type":"Test","data":{"severity":"error","fieldName":"field_name","message":"failure message"},"status":"PASSING","key":"keyboardcat"},{}]"`; -exports[`Test Vest's \`test\` function test params creates a test without a key 1`] = ` +exports[`Test Vest's \`test\` function > test params > creates a test without a key 1`] = ` { "$type": "Test", "abortController": AbortController {}, @@ -74,7 +74,7 @@ exports[`Test Vest's \`test\` function test params creates a test without a key } `; -exports[`Test Vest's \`test\` function test params creates a test without a message and with a key 1`] = ` +exports[`Test Vest's \`test\` function > test params > creates a test without a message and with a key 1`] = ` { "$type": "Test", "abortController": AbortController {}, @@ -147,7 +147,7 @@ exports[`Test Vest's \`test\` function test params creates a test without a mess } `; -exports[`Test Vest's \`test\` function test params creates a test without a message and without a key 1`] = ` +exports[`Test Vest's \`test\` function > test params > creates a test without a message and without a key 1`] = ` { "$type": "Test", "abortController": AbortController {}, diff --git a/packages/vest/src/core/test/__tests__/key.test.ts b/packages/vest/src/core/test/__tests__/key.test.ts index 218d9bfc0..d694f2463 100644 --- a/packages/vest/src/core/test/__tests__/key.test.ts +++ b/packages/vest/src/core/test/__tests__/key.test.ts @@ -1,11 +1,17 @@ -import { TDeferThrow } from 'vest-utils/src/deferThrow'; - -import { TVestMock } from '../../../testUtils/TVestMock'; -import mockThrowError from '../../../testUtils/mockThrowError'; +import { deferThrow } from 'vest-utils'; +import { describe, it, expect, vi } from 'vitest'; import { TIsolateTest } from 'IsolateTest'; import * as vest from 'vest'; +vi.mock('vest-utils', async () => { + const vu = await vi.importActual('vest-utils'); + return { + ...vu, + deferThrow: vi.fn(), + }; +}); + describe('key', () => { describe('When key is provided', () => { describe('When tests change their order between runs', () => { @@ -77,14 +83,6 @@ describe('key', () => { }); describe('When tests without a key reorder get added above a test with a key', () => { - let vest: TVestMock; - beforeEach(() => { - vest = mockThrowError().vest; - }); - afterEach(() => { - jest.resetModules(); - jest.resetAllMocks(); - }); it('Should retain keyd tests', () => { const calls: TIsolateTest[][] = []; const suite = vest.create(() => { @@ -108,6 +106,8 @@ describe('key', () => { const res1 = suite(); const res2 = suite(); + expect(deferThrow).toHaveBeenCalled(); + expect(calls[0][0]).toBe(calls[1][0]); expect(calls[0][1]).toBe(calls[1][1]); expect(calls[0][2]).toBe(calls[1][2]); @@ -199,24 +199,12 @@ describe('key', () => { }); describe('When the same key is encountered twice', () => { - let deferThrow: TDeferThrow, vest: TVestMock; - beforeEach(() => { - const mock = mockThrowError(); - - deferThrow = mock.deferThrow; - vest = mock.vest; - }); - - afterEach(() => { - jest.resetAllMocks(); - jest.resetModules(); - }); - - it('Should throw a deferred error', () => { + it('Should throw a deferred error', async () => { const suite = vest.create(() => { vest.test('field1', () => false, 'key_1'); vest.test('field2', () => false, 'key_1'); }); + suite(); expect(deferThrow).toHaveBeenCalledWith( `Encountered the same key "key_1" twice. This may lead to inconsistent or overriding of results.`, diff --git a/packages/vest/src/core/test/__tests__/memo.test.ts b/packages/vest/src/core/test/__tests__/memo.test.ts index 7d8d1e761..f0afeeb52 100644 --- a/packages/vest/src/core/test/__tests__/memo.test.ts +++ b/packages/vest/src/core/test/__tests__/memo.test.ts @@ -1,19 +1,20 @@ -import wait from 'wait'; - -import { TestPromise } from '../../../testUtils/testPromise'; - import { TIsolateTest } from 'IsolateTest'; import { Modes } from 'Modes'; import { VestTest } from 'VestTest'; import promisify from 'promisify'; +import { describe, it, expect, vi } from 'vitest'; +import wait from 'wait'; + +import { TestPromise } from '../../../testUtils/testPromise'; + import * as vest from 'vest'; import { test as vestTest, enforce } from 'vest'; describe('test.memo', () => { describe('cache hit', () => { it('Should return without calling callback', () => { - const cb1 = jest.fn(); - const cb2 = jest.fn(() => TestPromise(() => undefined)); + const cb1 = vi.fn(); + const cb2 = vi.fn(() => TestPromise(() => undefined)); const suite = vest.create(() => { vestTest.memo('f1', cb1, [1]); vestTest.memo('f1', cb2, [2]); @@ -39,7 +40,7 @@ describe('test.memo', () => { vest.warn(); return false; }, - [{}] + [{}], ); })(); @@ -61,7 +62,7 @@ describe('test.memo', () => { vest.warn(); return false; }, - [4] + [4], ); }); @@ -90,7 +91,7 @@ describe('test.memo', () => { await wait(500); enforce(1).equals(2); }, - [1] + [1], ); vestTest.memo( 'field2', @@ -98,7 +99,7 @@ describe('test.memo', () => { await wait(500); enforce(1).equals(2); }, - [2] + [2], ); }); @@ -129,8 +130,8 @@ describe('test.memo', () => { async () => { await wait(10); }, - [true] - ) + [true], + ), ); if (count === 1) { @@ -150,9 +151,9 @@ describe('test.memo', () => { describe('cache miss', () => { it('Should run test normally', () => { - const cb1 = jest.fn(res => res); - const cb2 = jest.fn( - res => new Promise((resolve, rej) => (res ? resolve() : rej())) + const cb1 = vi.fn(res => res); + const cb2 = vi.fn( + res => new Promise((resolve, rej) => (res ? resolve() : rej())), ); const suite = vest.create((key, res) => { vestTest.memo('f1', () => cb1(res), [1, key]); diff --git a/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts b/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts index 6edde051c..ae3851dc6 100644 --- a/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts +++ b/packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts @@ -1,11 +1,21 @@ -import { TTestSuite, TVestMock } from '../../../testUtils/TVestMock'; -import mockThrowError from '../../../testUtils/mockThrowError'; +import { deferThrow } from 'vest-utils'; +import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; + +import { TTestSuite } from '../../../testUtils/TVestMock'; import { dummyTest } from '../../../testUtils/testDummy'; import { TIsolateTest } from 'IsolateTest'; import { Modes } from 'Modes'; import * as vest from 'vest'; +vi.mock('vest-utils', async () => { + const vu = await vi.importActual('vest-utils'); + return { + ...vu, + deferThrow: vi.fn(), + }; +}); + describe('Merging of previous test runs', () => { let suite: TTestSuite; let counter = 0; @@ -15,6 +25,7 @@ describe('Merging of previous test runs', () => { counter = 0; testContainer = []; }); + describe('When test skipped in subsequent run', () => { it('Should merge its result from previous runs', () => { suite = vest.create(() => { @@ -76,22 +87,11 @@ describe('Merging of previous test runs', () => { }); describe('When tests are passed in a different order between runs', () => { - let deferThrow: (message: string) => void, vest: TVestMock; - beforeEach(() => { - const mock = mockThrowError(); - deferThrow = mock.deferThrow; - vest = mock.vest; - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - it('Should defer-throw an error', () => { suite = vest.create(() => { testContainer.push([ counter === 0 - ? vest.test('f1', jest.fn()) + ? vest.test('f1', vi.fn()) : vest.test('f2', () => false), ]); counter++; @@ -101,11 +101,10 @@ describe('Merging of previous test runs', () => { expect(deferThrow).not.toHaveBeenCalled(); suite(); - expect(deferThrow).toHaveBeenCalledWith( expect.stringContaining( - 'Vest Critical Error: Tests called in different order than previous run.' - ) + 'Vest Critical Error: Tests called in different order than previous run.', + ), ); }); @@ -337,7 +336,7 @@ describe('Merging of previous test runs', () => { () => { vest.test('f4', () => false); vest.test('f5', () => false); - } + }, ); counter++; }); diff --git a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts index 575ee890e..f7e062a6e 100644 --- a/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts +++ b/packages/vest/src/core/test/__tests__/runAsyncTest.test.ts @@ -1,7 +1,8 @@ -import wait from 'wait'; - import { TIsolateTest } from 'IsolateTest'; import { VestTest } from 'VestTest'; +import { describe, it, expect, vi } from 'vitest'; +import wait from 'wait'; + import * as vest from 'vest'; describe('runAsyncTest', () => { @@ -26,9 +27,9 @@ describe('runAsyncTest', () => { describe('Callbacks', () => { describe('When there are no remaining pending tests', () => { it('Should run all callbacks', async () => { - const cb1 = jest.fn(); - const cb2 = jest.fn(); - const cb3 = jest.fn(); + const cb1 = vi.fn(); + const cb2 = vi.fn(); + const cb3 = vi.fn(); const suite = vest.create(() => { vest.test('field_1', async () => { @@ -58,9 +59,9 @@ describe('runAsyncTest', () => { describe('When there are remaining pending tests', () => { it('Should only run callbacks for completed tests', async () => { - const cb1 = jest.fn(); - const cb2 = jest.fn(); - const cb3 = jest.fn(); + const cb1 = vi.fn(); + const cb2 = vi.fn(); + const cb3 = vi.fn(); const suite = vest.create(() => { vest.test('field_1', async () => { @@ -89,9 +90,9 @@ describe('runAsyncTest', () => { describe('When the test run was canceled', () => { it('Should not run the callbacks', async () => { - const cb1 = jest.fn(); - const cb2 = jest.fn(); - const cb3 = jest.fn(); + const cb1 = vi.fn(); + const cb2 = vi.fn(); + const cb3 = vi.fn(); const testObject: Array = []; @@ -99,7 +100,7 @@ describe('runAsyncTest', () => { testObject.push( vest.test('field_1', async () => { await wait(10); - }) + }), ); vest.test('field_2', () => {}); }); diff --git a/packages/vest/src/core/test/__tests__/test.test.ts b/packages/vest/src/core/test/__tests__/test.test.ts index 9ac8af15d..64722f5ee 100644 --- a/packages/vest/src/core/test/__tests__/test.test.ts +++ b/packages/vest/src/core/test/__tests__/test.test.ts @@ -1,12 +1,13 @@ import { faker } from '@faker-js/faker'; +import { ErrorStrings } from 'ErrorStrings'; +import { TIsolateTest } from 'IsolateTest'; +import { VestTest } from 'VestTest'; import { text } from 'vest-utils'; import { IsolateSerializer } from 'vestjs-runtime'; +import { describe, it, expect, vi } from 'vitest'; import { TestPromise } from '../../../testUtils/testPromise'; -import { ErrorStrings } from 'ErrorStrings'; -import { TIsolateTest } from 'IsolateTest'; -import { VestTest } from 'VestTest'; import { enforce } from 'vest'; import * as vest from 'vest'; @@ -196,7 +197,7 @@ describe("Test Vest's `test` function", () => { }); it('throws when field name is not a string', () => { - const control = jest.fn(); + const control = vi.fn(); vest.create(() => { // @ts-ignore expect(() => vest.test(undefined, () => undefined)).toThrow( @@ -230,7 +231,7 @@ describe("Test Vest's `test` function", () => { }); it('throws when callback is not a function', () => { - const control = jest.fn(); + const control = vi.fn(); vest.create(() => { // @ts-expect-error expect(() => vest.test('x')).toThrow( diff --git a/packages/vest/src/core/test/__tests__/testFunctionPayload.test.ts b/packages/vest/src/core/test/__tests__/testFunctionPayload.test.ts index e34248f8a..396eca5e1 100644 --- a/packages/vest/src/core/test/__tests__/testFunctionPayload.test.ts +++ b/packages/vest/src/core/test/__tests__/testFunctionPayload.test.ts @@ -1,10 +1,12 @@ +import { describe, it, expect, vi } from 'vitest'; + import * as vest from 'vest'; describe('Test Function Payload', () => { describe('AbortSignal', () => { it('Should pass abort signal to test functions', () => { - const testFnSync = jest.fn(); - const testFnAsync = jest.fn().mockResolvedValue(undefined); + const testFnSync = vi.fn(); + const testFnAsync = vi.fn().mockResolvedValue(undefined); const suite = vest.create(() => { vest.test('field_1', testFnSync); vest.test('field_2', testFnAsync); @@ -17,7 +19,7 @@ describe('Test Function Payload', () => { describe('When test is not canceled', () => { it('Should proceed without aborting the test', async () => { - const testFn = jest.fn().mockResolvedValue(undefined); + const testFn = vi.fn().mockResolvedValue(undefined); const suite = vest.create(() => { vest.test('field_1', testFn); }); @@ -29,7 +31,7 @@ describe('Test Function Payload', () => { describe('When test is canceled', () => { it('Should abort the test', async () => { - const testFn = jest.fn().mockResolvedValue(undefined); + const testFn = vi.fn().mockResolvedValue(undefined); const suite = vest.create(() => { vest.test('field_1', testFn); }); @@ -41,7 +43,7 @@ describe('Test Function Payload', () => { }); it('Should set the reason to `canceled`', async () => { - const testFn = jest.fn().mockResolvedValue(undefined); + const testFn = vi.fn().mockResolvedValue(undefined); const suite = vest.create(() => { vest.test('field_1', testFn); }); @@ -54,8 +56,8 @@ describe('Test Function Payload', () => { describe('Multiple async tests', () => { it('Should abort only the canceled test', async () => { - const testFn1 = jest.fn().mockResolvedValue(undefined); - const testFn2 = jest.fn().mockResolvedValue(undefined); + const testFn1 = vi.fn().mockResolvedValue(undefined); + const testFn2 = vi.fn().mockResolvedValue(undefined); const suite = vest.create((only?: string) => { vest.only(only); @@ -75,9 +77,9 @@ describe('Test Function Payload', () => { }); function callPayload( - fn: jest.Mock, + fn: vi.Mock, call: number = 0, - arg: number = 0 + arg: number = 0, ) { return fn.mock.calls[call][arg]; } diff --git a/packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts b/packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts index 698da5f83..40f182a22 100644 --- a/packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts +++ b/packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts @@ -1,9 +1,9 @@ -import { VestTest } from 'VestTest'; - import { TIsolateTest } from 'IsolateTest'; import { Severity } from 'Severity'; +import { VestTest } from 'VestTest'; import { nonMatchingSeverityProfile } from 'nonMatchingSeverityProfile'; import { mockIsolateTest } from 'vestMocks'; +import { describe, it, expect, beforeEach } from 'vitest'; describe('nonMatchingSeverityProfile', () => { let testObject: TIsolateTest; @@ -18,7 +18,7 @@ describe('nonMatchingSeverityProfile', () => { it('should return false', () => { VestTest.warn(testObject); expect(nonMatchingSeverityProfile(Severity.WARNINGS, testObject)).toBe( - false + false, ); }); }); @@ -26,7 +26,7 @@ describe('nonMatchingSeverityProfile', () => { describe('When both are not warning', () => { it('should return false', () => { expect(nonMatchingSeverityProfile(Severity.ERRORS, testObject)).toBe( - false + false, ); }); }); @@ -37,7 +37,7 @@ describe('nonMatchingSeverityProfile', () => { it('should return true', () => { VestTest.warn(testObject); expect(nonMatchingSeverityProfile(Severity.ERRORS, testObject)).toBe( - true + true, ); }); }); @@ -45,7 +45,7 @@ describe('nonMatchingSeverityProfile', () => { describe('When severity is warning', () => { it('should return true', () => { expect(nonMatchingSeverityProfile(Severity.WARNINGS, testObject)).toBe( - true + true, ); }); }); diff --git a/packages/vest/src/core/test/helpers/matchingGroupName.ts b/packages/vest/src/core/test/helpers/matchingGroupName.ts index d410b8fc7..75ba66d72 100644 --- a/packages/vest/src/core/test/helpers/matchingGroupName.ts +++ b/packages/vest/src/core/test/helpers/matchingGroupName.ts @@ -8,7 +8,7 @@ export const nonMatchingGroupName = bindNot(matchingGroupName); export function matchingGroupName( testObject: TIsolateTest, - groupName: Maybe + groupName: Maybe, ): boolean { return VestTest.getData(testObject).groupName === groupName; } diff --git a/packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts b/packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts index 7c7fbcf8f..67473fa37 100644 --- a/packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts +++ b/packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts @@ -9,7 +9,7 @@ import { VestTest } from 'VestTest'; */ export function nonMatchingSeverityProfile( severity: Severity, - testObject: TIsolateTest + testObject: TIsolateTest, ): boolean { return either(severity === Severity.WARNINGS, VestTest.warns(testObject)); } diff --git a/packages/vest/src/core/test/helpers/shouldUseErrorMessage.ts b/packages/vest/src/core/test/helpers/shouldUseErrorMessage.ts index c29724f63..aa381d004 100644 --- a/packages/vest/src/core/test/helpers/shouldUseErrorMessage.ts +++ b/packages/vest/src/core/test/helpers/shouldUseErrorMessage.ts @@ -2,7 +2,7 @@ import { Maybe, isStringValue, isUndefined } from 'vest-utils'; export function shouldUseErrorAsMessage( message: Maybe, - error: unknown + error: unknown, ): error is Maybe { // kind of cheating with this safe guard, but it does the job return isUndefined(message) && isStringValue(error); diff --git a/packages/vest/src/core/test/test.memo.ts b/packages/vest/src/core/test/test.memo.ts index 7d1d5c5df..2df21ef30 100644 --- a/packages/vest/src/core/test/test.memo.ts +++ b/packages/vest/src/core/test/test.memo.ts @@ -47,7 +47,7 @@ export function wrapTestMemo(test: VTest): TestMemo { function useGetTestFromCache( dependencies: any[], - cacheAction: CB + cacheAction: CB, ): TIsolateTest { const cache = useTestMemoCache(); @@ -80,7 +80,7 @@ type ParametersWithoutMessage = [test: TestFn, dependencies: unknown[]]; type ParametersWithMessage = [ message: string, test: TestFn, - dependencies: unknown[] + dependencies: unknown[], ]; type ParamsOverload = ParametersWithoutMessage | ParametersWithMessage; diff --git a/packages/vest/src/core/test/test.ts b/packages/vest/src/core/test/test.ts index 8e1e732e5..ec3e61a34 100644 --- a/packages/vest/src/core/test/test.ts +++ b/packages/vest/src/core/test/test.ts @@ -13,19 +13,19 @@ import { wrapTestMemo } from 'test.memo'; function vestTest( fieldName: F, message: string, - cb: TestFn + cb: TestFn, ): TIsolateTest; function vestTest(fieldName: F, cb: TestFn): TIsolateTest; function vestTest( fieldName: F, message: string, cb: TestFn, - key: IsolateKey + key: IsolateKey, ): TIsolateTest; function vestTest( fieldName: F, cb: TestFn, - key: IsolateKey + key: IsolateKey, ): TIsolateTest; // @vx-allow use-use function vestTest( @@ -66,7 +66,7 @@ function validateTestParams(fieldName: string, testFn: TestFn): void { fn_name: fnName, param: 'fieldName', expected: 'string', - }) + }), ); invariant( isFunction(testFn), @@ -74,6 +74,6 @@ function validateTestParams(fieldName: string, testFn: TestFn): void { fn_name: fnName, param: 'callback', expected: 'function', - }) + }), ); } diff --git a/packages/vest/src/exports/__tests__/SuiteSerializer.test.ts b/packages/vest/src/exports/__tests__/SuiteSerializer.test.ts index 3fb676811..ca58221dd 100644 --- a/packages/vest/src/exports/__tests__/SuiteSerializer.test.ts +++ b/packages/vest/src/exports/__tests__/SuiteSerializer.test.ts @@ -1,4 +1,6 @@ import { SuiteSerializer } from 'SuiteSerializer'; +import { describe, it, expect } from 'vitest'; + import * as vest from 'vest'; describe('SuiteSerializer', () => { diff --git a/packages/vest/src/exports/__tests__/__snapshots__/SuiteSerializer.test.ts.snap b/packages/vest/src/exports/__tests__/__snapshots__/SuiteSerializer.test.ts.snap index de6445f54..a5a5fa44f 100644 --- a/packages/vest/src/exports/__tests__/__snapshots__/SuiteSerializer.test.ts.snap +++ b/packages/vest/src/exports/__tests__/__snapshots__/SuiteSerializer.test.ts.snap @@ -1,8 +1,8 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SuiteSerializer Should produce a valid serialized dump 1`] = `"[{"0":"Suite","1":"9","2":{},"a":[{"0":"Focused","1":"9","2":{"focusMode":0,"match":["d"],"matchAll":false}},{"0":"3","1":"FAILED","2":{"4":"5","6":"d","7":"field_1_message"}},{"0":"3","1":"8","2":{"4":"5","6":"field_2","7":"field_2_message"}},{"0":"Group","1":"9","a":[{"0":"3","1":"8","2":{"4":"5","6":"e","7":"field_3_message_1","b":"c"}},{"0":"3","1":"8","2":{"4":"5","6":"e","7":"field_3_message_2","b":"c"}},{"0":"3","1":"8","2":{"4":"5","6":"field_4","7":"field_4_message","b":"c"}}]},{"0":"SkipWhen","1":"9","a":[{"0":"3","1":"8","2":{"4":"5","6":"field_5","7":"field_5_message"}}]}]},{"0":"$type","1":"status","2":"data","3":"Test","4":"severity","5":"error","6":"fieldName","7":"message","8":"SKIPPED","9":"DONE","a":"children","b":"groupName","c":"group_1","d":"field_1","e":"field_3"}]"`; +exports[`SuiteSerializer > Should produce a valid serialized dump 1`] = `"[{"0":"Suite","1":"9","2":{},"a":[{"0":"Focused","1":"9","2":{"focusMode":0,"match":["d"],"matchAll":false}},{"0":"3","1":"FAILED","2":{"4":"5","6":"d","7":"field_1_message"}},{"0":"3","1":"8","2":{"4":"5","6":"field_2","7":"field_2_message"}},{"0":"Group","1":"9","a":[{"0":"3","1":"8","2":{"4":"5","6":"e","7":"field_3_message_1","b":"c"}},{"0":"3","1":"8","2":{"4":"5","6":"e","7":"field_3_message_2","b":"c"}},{"0":"3","1":"8","2":{"4":"5","6":"field_4","7":"field_4_message","b":"c"}}]},{"0":"SkipWhen","1":"9","a":[{"0":"3","1":"8","2":{"4":"5","6":"field_5","7":"field_5_message"}}]}]},{"0":"$type","1":"status","2":"data","3":"Test","4":"severity","5":"error","6":"fieldName","7":"message","8":"SKIPPED","9":"DONE","a":"children","b":"groupName","c":"group_1","d":"field_1","e":"field_3"}]"`; -exports[`suite.resume Running the suite after resuming Sanity - suite should run as expected Should have correct state after resuming 1`] = ` +exports[`suite.resume > Running the suite after resuming > Sanity - suite should run as expected > Should have correct state after resuming 1`] = ` { "field_1": [ "field_1_message", diff --git a/packages/vest/src/exports/__tests__/classnames.test.ts b/packages/vest/src/exports/__tests__/classnames.test.ts index 5d547f84b..fe998d1aa 100644 --- a/packages/vest/src/exports/__tests__/classnames.test.ts +++ b/packages/vest/src/exports/__tests__/classnames.test.ts @@ -1,8 +1,10 @@ +import { Modes } from 'Modes'; +import { describe, it, expect, vi } from 'vitest'; + import { dummyTest } from '../../testUtils/testDummy'; import classnames from '../classnames'; import promisify from '../promisify'; -import { Modes } from 'Modes'; import * as vest from 'vest'; describe('Utility: classnames', () => { @@ -21,17 +23,17 @@ describe('Utility: classnames', () => { describe('When called with a vest result object', () => { it('Should return a function', async () => { const validate = vest.create( - jest.fn(() => { + vi.fn(() => { dummyTest.failing('field_0'); - }) + }), ); expect(typeof classnames(validate())).toBe('function'); const promisifed = await promisify( vest.create( - jest.fn(() => { + vi.fn(() => { dummyTest.failing('field_0'); - }) - ) + }), + ), )(); expect(typeof classnames(promisifed)).toBe('function'); }); @@ -66,21 +68,21 @@ describe('Utility: classnames', () => { // splitting and sorting to not rely on object order which is unspecified in the language expect(genClass('field_2').split(' ').sort()).toEqual( - 'invalid_string tested_string warning_string'.split(' ').sort() + 'invalid_string tested_string warning_string'.split(' ').sort(), ); expect(genClass('field_3').split(' ').sort()).toEqual( - 'tested_string valid_string warning_string'.split(' ').sort() + 'tested_string valid_string warning_string'.split(' ').sort(), ); expect(genClass('field_4').split(' ').sort()).toEqual( - 'tested_string valid_string'.split(' ').sort() + 'tested_string valid_string'.split(' ').sort(), ); expect(genClass('field_5').split(' ').sort()).toEqual( - 'tested_string invalid_string'.split(' ').sort() + 'tested_string invalid_string'.split(' ').sort(), ); expect(genClass('field_6').split(' ').sort()).toEqual( - 'untested_string'.split(' ').sort() + 'untested_string'.split(' ').sort(), ); }); }); @@ -95,10 +97,10 @@ describe('Utility: classnames', () => { // splitting and sorting to not rely on object order which is unspecified in the language expect(genClass('field_2').split(' ').sort()).toEqual( - 'invalid_string'.split(' ').sort() + 'invalid_string'.split(' ').sort(), ); expect(genClass('field_3').split(' ').sort()).toEqual( - ''.split(' ').sort() + ''.split(' ').sort(), ); }); }); @@ -120,10 +122,10 @@ describe('Utility: classnames', () => { // splitting and sorting to not rely on object order which is unspecified in the language expect(genClass('field_2').split(' ').sort()).toEqual( - ''.split(' ').sort() + ''.split(' ').sort(), ); expect(genClass('field_3').split(' ').sort()).toEqual( - ''.split(' ').sort() + ''.split(' ').sort(), ); }); }); diff --git a/packages/vest/src/exports/__tests__/debounce.test.ts b/packages/vest/src/exports/__tests__/debounce.test.ts index 7e6575c66..7e0fbac00 100644 --- a/packages/vest/src/exports/__tests__/debounce.test.ts +++ b/packages/vest/src/exports/__tests__/debounce.test.ts @@ -1,14 +1,15 @@ +import { describe, it, expect, vi } from 'vitest'; import wait from 'wait'; import { TestFnPayload } from 'TestTypes'; +import debounce from 'debounce'; import * as vest from 'vest'; -import debounce from 'vest/debounce'; describe('debounce', () => { describe('Sync test', () => { describe('Returning false', () => { it('Should debounce test function calls when used', () => { - const test = jest.fn(() => { + const test = vi.fn(() => { return false; }); @@ -34,7 +35,7 @@ describe('debounce', () => { describe('Throwing an error', () => { it('Should debounce test function calls when used', () => { - const test = jest.fn(() => { + const test = vi.fn(() => { throw new Error(); }); @@ -61,7 +62,7 @@ describe('debounce', () => { describe('Async test', () => { it('Should complete the async test after the delay', async () => { - const t = jest.fn(async () => { + const t = vi.fn(async () => { await wait(1000); vest.enforce(1).equals(2); }); @@ -85,7 +86,7 @@ describe('debounce', () => { describe('When delay met multiple times', () => { it('Should call once per completed delay', async () => { - const test = jest.fn(() => { + const test = vi.fn(() => { return false; }); @@ -116,7 +117,7 @@ describe('debounce', () => { describe('Debounced tests with non-debounced tests', () => { it('Should complete non-debounced tests immediately', () => { - const test = jest.fn(() => { + const test = vi.fn(() => { return false; }); @@ -141,7 +142,7 @@ describe('debounce', () => { describe('Multiple debounced fields', () => { it('Should conclude them on their own time', () => { - const t = jest.fn(() => { + const t = vi.fn(() => { return false; }); @@ -151,7 +152,7 @@ describe('debounce', () => { vest.test('test3', 'message', debounce(t, 2000)); }); - const control = jest.fn(); + const control = vi.fn(); return new Promise(done => { suite(); @@ -196,10 +197,10 @@ describe('debounce', () => { describe('Test payload', () => { describe('AbortSignal', () => { it('Should abort the test when signal is aborted', async () => { - const control = jest.fn(); + const control = vi.fn(); let run = 0; - const test = jest.fn(async (payload: TestFnPayload) => { + const test = vi.fn(async (payload: TestFnPayload) => { expect(payload.signal.aborted).toBe(false); await wait(50); // We should only abort on the first run because diff --git a/packages/vest/src/exports/__tests__/parser.test.ts b/packages/vest/src/exports/__tests__/parser.test.ts index ac456cc90..f288e2c79 100644 --- a/packages/vest/src/exports/__tests__/parser.test.ts +++ b/packages/vest/src/exports/__tests__/parser.test.ts @@ -1,7 +1,9 @@ +import { parse } from 'parser'; +import { describe, it, expect } from 'vitest'; + import * as suiteDummy from '../../testUtils/suiteDummy'; import { ser } from '../../testUtils/suiteDummy'; -import { parse } from 'parser'; import * as vest from 'vest'; describe('parser.parse', () => { @@ -16,13 +18,13 @@ describe('parser.parse', () => { it('Should return true when provided field is failing', () => { expect(parse(suiteDummy.failing('username')).invalid('username')).toBe( - true + true, ); }); it('Should return false when provided field is passing', () => { expect(parse(suiteDummy.passing('username')).invalid('username')).toBe( - false + false, ); }); @@ -37,13 +39,13 @@ describe('parser.parse', () => { it('Should return true when provided field is failing', () => { expect( - parse(ser(suiteDummy.failing('username'))).invalid('username') + parse(ser(suiteDummy.failing('username'))).invalid('username'), ).toBe(true); }); it('Should return false when provided field is passing', () => { expect( - parse(ser(suiteDummy.passing('username'))).invalid('username') + parse(ser(suiteDummy.passing('username'))).invalid('username'), ).toBe(false); }); }); @@ -59,10 +61,10 @@ describe('parser.parse', () => { }); it('Should return true if provided field is tested', () => { expect(parse(suiteDummy.passing('username')).tested('username')).toBe( - true + true, ); expect(parse(suiteDummy.failing('username')).tested('username')).toBe( - true + true, ); }); @@ -76,10 +78,10 @@ describe('parser.parse', () => { }); it('Should return true if provided field is tested', () => { expect( - parse(ser(suiteDummy.passing('username'))).tested('username') + parse(ser(suiteDummy.passing('username'))).tested('username'), ).toBe(true); expect( - parse(ser(suiteDummy.failing('username'))).tested('username') + parse(ser(suiteDummy.failing('username'))).tested('username'), ).toBe(true); }); }); @@ -99,8 +101,8 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('untested', () => {}); }); - })() - ).untested('untested') + })(), + ).untested('untested'), ).toBe(true); }); @@ -110,7 +112,7 @@ describe('parser.parse', () => { it('Should return false if provided field is tested', () => { expect(parse(suiteDummy.passing('username')).untested('username')).toBe( - false + false, ); }); @@ -128,21 +130,21 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('untested', () => {}); }); - })() - ) - ).untested('untested') + })(), + ), + ).untested('untested'), ).toBe(true); }); it('Should return false if any field is tested', () => { expect(parse(ser(suiteDummy.passing('username'))).untested()).toBe( - false + false, ); }); it('Should return false if provided field is tested', () => { expect( - parse(ser(suiteDummy.passing('username'))).untested('username') + parse(ser(suiteDummy.passing('username'))).untested('username'), ).toBe(false); }); }); @@ -152,19 +154,19 @@ describe('parser.parse', () => { it('Should return true if all fields are passing', () => { expect(parse(suiteDummy.passing(['f1', 'f2', 'f3'])).valid()).toBe(true); expect(parse(suiteDummy.passing(['f1', 'f2', 'f3'])).valid('f2')).toBe( - true + true, ); }); it('Should return true if all required fields have been tested and are passing', () => { expect( - parse(suiteDummy.passingWithUntestedOptional('optional')).valid() + parse(suiteDummy.passingWithUntestedOptional('optional')).valid(), ).toBe(true); }); it('Should return true if all fields, including optional, pass', () => { expect(parse(suiteDummy.passingWithOptional('optional')).valid()).toBe( - true + true, ); }); @@ -193,8 +195,8 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('untested', () => {}); }); - })() - ).valid() + })(), + ).valid(), ).toBe(false); }); @@ -206,8 +208,8 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('f1', () => {}); }); - })() - ).valid('f1') + })(), + ).valid('f1'), ).toBe(false); }); @@ -219,8 +221,8 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('f1', () => {}); }); - })() - ).valid('f1') + })(), + ).valid('f1'), ).toBe(true); }); @@ -230,8 +232,8 @@ describe('parser.parse', () => { vest.create(() => { vest.test('f1', () => {}); vest.test('f2', () => false); - })() - ).valid('f1') + })(), + ).valid('f1'), ).toBe(true); }); @@ -241,8 +243,8 @@ describe('parser.parse', () => { vest.create(() => { vest.test('f1', () => {}); vest.test('f2', () => false); - })() - ).valid('f2') + })(), + ).valid('f2'), ).toBe(false); expect( parse( @@ -250,8 +252,8 @@ describe('parser.parse', () => { vest.test('f1', () => {}); vest.test('f2', () => {}); vest.test('f2', () => false); - })() - ).valid('f2') + })(), + ).valid('f2'), ).toBe(false); }); @@ -263,8 +265,8 @@ describe('parser.parse', () => { vest.warn(); return false; }); - })() - ).valid('f1') + })(), + ).valid('f1'), ).toBe(true); }); }); @@ -272,22 +274,24 @@ describe('parser.parse', () => { describe('Serialized Result', () => { it('Should return true if all fields are passing', () => { expect(parse(ser(suiteDummy.passing(['f1', 'f2', 'f3']))).valid()).toBe( - true + true, ); expect( - parse(ser(suiteDummy.passing(['f1', 'f2', 'f3']))).valid('f2') + parse(ser(suiteDummy.passing(['f1', 'f2', 'f3']))).valid('f2'), ).toBe(true); }); it('Should return true if all required fields have been tested and are passing', () => { expect( - parse(ser(suiteDummy.passingWithUntestedOptional('optional'))).valid() + parse( + ser(suiteDummy.passingWithUntestedOptional('optional')), + ).valid(), ).toBe(true); }); it('Should return true if all fields, including optional, pass', () => { expect( - parse(ser(suiteDummy.passingWithOptional('optional'))).valid() + parse(ser(suiteDummy.passingWithOptional('optional'))).valid(), ).toBe(true); }); @@ -301,7 +305,7 @@ describe('parser.parse', () => { it('Should return true if suite only has warnings', () => { expect(parse(ser(suiteDummy.warning(['f1', 'f2', 'f3']))).valid()).toBe( - true + true, ); }); @@ -319,9 +323,9 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('untested', () => {}); }); - })() - ) - ).valid() + })(), + ), + ).valid(), ).toBe(false); }); @@ -334,9 +338,9 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('f1', () => {}); }); - })() - ) - ).valid('f1') + })(), + ), + ).valid('f1'), ).toBe(false); }); @@ -349,9 +353,9 @@ describe('parser.parse', () => { vest.skipWhen(true, () => { vest.test('f1', () => {}); }); - })() - ) - ).valid('f1') + })(), + ), + ).valid('f1'), ).toBe(true); }); @@ -362,9 +366,9 @@ describe('parser.parse', () => { vest.create(() => { vest.test('f1', () => {}); vest.test('f2', () => false); - })() - ) - ).valid('f1') + })(), + ), + ).valid('f1'), ).toBe(true); }); @@ -375,9 +379,9 @@ describe('parser.parse', () => { vest.create(() => { vest.test('f1', () => {}); vest.test('f2', () => false); - })() - ) - ).valid('f2') + })(), + ), + ).valid('f2'), ).toBe(false); expect( parse( @@ -386,9 +390,9 @@ describe('parser.parse', () => { vest.test('f1', () => {}); vest.test('f2', () => {}); vest.test('f2', () => false); - })() - ) - ).valid('f2') + })(), + ), + ).valid('f2'), ).toBe(false); }); @@ -401,9 +405,9 @@ describe('parser.parse', () => { vest.warn(); return false; }); - })() - ) - ).valid('f1') + })(), + ), + ).valid('f1'), ).toBe(true); }); }); diff --git a/packages/vest/src/exports/__tests__/promisify.test.ts b/packages/vest/src/exports/__tests__/promisify.test.ts index 7385e5d72..288dd5b5f 100644 --- a/packages/vest/src/exports/__tests__/promisify.test.ts +++ b/packages/vest/src/exports/__tests__/promisify.test.ts @@ -1,25 +1,26 @@ import { faker } from '@faker-js/faker'; +import { TFieldName } from 'SuiteResultTypes'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import { dummyTest } from '../../testUtils/testDummy'; import { TestPromise } from '../../testUtils/testPromise'; import promisify from '../promisify'; -import { TFieldName } from 'SuiteResultTypes'; import * as vest from 'vest'; describe('Utility: promisify', () => { - let validatorFn: jest.Mock, any>; + let validatorFn: vi.Mock, any>; let validateAsync: ( ...args: any[] ) => Promise>; beforeEach(() => { - validatorFn = jest.fn( + validatorFn = vi.fn( vest.create( - jest.fn(() => { + vi.fn(() => { dummyTest.failing('field_0'); - }) - ) + }), + ), ); validateAsync = promisify(validatorFn); }); @@ -34,7 +35,7 @@ describe('Utility: promisify', () => { describe('Return value', () => { it('should be a function', () => { - expect(typeof promisify(jest.fn())).toBe('function'); + expect(typeof promisify(vi.fn())).toBe('function'); }); it('should be a promise', () => @@ -52,7 +53,7 @@ describe('Utility: promisify', () => { vest.create(() => { dummyTest.failing('field_0'); done(); - }) + }), ); validateAsync(); })); diff --git a/packages/vest/src/exports/classnames.ts b/packages/vest/src/exports/classnames.ts index 5cc24f1c6..e052b46d3 100644 --- a/packages/vest/src/exports/classnames.ts +++ b/packages/vest/src/exports/classnames.ts @@ -8,7 +8,7 @@ import { ParsedVestObject, parse } from 'parser'; */ export default function classnames( res: SuiteSummary, - classes: SupportedClasses = {} + classes: SupportedClasses = {}, ): (fieldName: F) => string { const selectors = parse(res); diff --git a/packages/vest/src/exports/debounce.ts b/packages/vest/src/exports/debounce.ts index b185d1721..85e82abd2 100644 --- a/packages/vest/src/exports/debounce.ts +++ b/packages/vest/src/exports/debounce.ts @@ -1,8 +1,8 @@ +import { registerReconciler } from 'vest'; import { CB, isPromise, Nullable } from 'vest-utils'; import { Isolate, TIsolate, IsolateSelectors } from 'vestjs-runtime'; import { TestFn, TestFnPayload } from 'TestTypes'; -import { registerReconciler } from 'vest'; const isolateType = 'Debounce'; diff --git a/packages/vest/src/exports/parser.ts b/packages/vest/src/exports/parser.ts index f31e52093..6e344dbe2 100644 --- a/packages/vest/src/exports/parser.ts +++ b/packages/vest/src/exports/parser.ts @@ -1,8 +1,8 @@ +import { suiteSelectors } from 'vest'; import { hasOwnProperty, invariant, isNullish, isPositive } from 'vest-utils'; import { ErrorStrings } from 'ErrorStrings'; import { SuiteSummary, TFieldName, TGroupName } from 'SuiteResultTypes'; -import { suiteSelectors } from 'vest'; export function parse( summary: SuiteSummary, diff --git a/packages/vest/src/exports/promisify.ts b/packages/vest/src/exports/promisify.ts index 101a86f9b..0672d0bc0 100644 --- a/packages/vest/src/exports/promisify.ts +++ b/packages/vest/src/exports/promisify.ts @@ -9,7 +9,7 @@ import { } from 'SuiteResultTypes'; function promisify( - validatorFn: (...args: any[]) => SuiteRunResult + validatorFn: (...args: any[]) => SuiteRunResult, ) { return (...args: any[]): Promise> => { invariant(isFunction(validatorFn), ErrorStrings.PROMISIFY_REQUIRE_FUNCTION); diff --git a/packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap b/packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap index a36650933..803f9c880 100644 --- a/packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap +++ b/packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`include Field is excluded via \`skip\` Should disregard \`include.when\` and avoid running the test 1`] = ` +exports[`include > Field is excluded via \`skip\` > Should disregard \`include.when\` and avoid running the test 1`] = ` { "done": [Function], "errorCount": 1, @@ -56,7 +56,7 @@ exports[`include Field is excluded via \`skip\` Should disregard \`include.when\ } `; -exports[`include Field is excluded via \`skip\` Should disregard \`include\` and avoid running the test 1`] = ` +exports[`include > Field is excluded via \`skip\` > Should disregard \`include\` and avoid running the test 1`] = ` { "done": [Function], "errorCount": 1, @@ -112,7 +112,7 @@ exports[`include Field is excluded via \`skip\` Should disregard \`include\` and } `; -exports[`include Test is excluded via \`skip.group\` Should disregard \`include.when\` and avoid running the test 1`] = ` +exports[`include > Test is excluded via \`skip.group\` > Should disregard \`include.when\` and avoid running the test 1`] = ` { "done": [Function], "errorCount": 1, @@ -189,7 +189,7 @@ exports[`include Test is excluded via \`skip.group\` Should disregard \`include. } `; -exports[`include Test is excluded via \`skip.group\` Should disregard \`include\` and avoid running the test 1`] = ` +exports[`include > Test is excluded via \`skip.group\` > Should disregard \`include\` and avoid running the test 1`] = ` { "done": [Function], "errorCount": 1, @@ -266,7 +266,7 @@ exports[`include Test is excluded via \`skip.group\` Should disregard \`include\ } `; -exports[`include Test is excluded via \`skipWhen\` Should disregard \`include.when\` and avoid running the matching tests 1`] = ` +exports[`include > Test is excluded via \`skipWhen\` > Should disregard \`include.when\` and avoid running the matching tests 1`] = ` { "done": [Function], "errorCount": 1, @@ -313,7 +313,7 @@ exports[`include Test is excluded via \`skipWhen\` Should disregard \`include.wh } `; -exports[`include Test is excluded via \`skipWhen\` Should disregard \`include\` and avoid running the matching tests 1`] = ` +exports[`include > Test is excluded via \`skipWhen\` > Should disregard \`include\` and avoid running the matching tests 1`] = ` { "done": [Function], "errorCount": 1, @@ -360,7 +360,7 @@ exports[`include Test is excluded via \`skipWhen\` Should disregard \`include\` } `; -exports[`include There is an \`onlyd\` field \`include\` is run as-is without modifiers Should run the included test along with the onlyd test 1`] = ` +exports[`include > There is an \`onlyd\` field > \`include\` is run as-is without modifiers > Should run the included test along with the onlyd test 1`] = ` { "done": [Function], "errorCount": 2, @@ -421,7 +421,7 @@ exports[`include There is an \`onlyd\` field \`include\` is run as-is without mo } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a boolean when \`false\` Should skip run included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a boolean > when \`false\` > Should skip run included field 1`] = ` { "done": [Function], "errorCount": 1, @@ -486,7 +486,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a boolean when \`true\` Should run included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a boolean > when \`true\` > Should run included field 1`] = ` { "done": [Function], "errorCount": 2, @@ -556,7 +556,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a function Callback evaluation Should evaluate per test run 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a function > Callback evaluation > Should evaluate per test run 1`] = ` { "done": [Function], "errorCount": 2, @@ -608,7 +608,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a function when returning\`false\` Should skip run included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a function > when returning\`false\` > Should skip run included field 1`] = ` { "done": [Function], "errorCount": 1, @@ -673,7 +673,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a function when returning \`true\` Should run included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a function > when returning \`true\` > Should run included field 1`] = ` { "done": [Function], "errorCount": 2, @@ -743,7 +743,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a string \`when\` param is a name of a non-included field Should avoid running the included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a string > \`when\` param is a name of a non-included field > Should avoid running the included field 1`] = ` { "done": [Function], "errorCount": 1, @@ -808,7 +808,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a string \`when\` param is a name of a skipped field Should avoid running the included field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a string > \`when\` param is a name of a skipped field > Should avoid running the included field 1`] = ` { "done": [Function], "errorCount": 1, @@ -873,7 +873,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include There is an \`onlyd\` field include().when() \`when\` param is a string \`when\` param is a name of an onlyd field Should run included field along with the onlyd field 1`] = ` +exports[`include > There is an \`onlyd\` field > include().when() > \`when\` param is a string > \`when\` param is a name of an onlyd field > Should run included field along with the onlyd field 1`] = ` { "done": [Function], "errorCount": 2, @@ -943,7 +943,7 @@ exports[`include There is an \`onlyd\` field include().when() \`when\` param is } `; -exports[`include When no \`skip\` or \`only\` include has no effect 1`] = ` +exports[`include > When no \`skip\` or \`only\` > include has no effect 1`] = ` { "done": [Function], "errorCount": 2, @@ -1004,7 +1004,7 @@ exports[`include When no \`skip\` or \`only\` include has no effect 1`] = ` } `; -exports[`include When no \`skip\` or \`only\` include().when has no effect 1`] = ` +exports[`include > When no \`skip\` or \`only\` > include().when has no effect 1`] = ` { "done": [Function], "errorCount": 2, diff --git a/packages/vest/src/hooks/__tests__/include.test.ts b/packages/vest/src/hooks/__tests__/include.test.ts index 951ffd962..d34d1ae30 100644 --- a/packages/vest/src/hooks/__tests__/include.test.ts +++ b/packages/vest/src/hooks/__tests__/include.test.ts @@ -1,13 +1,15 @@ import { Modes } from 'Modes'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; + import * as vest from 'vest'; describe('include', () => { - let cb1 = jest.fn(), - cb2 = jest.fn(); + let cb1 = vi.fn(), + cb2 = vi.fn(); beforeEach(() => { - cb1 = jest.fn(() => false); - cb2 = jest.fn(() => false); + cb1 = vi.fn(() => false); + cb2 = vi.fn(() => false); }); describe('When not passing a string fieldName', () => { @@ -196,7 +198,7 @@ describe('include', () => { describe('Callback evaluation', () => { it('Should run the callback for each matching test', () => { - const cb = jest.fn(() => true); + const cb = vi.fn(() => true); const suite = vest.create(() => { vest.mode(Modes.ALL); vest.only('field_1'); @@ -216,10 +218,10 @@ describe('include', () => { expect(cb).toHaveBeenCalledTimes(2); }); it('Should evaluate per test run', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); - const cb4 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); + const cb4 = vi.fn(() => false); const suite = vest.create(() => { let shouldRun = false; diff --git a/packages/vest/src/hooks/__tests__/mode.test.ts b/packages/vest/src/hooks/__tests__/mode.test.ts index 6dd6a1472..e36d3a053 100644 --- a/packages/vest/src/hooks/__tests__/mode.test.ts +++ b/packages/vest/src/hooks/__tests__/mode.test.ts @@ -1,4 +1,5 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach } from 'vitest'; import wait from 'wait'; import { dummyTest } from '../../testUtils/testDummy'; diff --git a/packages/vest/src/hooks/__tests__/warn.test.ts b/packages/vest/src/hooks/__tests__/warn.test.ts index 523b08ed8..44c9b2922 100644 --- a/packages/vest/src/hooks/__tests__/warn.test.ts +++ b/packages/vest/src/hooks/__tests__/warn.test.ts @@ -1,7 +1,8 @@ import { faker } from '@faker-js/faker'; - import { ErrorStrings } from 'ErrorStrings'; import { VestTest } from 'VestTest'; +import { describe, it, expect, vi } from 'vitest'; + import * as vest from 'vest'; const { create, test, warn } = vest; @@ -22,7 +23,7 @@ describe('warn hook', () => { describe('Error handling', () => { it('Should throw error when currentTest is not present', () => { - const done = jest.fn(); + const done = vi.fn(); create(() => { expect(warn).toThrow(ErrorStrings.WARN_MUST_BE_CALLED_FROM_TEST); done(); diff --git a/packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap b/packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap index 8fc8ee4fa..ea0ac466a 100644 --- a/packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap +++ b/packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Top Level Focus Top Level Skip When passing false Should run all fields 1`] = ` +exports[`Top Level Focus > Top Level Skip > When passing false > Should run all fields 1`] = ` Promise { "done": [Function], "dump": [Function], @@ -82,7 +82,7 @@ Promise { } `; -exports[`Top Level Focus Top Level Skip When passing undefined Should run all fields 1`] = ` +exports[`Top Level Focus > Top Level Skip > When passing undefined > Should run all fields 1`] = ` Promise { "done": [Function], "dump": [Function], diff --git a/packages/vest/src/hooks/focused/__tests__/focused.test.ts b/packages/vest/src/hooks/focused/__tests__/focused.test.ts index 41f103ed8..7fd280424 100644 --- a/packages/vest/src/hooks/focused/__tests__/focused.test.ts +++ b/packages/vest/src/hooks/focused/__tests__/focused.test.ts @@ -1,4 +1,5 @@ import { CB } from 'vest-utils'; +import { describe, it, expect } from 'vitest'; import * as vest from 'vest'; diff --git a/packages/vest/src/hooks/focused/focused.ts b/packages/vest/src/hooks/focused/focused.ts index 08bc45a92..a8fd22009 100644 --- a/packages/vest/src/hooks/focused/focused.ts +++ b/packages/vest/src/hooks/focused/focused.ts @@ -27,7 +27,7 @@ export type IsolateFocusedPayload = { export function IsolateFocused( focusMode: FocusModes, - match?: true | FieldExclusion + match?: true | FieldExclusion, ): TIsolateFocused { return Isolate.create(VestIsolateType.Focused, noop, { focusMode, @@ -39,7 +39,7 @@ export function IsolateFocused( export class FocusSelectors { static isSkipFocused( focus: Nullable, - fieldName?: TFieldName + fieldName?: TFieldName, ): boolean { return ( focus?.data.focusMode === FocusModes.SKIP && @@ -48,7 +48,7 @@ export class FocusSelectors { } static isOnlyFocused( focus: Nullable, - fieldName?: TFieldName + fieldName?: TFieldName, ): boolean { return ( focus?.data.focusMode === FocusModes.ONLY && hasFocus(focus, fieldName) diff --git a/packages/vest/src/hooks/focused/useHasOnliedTests.ts b/packages/vest/src/hooks/focused/useHasOnliedTests.ts index 0cffdd841..e4e7896ee 100644 --- a/packages/vest/src/hooks/focused/useHasOnliedTests.ts +++ b/packages/vest/src/hooks/focused/useHasOnliedTests.ts @@ -10,13 +10,13 @@ import { FocusSelectors } from 'focused'; */ export function useHasOnliedTests( testObject: TIsolateTest, - fieldName?: TFieldName + fieldName?: TFieldName, ): boolean { return isNotNullish( Walker.findClosest(testObject, (child: TIsolate) => { if (!FocusSelectors.isIsolateFocused(child)) return false; return FocusSelectors.isOnlyFocused(child, fieldName); - }) + }), ); } diff --git a/packages/vest/src/hooks/include.ts b/packages/vest/src/hooks/include.ts index 157fa1353..c279cf5eb 100644 --- a/packages/vest/src/hooks/include.ts +++ b/packages/vest/src/hooks/include.ts @@ -28,7 +28,7 @@ import { useHasOnliedTests } from 'useHasOnliedTests'; */ // @vx-allow use-use export function include( - fieldName: F + fieldName: F, ): { when: (condition: F | TFieldName | TDraftCondition) => void; } { @@ -49,7 +49,7 @@ export function include( // This callback will run as part of the "isExcluded" series of checks inclusion[fieldName] = function isIncluded( - currentNode: TIsolateTest + currentNode: TIsolateTest, ): boolean { if (isStringValue(condition)) { return useHasOnliedTests(currentNode, condition); @@ -57,7 +57,7 @@ export function include( return optionalFunctionValue( condition, - optionalFunctionValue(useCreateSuiteResult) + optionalFunctionValue(useCreateSuiteResult), ); }; } diff --git a/packages/vest/src/hooks/optional/__tests__/optional.test.ts b/packages/vest/src/hooks/optional/__tests__/optional.test.ts index 6351d3985..b20754f20 100644 --- a/packages/vest/src/hooks/optional/__tests__/optional.test.ts +++ b/packages/vest/src/hooks/optional/__tests__/optional.test.ts @@ -1,10 +1,11 @@ import { TTestSuite } from 'testUtils/TVestMock'; import { BlankValue } from 'vest-utils'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import wait from 'wait'; import * as vest from 'vest'; -jest.useFakeTimers(); +vi.useFakeTimers(); describe('optional hook', () => { describe('Auto Optional Interface', () => { @@ -126,7 +127,7 @@ describe('optional hook', () => { }); it('Should run the test but omit anyway', () => { - const fn = jest.fn(() => false); + const fn = vi.fn(() => false); const suite = vest.create(() => { vest.optional({ f1: () => true, @@ -201,7 +202,7 @@ describe('optional hook', () => { }); it('Should avoid running the test to begin with', () => { - const fn = jest.fn(); + const fn = vi.fn(); const suite = vest.create(() => { vest.optional({ field_1: true, @@ -250,7 +251,7 @@ describe('optional hook', () => { expect(res.hasErrors('field_1')).toBe(false); expect(res.isValid('field_1')).toBe(true); expect(res.isValid()).toBe(true); - } + }, ); }); @@ -394,7 +395,7 @@ describe('optional hook', () => { describe('After the test completed', () => { it('Should be considered as non-valid', () => { const res = suite(); - jest.runAllTimers(); + vi.runAllTimers(); expect(res.isValid()).toBe(false); expect(res.isValid('field_1')).toBe(false); }); @@ -425,7 +426,7 @@ describe('optional hook', () => { describe('After the test completed', () => { it('Should be considered as valid', async () => { suite(); - await jest.runAllTimersAsync(); + await vi.runAllTimersAsync(); expect(suite.isValid()).toBe(true); expect(suite.isValid('field_1')).toBe(true); }); @@ -463,7 +464,7 @@ describe('optional hook', () => { describe('After the test completed', () => { it('Should be considered as valid', async () => { suite(); - await jest.runAllTimersAsync(); + await vi.runAllTimersAsync(); expect(suite.isValid('field_2')).toBe(true); expect(suite.isValid()).toBe(true); expect(suite.isValid('field_1')).toBe(true); diff --git a/packages/vest/src/hooks/optional/omitOptionalFields.ts b/packages/vest/src/hooks/optional/omitOptionalFields.ts index fb0580514..88df38474 100644 --- a/packages/vest/src/hooks/optional/omitOptionalFields.ts +++ b/packages/vest/src/hooks/optional/omitOptionalFields.ts @@ -63,7 +63,7 @@ export function useOmitOptionalFields(): void { // Ge the optional configuration for the given field const optionalConfig = SuiteOptionalFields.getOptionalField( root, - fieldName + fieldName, ); // If the optional was set to a function or a boolean, run it and verify/omit the test diff --git a/packages/vest/src/hooks/optional/optional.ts b/packages/vest/src/hooks/optional/optional.ts index ac9bc745e..4f9cd0e08 100644 --- a/packages/vest/src/hooks/optional/optional.ts +++ b/packages/vest/src/hooks/optional/optional.ts @@ -9,7 +9,7 @@ import { TFieldName } from 'SuiteResultTypes'; // @vx-allow use-use export function optional( - optionals: OptionalsInput + optionals: OptionalsInput, ): void { const suiteRoot = VestRuntime.useAvailableRoot(); diff --git a/packages/vest/src/isolates/__tests__/__snapshots__/each.test.ts.snap b/packages/vest/src/isolates/__tests__/__snapshots__/each.test.ts.snap index b188802e4..e1bd5009f 100644 --- a/packages/vest/src/isolates/__tests__/__snapshots__/each.test.ts.snap +++ b/packages/vest/src/isolates/__tests__/__snapshots__/each.test.ts.snap @@ -1,3 +1,3 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`each When callback is not a function should throw 1`] = `"Each must be called with a function"`; +exports[`each > When callback is not a function > should throw 1`] = `[Error: Each must be called with a function]`; diff --git a/packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap b/packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap index c041fb135..d2b3b45de 100644 --- a/packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap +++ b/packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`named group Focus only group only Should skip all tests except \`only\` tests within the group 1`] = ` +exports[`named group > Focus > only > group only > Should skip all tests except \`only\` tests within the group 1`] = ` SuiteSummary { "errorCount": 4, "errors": [ @@ -138,7 +138,7 @@ SuiteSummary { } `; -exports[`named group Focus only top level only should skip all tests except \`only\` tests 1`] = ` +exports[`named group > Focus > only > top level only > should skip all tests except \`only\` tests 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -271,7 +271,7 @@ SuiteSummary { } `; -exports[`named group Focus skip inside the group should skip only within the group 1`] = ` +exports[`named group > Focus > skip inside the group > should skip only within the group 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -357,7 +357,7 @@ SuiteSummary { } `; -exports[`named group Focus skip inside the group should skip only within the group, not the next group 1`] = ` +exports[`named group > Focus > skip inside the group > should skip only within the group, not the next group 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -454,7 +454,7 @@ SuiteSummary { } `; -exports[`named group Focus skip inside the group skip(true) should skip only within the group 1`] = ` +exports[`named group > Focus > skip inside the group > skip(true) > should skip only within the group 1`] = ` SuiteSummary { "errorCount": 5, "errors": [ @@ -579,7 +579,7 @@ SuiteSummary { } `; -exports[`named group Focus skip outside of group Should skip \`skipped\` tests both inside and outside the group 1`] = ` +exports[`named group > Focus > skip outside of group > Should skip \`skipped\` tests both inside and outside the group 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -655,7 +655,7 @@ SuiteSummary { } `; -exports[`named group Multiple groups Should run the tests within the groups 1`] = ` +exports[`named group > Multiple groups > Should run the tests within the groups 1`] = ` SuiteSummary { "errorCount": 5, "errors": [ @@ -798,7 +798,7 @@ SuiteSummary { } `; -exports[`named group Should run the tests within the group 1`] = ` +exports[`named group > Should run the tests within the group 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -902,7 +902,7 @@ SuiteSummary { } `; -exports[`unnamed groups Should complete without adding the group to the results object 1`] = ` +exports[`unnamed groups > Should complete without adding the group to the results object 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -976,7 +976,7 @@ SuiteSummary { } `; -exports[`unnamed groups Should run tests normally 1`] = ` +exports[`unnamed groups > Should run tests normally 1`] = ` SuiteSummary { "errorCount": 3, "errors": [ @@ -1050,7 +1050,7 @@ SuiteSummary { } `; -exports[`unnamed groups With skip(true) Should skip all tests in group 1`] = ` +exports[`unnamed groups > With skip(true) > Should skip all tests in group 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -1108,7 +1108,7 @@ SuiteSummary { } `; -exports[`unnamed groups with only Should only run the tests specified by only 1`] = ` +exports[`unnamed groups > with only > Should only run the tests specified by only 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -1172,7 +1172,7 @@ SuiteSummary { } `; -exports[`unnamed groups with skip Should skip the tests specified by skip 1`] = ` +exports[`unnamed groups > with skip > Should skip the tests specified by skip 1`] = ` SuiteSummary { "errorCount": 2, "errors": [ diff --git a/packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap b/packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap index 67b4a2a16..5fc45e43d 100644 --- a/packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap +++ b/packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`omitWhen When conditional is falsy boolean conditional Should have all tests within the omit block referenced in the result 1`] = ` +exports[`omitWhen > When conditional is falsy > boolean conditional > Should have all tests within the omit block referenced in the result 1`] = ` { "field_1": { "errorCount": 1, @@ -41,7 +41,7 @@ exports[`omitWhen When conditional is falsy boolean conditional Should have all } `; -exports[`omitWhen When conditional is falsy boolean conditional Should run tests normally 1`] = ` +exports[`omitWhen > When conditional is falsy > boolean conditional > Should run tests normally 1`] = ` { "field_1": { "errorCount": 1, @@ -82,7 +82,7 @@ exports[`omitWhen When conditional is falsy boolean conditional Should run tests } `; -exports[`omitWhen When conditional is falsy boolean conditional Should run tests normally 2`] = ` +exports[`omitWhen > When conditional is falsy > boolean conditional > Should run tests normally 2`] = ` { "field_1": { "errorCount": 1, @@ -123,7 +123,7 @@ exports[`omitWhen When conditional is falsy boolean conditional Should run tests } `; -exports[`omitWhen When conditional is falsy function conditional Should have all tests within the omit block referenced in the result 1`] = ` +exports[`omitWhen > When conditional is falsy > function conditional > Should have all tests within the omit block referenced in the result 1`] = ` { "field_1": { "errorCount": 1, @@ -164,7 +164,7 @@ exports[`omitWhen When conditional is falsy function conditional Should have all } `; -exports[`omitWhen When conditional is falsy function conditional Should run tests normally 1`] = ` +exports[`omitWhen > When conditional is falsy > function conditional > Should run tests normally 1`] = ` { "field_1": { "errorCount": 1, @@ -205,7 +205,7 @@ exports[`omitWhen When conditional is falsy function conditional Should run test } `; -exports[`omitWhen When conditional is falsy function conditional Should run tests normally 2`] = ` +exports[`omitWhen > When conditional is falsy > function conditional > Should run tests normally 2`] = ` { "field_1": { "errorCount": 1, @@ -246,7 +246,7 @@ exports[`omitWhen When conditional is falsy function conditional Should run test } `; -exports[`omitWhen When conditional is truthy boolean conditional Should avoid running the omitted tests 1`] = ` +exports[`omitWhen > When conditional is truthy > boolean conditional > Should avoid running the omitted tests 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -319,7 +319,7 @@ SuiteSummary { } `; -exports[`omitWhen When conditional is truthy boolean conditional Should skip and not run omitted fields when no filter provided 1`] = ` +exports[`omitWhen > When conditional is truthy > boolean conditional > Should skip and not run omitted fields when no filter provided 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -392,7 +392,7 @@ SuiteSummary { } `; -exports[`omitWhen When conditional is truthy function conditional Should avoid running the omitted tests 1`] = ` +exports[`omitWhen > When conditional is truthy > function conditional > Should avoid running the omitted tests 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -465,7 +465,7 @@ SuiteSummary { } `; -exports[`omitWhen When conditional is truthy function conditional Should skip and not run omitted fields when no filter provided 1`] = ` +exports[`omitWhen > When conditional is truthy > function conditional > Should skip and not run omitted fields when no filter provided 1`] = ` SuiteSummary { "errorCount": 1, "errors": [ diff --git a/packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap b/packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap index c21e1ac47..504aabb55 100644 --- a/packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap +++ b/packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`skipWhen Should pass result draft to the functional condition 1`] = ` +exports[`skipWhen > Should pass result draft to the functional condition 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -30,7 +30,7 @@ SuiteSummary { } `; -exports[`skipWhen Should pass result draft to the functional condition 2`] = ` +exports[`skipWhen > Should pass result draft to the functional condition 2`] = ` SuiteSummary { "errorCount": 1, "errors": [ @@ -78,7 +78,7 @@ SuiteSummary { } `; -exports[`skipWhen Should pass result draft to the functional condition 3`] = ` +exports[`skipWhen > Should pass result draft to the functional condition 3`] = ` SuiteSummary { "errorCount": 2, "errors": [ diff --git a/packages/vest/src/isolates/__tests__/each.test.ts b/packages/vest/src/isolates/__tests__/each.test.ts index d45994078..d50a9cdab 100644 --- a/packages/vest/src/isolates/__tests__/each.test.ts +++ b/packages/vest/src/isolates/__tests__/each.test.ts @@ -1,14 +1,20 @@ -import { TDeferThrow } from 'vest-utils/src/deferThrow'; - -import { TVestMock } from '../../testUtils/TVestMock'; -import mockThrowError from '../../testUtils/mockThrowError'; +import { deferThrow } from 'vest-utils'; +import { describe, it, expect, vi } from 'vitest'; import * as vest from 'vest'; +vi.mock('vest-utils', async () => { + const vu = await vi.importActual('vest-utils'); + return { + ...vu, + deferThrow: vi.fn(), + }; +}); + describe('each', () => { describe('When callback is not a function', () => { it('should throw', () => { - const control = jest.fn(); + const control = vi.fn(); const suite = vest.create(() => { expect(() => { // @ts-expect-error @@ -23,7 +29,7 @@ describe('each', () => { }); it('Should pass to callback the current list item and index', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.each([1, 2, 3, 'str'], cb); }); @@ -39,16 +45,6 @@ describe('each', () => { }); describe('Test Reorder', () => { - let deferThrow: TDeferThrow; - let vest: TVestMock; - - beforeEach(() => { - const mock = mockThrowError(); - deferThrow = mock.deferThrow; - - vest = mock.vest; - }); - it('Should allow reorder', () => { const suite = vest.create(() => { vest.each([0, 1], v => { @@ -56,10 +52,9 @@ describe('each', () => { }); }); - suite(); suite(); - expect(deferThrow).toHaveBeenCalledTimes(0); + expect(() => suite()).not.toThrow(); }); describe('Sanity', () => { @@ -76,8 +71,7 @@ describe('each', () => { suite(); suite(); - - expect(deferThrow).toHaveBeenCalledTimes(1); + expect(deferThrow).toHaveBeenCalled(); }); }); }); diff --git a/packages/vest/src/isolates/__tests__/group.test.ts b/packages/vest/src/isolates/__tests__/group.test.ts index dfdbaee75..335ddc7e9 100644 --- a/packages/vest/src/isolates/__tests__/group.test.ts +++ b/packages/vest/src/isolates/__tests__/group.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, vi } from 'vitest'; + import * as vest from 'vest'; enum GroupNames { @@ -15,7 +17,7 @@ enum FieldNames { describe('named group', () => { it('should run group callback', () => { const groupName = 'groupName'; - const callback = jest.fn(); + const callback = vi.fn(); vest.create(() => { vest.group(groupName, callback); })(); @@ -23,9 +25,9 @@ describe('named group', () => { }); it('Should run the tests within the group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => {}); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => {}); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); vest.test(FieldNames.F1, () => false); @@ -76,9 +78,9 @@ describe('named group', () => { describe('Multiple groups', () => { it('Should run the tests within the groups', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => {}); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => {}); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); vest.test(FieldNames.F1, () => false); @@ -146,8 +148,8 @@ describe('named group', () => { describe('Focus', () => { describe('skip outside of group', () => { it('Should skip `skipped` tests both inside and outside the group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -178,9 +180,9 @@ describe('named group', () => { describe('skip inside the group', () => { it('should skip only within the group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -210,9 +212,9 @@ describe('named group', () => { }); it('should skip only within the group, not the next group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -248,9 +250,9 @@ describe('named group', () => { describe('skip(true)', () => { it('should skip only within the group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -297,10 +299,10 @@ describe('named group', () => { describe('only', () => { describe('top level only', () => { it('should skip all tests except `only` tests', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); - const cb4 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); + const cb4 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -353,9 +355,9 @@ describe('named group', () => { describe('group only', () => { it('Should skip all tests except `only` tests within the group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -406,9 +408,9 @@ describe('named group', () => { describe('unnamed groups', () => { it('Should run tests normally', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -448,9 +450,9 @@ describe('unnamed groups', () => { describe('with only', () => { it('Should only run the tests specified by only', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -478,9 +480,9 @@ describe('unnamed groups', () => { describe('with skip', () => { it('Should skip the tests specified by skip', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); @@ -508,9 +510,9 @@ describe('unnamed groups', () => { describe('With skip(true)', () => { it('Should skip all tests in group', () => { - const cb1 = jest.fn(() => false); - const cb2 = jest.fn(() => false); - const cb3 = jest.fn(() => false); + const cb1 = vi.fn(() => false); + const cb2 = vi.fn(() => false); + const cb3 = vi.fn(() => false); const suite = vest.create(() => { vest.mode(vest.Modes.ALL); diff --git a/packages/vest/src/isolates/__tests__/omitWhen.test.ts b/packages/vest/src/isolates/__tests__/omitWhen.test.ts index 2ef0603f2..fd47813a3 100644 --- a/packages/vest/src/isolates/__tests__/omitWhen.test.ts +++ b/packages/vest/src/isolates/__tests__/omitWhen.test.ts @@ -1,24 +1,25 @@ +import { TTestSuite } from 'testUtils/TVestMock'; import { Maybe } from 'vest-utils'; +import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'; -import { TTestSuite } from 'testUtils/TVestMock'; import * as vest from 'vest'; import { omitWhen, only } from 'vest'; describe('omitWhen', () => { let suite: TTestSuite; - let cb1 = jest.fn(), - cb2 = jest.fn(), - cb3 = jest.fn(), - cb4 = jest.fn(), - cb5 = jest.fn(), + let cb1 = vi.fn(), + cb2 = vi.fn(), + cb3 = vi.fn(), + cb4 = vi.fn(), + cb5 = vi.fn(), allFieldsPass: Maybe; beforeEach(() => { - cb1 = jest.fn(); - cb2 = jest.fn(() => (allFieldsPass ? undefined : false)); - cb3 = jest.fn(() => (allFieldsPass ? undefined : false)); - cb4 = jest.fn(() => (allFieldsPass ? undefined : false)); - cb5 = jest.fn(); + cb1 = vi.fn(); + cb2 = vi.fn(() => (allFieldsPass ? undefined : false)); + cb3 = vi.fn(() => (allFieldsPass ? undefined : false)); + cb4 = vi.fn(() => (allFieldsPass ? undefined : false)); + cb5 = vi.fn(); suite = vest.create((omitConditional, currentField) => { only(currentField); diff --git a/packages/vest/src/isolates/__tests__/skipWhen.test.ts b/packages/vest/src/isolates/__tests__/skipWhen.test.ts index 66c032ab6..e7c1fdd88 100644 --- a/packages/vest/src/isolates/__tests__/skipWhen.test.ts +++ b/packages/vest/src/isolates/__tests__/skipWhen.test.ts @@ -1,13 +1,14 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import { dummyTest } from '../../testUtils/testDummy'; import * as vest from 'vest'; describe('skipWhen', () => { - let fn = jest.fn(); + let fn = vi.fn(); beforeEach(() => { - fn = jest.fn(); + fn = vi.fn(); suite.reset(); }); it('Should run callback both when condition is true or false', () => { @@ -38,8 +39,8 @@ describe('skipWhen', () => { }); it('Should pass result draft to the functional condition', () => { - const f = jest.fn(); - const control = jest.fn(); + const f = vi.fn(); + const control = vi.fn(); vest.create(() => { vest.skipWhen(draft => { diff --git a/packages/vest/src/isolates/each.ts b/packages/vest/src/isolates/each.ts index be41b3ca9..4ca8c3421 100644 --- a/packages/vest/src/isolates/each.ts +++ b/packages/vest/src/isolates/each.ts @@ -18,11 +18,11 @@ import { IsolateEach } from 'IsolateEach'; */ export function each( list: T[], - callback: (arg: T, index: number) => void + callback: (arg: T, index: number) => void, ): void { invariant( isFunction(callback), - ErrorStrings.EACH_CALLBACK_MUST_BE_A_FUNCTION + ErrorStrings.EACH_CALLBACK_MUST_BE_A_FUNCTION, ); IsolateEach(() => { diff --git a/packages/vest/src/isolates/group.ts b/packages/vest/src/isolates/group.ts index 556d21619..01e91544c 100644 --- a/packages/vest/src/isolates/group.ts +++ b/packages/vest/src/isolates/group.ts @@ -7,7 +7,7 @@ import { VestIsolateType } from 'VestIsolateType'; export function group( groupName: G, - callback: CB + callback: CB, ): TIsolate; export function group(callback: CB): TIsolate; export function group( @@ -15,10 +15,7 @@ export function group( ): TIsolate { const [callback, groupName] = args.reverse() as [CB, G]; - return Isolate.create( - VestIsolateType.Group, - () => { - return SuiteContext.run({ ...(groupName && { groupName }) }, callback); - }, - ); + return Isolate.create(VestIsolateType.Group, () => { + return SuiteContext.run({ ...(groupName && { groupName }) }, callback); + }); } diff --git a/packages/vest/src/isolates/omitWhen.ts b/packages/vest/src/isolates/omitWhen.ts index 3003d8ecf..f99cfa7b3 100644 --- a/packages/vest/src/isolates/omitWhen.ts +++ b/packages/vest/src/isolates/omitWhen.ts @@ -20,7 +20,7 @@ import { useCreateSuiteResult } from 'suiteResult'; // @vx-allow use-use export function omitWhen( conditional: TDraftCondition, - callback: CB + callback: CB, ): void { Isolate.create(VestIsolateType.OmitWhen, () => { SuiteContext.run( @@ -29,10 +29,10 @@ export function omitWhen( useWithinActiveOmitWhen() || optionalFunctionValue( conditional, - optionalFunctionValue(useCreateSuiteResult) + optionalFunctionValue(useCreateSuiteResult), ), }, - callback + callback, ); }); } diff --git a/packages/vest/src/isolates/skipWhen.ts b/packages/vest/src/isolates/skipWhen.ts index 45e75c19b..37ff4cd18 100644 --- a/packages/vest/src/isolates/skipWhen.ts +++ b/packages/vest/src/isolates/skipWhen.ts @@ -19,7 +19,7 @@ import { useCreateSuiteResult } from 'suiteResult'; // @vx-allow use-use export function skipWhen( condition: TDraftCondition, - callback: CB + callback: CB, ): void { Isolate.create(VestIsolateType.SkipWhen, () => { SuiteContext.run( @@ -31,10 +31,10 @@ export function skipWhen( // Otherwise, we should skip the test if the conditional is true. optionalFunctionValue( condition, - optionalFunctionValue(useCreateSuiteResult) + optionalFunctionValue(useCreateSuiteResult), ), }, - callback + callback, ); }); } diff --git a/packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap b/packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap index 307b90d1a..b7515cb25 100644 --- a/packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap +++ b/packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Test createSuite module Initial run Should be able to get the suite from the result of createSuite 1`] = ` +exports[`Test createSuite module > Initial run > Should be able to get the suite from the result of createSuite 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -30,7 +30,7 @@ SuiteSummary { } `; -exports[`Test createSuite module Initial run Should initialize with an empty result object 1`] = ` +exports[`Test createSuite module > Initial run > Should initialize with an empty result object 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], @@ -60,7 +60,7 @@ SuiteSummary { } `; -exports[`Test createSuite module Test suite Arguments allows omitting suite name 1`] = ` +exports[`Test createSuite module > Test suite Arguments > allows omitting suite name 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], diff --git a/packages/vest/src/suite/__tests__/__snapshots__/staticSuite.test.ts.snap b/packages/vest/src/suite/__tests__/__snapshots__/staticSuite.test.ts.snap index b97c65e55..e7b2b14c1 100644 --- a/packages/vest/src/suite/__tests__/__snapshots__/staticSuite.test.ts.snap +++ b/packages/vest/src/suite/__tests__/__snapshots__/staticSuite.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`staticSuite dump should output a dump of the suite 1`] = ` +exports[`staticSuite > dump > should output a dump of the suite 1`] = ` { "$type": "Suite", "abortController": AbortController {}, diff --git a/packages/vest/src/suite/__tests__/create.test.ts b/packages/vest/src/suite/__tests__/create.test.ts index 75ddfc131..7148ca2dd 100644 --- a/packages/vest/src/suite/__tests__/create.test.ts +++ b/packages/vest/src/suite/__tests__/create.test.ts @@ -1,20 +1,21 @@ import { faker } from '@faker-js/faker'; +import { ErrorStrings } from 'ErrorStrings'; import { noop } from 'lodash'; +import { describe, it, expect, vi } from 'vitest'; import { dummyTest } from '../../testUtils/testDummy'; import { TestPromise } from '../../testUtils/testPromise'; -import { ErrorStrings } from 'ErrorStrings'; import { create } from 'vest'; describe('Test createSuite module', () => { describe('Test suite Arguments', () => { it('allows omitting suite name', () => { - expect(typeof create(jest.fn())).toBe('function'); - expect(typeof create(jest.fn()).get).toBe('function'); - expect(typeof create(jest.fn()).reset).toBe('function'); - expect(typeof create(jest.fn()).remove).toBe('function'); - expect(create(jest.fn()).get()).toMatchSnapshot(); + expect(typeof create(vi.fn())).toBe('function'); + expect(typeof create(vi.fn()).get).toBe('function'); + expect(typeof create(vi.fn()).reset).toBe('function'); + expect(typeof create(vi.fn()).remove).toBe('function'); + expect(create(vi.fn()).get()).toMatchSnapshot(); }); it.each([faker.lorem.word(), null, undefined, 0, 1, true, false, NaN, ''])( @@ -22,9 +23,9 @@ describe('Test createSuite module', () => { value => { // @ts-expect-error - testing invalid input expect(() => create(value)).toThrow( - ErrorStrings.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION + ErrorStrings.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION, ); - } + }, ); describe('When suite name is provided', () => { @@ -52,7 +53,7 @@ describe('Test createSuite module', () => { })); it('Passes all arguments over to tests callback', () => { - const testsCallback = jest.fn(); + const testsCallback = vi.fn(); const params = [ 1, 2, @@ -68,7 +69,7 @@ describe('Test createSuite module', () => { }); describe('Initial run', () => { - const testsCb = jest.fn(); + const testsCb = vi.fn(); const genValidate = () => create(testsCb); it('Should initialize with an empty result object', () => { @@ -84,7 +85,7 @@ describe('Test createSuite module', () => { }); it('Should be able to get the suite from the result of createSuite', () => { - const testsCb = jest.fn(); + const testsCb = vi.fn(); expect(create(testsCb).get()).toMatchSnapshot(); }); diff --git a/packages/vest/src/suite/__tests__/remove.test.ts b/packages/vest/src/suite/__tests__/remove.test.ts index aada25460..5a4ded20f 100644 --- a/packages/vest/src/suite/__tests__/remove.test.ts +++ b/packages/vest/src/suite/__tests__/remove.test.ts @@ -1,4 +1,5 @@ import { Modes } from 'Modes'; +import { describe, it, expect } from 'vitest'; import wait from 'wait'; import { dummyTest } from '../../testUtils/testDummy'; diff --git a/packages/vest/src/suite/__tests__/resetField.test.ts b/packages/vest/src/suite/__tests__/resetField.test.ts index 01f957740..6a4063158 100644 --- a/packages/vest/src/suite/__tests__/resetField.test.ts +++ b/packages/vest/src/suite/__tests__/resetField.test.ts @@ -1,4 +1,6 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach } from 'vitest'; + import { create, test } from 'vest'; describe('suite.resetField', () => { diff --git a/packages/vest/src/suite/__tests__/staticSuite.test.ts b/packages/vest/src/suite/__tests__/staticSuite.test.ts index 6d8696498..29bf919ee 100644 --- a/packages/vest/src/suite/__tests__/staticSuite.test.ts +++ b/packages/vest/src/suite/__tests__/staticSuite.test.ts @@ -1,7 +1,8 @@ -import wait from 'wait'; - import { SuiteSerializer } from 'SuiteSerializer'; import { VestIsolateType } from 'VestIsolateType'; +import { describe, it, expect } from 'vitest'; +import wait from 'wait'; + import * as vest from 'vest'; import { staticSuite } from 'vest'; diff --git a/packages/vest/src/suite/__tests__/subscribe.test.ts b/packages/vest/src/suite/__tests__/subscribe.test.ts index a463fe71c..6bcd52e50 100644 --- a/packages/vest/src/suite/__tests__/subscribe.test.ts +++ b/packages/vest/src/suite/__tests__/subscribe.test.ts @@ -1,7 +1,8 @@ +import { SuiteSerializer } from 'SuiteSerializer'; import { enforce } from 'n4s'; +import { describe, it, expect, vi } from 'vitest'; import wait from 'wait'; -import { SuiteSerializer } from 'SuiteSerializer'; import * as vest from 'vest'; describe('suite.subscribe', () => { @@ -12,7 +13,7 @@ describe('suite.subscribe', () => { }); it('Should call the callback on suite updates', async () => { - const cb = jest.fn(() => { + const cb = vi.fn(() => { dumps.push(SuiteSerializer.serialize(suite)); }); let callCount = cb.mock.calls.length; @@ -53,7 +54,7 @@ describe('suite.subscribe', () => { describe('unsubscribe', () => { it('Should unsubscribe future events', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create('suite', () => { vest.test('field', () => {}); }); diff --git a/packages/vest/src/suite/__tests__/suiteSelectorsOnSuite.test.ts b/packages/vest/src/suite/__tests__/suiteSelectorsOnSuite.test.ts index c3c9c31d7..3f16f1c7e 100644 --- a/packages/vest/src/suite/__tests__/suiteSelectorsOnSuite.test.ts +++ b/packages/vest/src/suite/__tests__/suiteSelectorsOnSuite.test.ts @@ -1,4 +1,6 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, test, expect, beforeEach } from 'vitest'; + import * as vest from 'vest'; describe('Suite Selectors on Suite', () => { @@ -79,29 +81,29 @@ describe('Suite Selectors on Suite', () => { expect(res.hasWarnings('f4')).toEqual(suite.hasWarnings('f4')); expect(res.hasErrorsByGroup('g1')).toEqual(suite.hasErrorsByGroup('g1')); expect(res.hasErrorsByGroup('g1', 'f1')).toEqual( - suite.hasErrorsByGroup('g1', 'f1') + suite.hasErrorsByGroup('g1', 'f1'), ); expect(res.hasErrorsByGroup('g1', 'f2')).toEqual( - suite.hasErrorsByGroup('g1', 'f2') + suite.hasErrorsByGroup('g1', 'f2'), ); expect(res.hasErrorsByGroup('g1', 'f3')).toEqual( - suite.hasErrorsByGroup('g1', 'f3') + suite.hasErrorsByGroup('g1', 'f3'), ); expect(res.hasErrorsByGroup('g1', 'f4')).toEqual( - suite.hasErrorsByGroup('g1', 'f4') + suite.hasErrorsByGroup('g1', 'f4'), ); expect(res.getErrorsByGroup('g1')).toEqual(suite.getErrorsByGroup('g1')); expect(res.getErrorsByGroup('g1, f1')).toEqual( - suite.getErrorsByGroup('g1, f1') + suite.getErrorsByGroup('g1, f1'), ); expect(res.getErrorsByGroup('g1, f2')).toEqual( - suite.getErrorsByGroup('g1, f2') + suite.getErrorsByGroup('g1, f2'), ); expect(res.getErrorsByGroup('g1, f3')).toEqual( - suite.getErrorsByGroup('g1, f3') + suite.getErrorsByGroup('g1, f3'), ); expect(res.getErrorsByGroup('g1, f4')).toEqual( - suite.getErrorsByGroup('g1, f4') + suite.getErrorsByGroup('g1, f4'), ); expect(res.isValid()).toEqual(suite.isValid()); expect(res.isValid('f1')).toEqual(suite.isValid('f1')); diff --git a/packages/vest/src/suite/__tests__/typedSuite.test.ts b/packages/vest/src/suite/__tests__/typedSuite.test.ts index 8ee47aa65..d2e84daef 100644 --- a/packages/vest/src/suite/__tests__/typedSuite.test.ts +++ b/packages/vest/src/suite/__tests__/typedSuite.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect, beforeEach } from 'vitest'; + import * as vest from 'vest'; type TestFields = 'F1' | 'F2' | 'F3'; diff --git a/packages/vest/src/suite/getTypedMethods.ts b/packages/vest/src/suite/getTypedMethods.ts index 8d21d25c6..5536e307a 100644 --- a/packages/vest/src/suite/getTypedMethods.ts +++ b/packages/vest/src/suite/getTypedMethods.ts @@ -17,7 +17,7 @@ import { TestMemo } from 'test.memo'; export function getTypedMethods< F extends TFieldName, - G extends TGroupName + G extends TGroupName, >(): TTypedMethods { return { group, @@ -60,5 +60,5 @@ export type TTypedMethods = { export type TDraftCondition< F extends TFieldName, - G extends TGroupName + G extends TGroupName, > = DynamicValue]>; diff --git a/packages/vest/src/suite/validateParams/validateSuiteParams.ts b/packages/vest/src/suite/validateParams/validateSuiteParams.ts index 692ac0e17..55345cfbc 100644 --- a/packages/vest/src/suite/validateParams/validateSuiteParams.ts +++ b/packages/vest/src/suite/validateParams/validateSuiteParams.ts @@ -2,13 +2,11 @@ import { CB, invariant, isFunction } from 'vest-utils'; import { ErrorStrings } from 'ErrorStrings'; - - export function validateSuiteCallback( - suiteCallback: T + suiteCallback: T, ): asserts suiteCallback is T { invariant( isFunction(suiteCallback), - ErrorStrings.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION + ErrorStrings.SUITE_MUST_BE_INITIALIZED_WITH_FUNCTION, ); } diff --git a/packages/vest/src/suiteResult/SummaryFailure.ts b/packages/vest/src/suiteResult/SummaryFailure.ts index fbbcc2c0f..4ea4981fc 100644 --- a/packages/vest/src/suiteResult/SummaryFailure.ts +++ b/packages/vest/src/suiteResult/SummaryFailure.ts @@ -9,11 +9,11 @@ export class SummaryFailure constructor( public fieldName: F, public message: string | undefined, - public groupName: G | undefined + public groupName: G | undefined, ) {} static fromTestObject( - testObject: TIsolateTest + testObject: TIsolateTest, ) { const { fieldName, message, groupName } = VestTest.getData(testObject); diff --git a/packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap b/packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap index 7f8fc6e26..784f43cc2 100644 --- a/packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap +++ b/packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`suite() exposed methods Should have all exposed methods 1`] = ` +exports[`suite() > exposed methods > Should have all exposed methods 1`] = ` { "done": [Function], "errorCount": 0, @@ -31,7 +31,7 @@ exports[`suite() exposed methods Should have all exposed methods 1`] = ` } `; -exports[`suite.get() exposed methods Should have all exposed methods 1`] = ` +exports[`suite.get() > exposed methods > Should have all exposed methods 1`] = ` SuiteSummary { "errorCount": 0, "errors": [], diff --git a/packages/vest/src/suiteResult/__tests__/useProduceSuiteSummary.test.ts b/packages/vest/src/suiteResult/__tests__/useProduceSuiteSummary.test.ts index 8d50c2e96..bb6c3cefa 100644 --- a/packages/vest/src/suiteResult/__tests__/useProduceSuiteSummary.test.ts +++ b/packages/vest/src/suiteResult/__tests__/useProduceSuiteSummary.test.ts @@ -1,9 +1,10 @@ +import { Modes } from 'Modes'; +import { describe, it, expect } from 'vitest'; import wait from 'wait'; import { ser } from '../../testUtils/suiteDummy'; import { dummyTest } from '../../testUtils/testDummy'; -import { Modes } from 'Modes'; import * as vest from 'vest'; describe('useProduceSuiteSummary', () => { diff --git a/packages/vest/src/suiteResult/done/__tests__/done.test.ts b/packages/vest/src/suiteResult/done/__tests__/done.test.ts index fa0edf7b7..fcb06248f 100644 --- a/packages/vest/src/suiteResult/done/__tests__/done.test.ts +++ b/packages/vest/src/suiteResult/done/__tests__/done.test.ts @@ -1,3 +1,4 @@ +import { describe, it, expect, vi } from 'vitest'; import wait from 'wait'; import { dummyTest } from '../../../testUtils/testDummy'; @@ -17,8 +18,8 @@ describe('done', () => { dummyTest.failingWarning('field_2'); })(); - const doneCallback = jest.fn(); - const fieldDoneCallback = jest.fn(); + const doneCallback = vi.fn(); + const fieldDoneCallback = vi.fn(); result.done(doneCallback).done('field_2', fieldDoneCallback); @@ -34,10 +35,10 @@ describe('done', () => { test.push(dummyTest.failingAsync('test', { time: 100 })); }); - const doneCallback1 = jest.fn(); - const fieldDoneCallback1 = jest.fn(); - const doneCallback2 = jest.fn(); - const fieldDoneCallback2 = jest.fn(); + const doneCallback1 = vi.fn(); + const fieldDoneCallback1 = vi.fn(); + const doneCallback2 = vi.fn(); + const fieldDoneCallback2 = vi.fn(); suite().done(doneCallback1).done('test', fieldDoneCallback1); await wait(10); @@ -53,11 +54,11 @@ describe('done', () => { describe('When there are async tests', () => { describe('When field name is not passed', () => { it('Should run the done callback after all the fields finished running', () => { - const check1 = jest.fn(); - const check2 = jest.fn(); - const check3 = jest.fn(); + const check1 = vi.fn(); + const check2 = vi.fn(); + const check3 = vi.fn(); return TestPromise(done => { - const doneCallback = jest.fn(() => { + const doneCallback = vi.fn(() => { expect(check1).toHaveBeenCalled(); expect(check2).toHaveBeenCalled(); expect(check3).toHaveBeenCalled(); @@ -289,8 +290,8 @@ describe('done', () => { describe('When suite re-runs and a pending test is now skipped', () => { it('Should immediately call the second done callback, omit the first', async () => { - const done_0 = jest.fn(); - const done_1 = jest.fn(); + const done_0 = vi.fn(); + const done_1 = vi.fn(); const suite = vest.create(username => { vest.test('username', () => { @@ -320,7 +321,7 @@ describe('done', () => { describe('Passing a field that does not exist', () => { it('Should avoid calling the callback', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.test('test', () => {}); @@ -334,7 +335,7 @@ describe('done', () => { describe('When no tests are run', () => { it('Should run the callback', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => {}); @@ -345,7 +346,7 @@ describe('done', () => { describe('When tests are omitted', () => { it('Should run the callback', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.optional({ f1: true }); @@ -362,7 +363,7 @@ describe('done', () => { describe('When focused done call does not match executed tests', () => { it('Should not call the callback', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.test('test', () => false); @@ -377,7 +378,7 @@ describe('done', () => { describe('Async Isolate', () => { describe('When async isolate is pending', () => { it('Should not call the callback', () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.test('test', () => false); @@ -395,7 +396,7 @@ describe('done', () => { describe('When async isolate is completed', () => { it('Should call the callback', async () => { - const cb = jest.fn(); + const cb = vi.fn(); const suite = vest.create(() => { vest.test('test', () => false); diff --git a/packages/vest/src/suiteResult/done/deferDoneCallback.ts b/packages/vest/src/suiteResult/done/deferDoneCallback.ts index 2258694c6..857dce482 100644 --- a/packages/vest/src/suiteResult/done/deferDoneCallback.ts +++ b/packages/vest/src/suiteResult/done/deferDoneCallback.ts @@ -5,7 +5,7 @@ import { TFieldName } from 'SuiteResultTypes'; export function useDeferDoneCallback( doneCallback: DoneCallback, - fieldName?: TFieldName + fieldName?: TFieldName, ): void { const [, setFieldCallbacks] = useFieldCallbacks(); const [, setDoneCallbacks] = useDoneCallbacks(); @@ -14,7 +14,7 @@ export function useDeferDoneCallback( setFieldCallbacks(fieldCallbacks => assign(fieldCallbacks, { [fieldName]: (fieldCallbacks[fieldName] || []).concat(doneCallback), - }) + }), ); return; diff --git a/packages/vest/src/suiteResult/done/shouldSkipDoneRegistration.ts b/packages/vest/src/suiteResult/done/shouldSkipDoneRegistration.ts index d6a9931ae..f224dfad1 100644 --- a/packages/vest/src/suiteResult/done/shouldSkipDoneRegistration.ts +++ b/packages/vest/src/suiteResult/done/shouldSkipDoneRegistration.ts @@ -13,12 +13,12 @@ import { export function shouldSkipDoneRegistration< F extends TFieldName, - G extends TGroupName + G extends TGroupName, >( callback: (res: SuiteResult) => void, fieldName: Maybe, - output: SuiteRunResult + output: SuiteRunResult, ): boolean { // If we do not have any test runs for the current field return !!( diff --git a/packages/vest/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap b/packages/vest/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap index ba439ad5c..f15eb6e09 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap +++ b/packages/vest/src/suiteResult/selectors/__tests__/__snapshots__/collectFailureMessages.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`collectFailureMessages getErrors When no options passed should match snapshot 1`] = ` +exports[`collectFailureMessages > getErrors > When no options passed > should match snapshot 1`] = ` { "field_1": [ "field_1_failure message 2", @@ -13,23 +13,23 @@ exports[`collectFailureMessages getErrors When no options passed should match sn } `; -exports[`collectFailureMessages getErrors When specific field requested Should match snapshot 1`] = ` +exports[`collectFailureMessages > getErrors > When specific field requested > Should match snapshot 1`] = ` [ "field_1_failure message 2", "field_1_failure message 3", ] `; -exports[`collectFailureMessages getErrors When specific field requested Should match snapshot 2`] = ` +exports[`collectFailureMessages > getErrors > When specific field requested > Should match snapshot 2`] = ` [ "field_2_failure message 1", "field_2_failure message 3", ] `; -exports[`collectFailureMessages getErrors When specific field requested Should match snapshot 3`] = `[]`; +exports[`collectFailureMessages > getErrors > When specific field requested > Should match snapshot 3`] = `[]`; -exports[`collectFailureMessages getErrorsByGroup Should match snapshot 1`] = ` +exports[`collectFailureMessages > getErrorsByGroup > Should match snapshot 1`] = ` { "field_1": [], "field_2": [ @@ -39,18 +39,18 @@ exports[`collectFailureMessages getErrorsByGroup Should match snapshot 1`] = ` } `; -exports[`collectFailureMessages getErrorsByGroup with field name Should match snapshot 1`] = `[]`; +exports[`collectFailureMessages > getErrorsByGroup > with field name > Should match snapshot 1`] = `[]`; -exports[`collectFailureMessages getErrorsByGroup with field name Should match snapshot 2`] = ` +exports[`collectFailureMessages > getErrorsByGroup > with field name > Should match snapshot 2`] = ` [ "field_2_failure message 1", "field_2_failure message 3", ] `; -exports[`collectFailureMessages getErrorsByGroup with field name Should match snapshot 3`] = `[]`; +exports[`collectFailureMessages > getErrorsByGroup > with field name > Should match snapshot 3`] = `[]`; -exports[`collectFailureMessages getWarnings When no options passed should match snapshot 1`] = ` +exports[`collectFailureMessages > getWarnings > When no options passed > should match snapshot 1`] = ` { "field_2": [ "field_2_warning message 3", @@ -59,18 +59,18 @@ exports[`collectFailureMessages getWarnings When no options passed should match } `; -exports[`collectFailureMessages getWarnings When specific field requested Should match snapshot 1`] = `[]`; +exports[`collectFailureMessages > getWarnings > When specific field requested > Should match snapshot 1`] = `[]`; -exports[`collectFailureMessages getWarnings When specific field requested Should match snapshot 2`] = ` +exports[`collectFailureMessages > getWarnings > When specific field requested > Should match snapshot 2`] = ` [ "field_2_warning message 3", "field_2_warning message 2", ] `; -exports[`collectFailureMessages getWarnings When specific field requested Should match snapshot 3`] = `[]`; +exports[`collectFailureMessages > getWarnings > When specific field requested > Should match snapshot 3`] = `[]`; -exports[`collectFailureMessages getWarningsByGroup Should match snapshot 1`] = ` +exports[`collectFailureMessages > getWarningsByGroup > Should match snapshot 1`] = ` { "field_2": [ "field_2_warning message 3", @@ -78,12 +78,12 @@ exports[`collectFailureMessages getWarningsByGroup Should match snapshot 1`] = ` } `; -exports[`collectFailureMessages getWarningsByGroup with field name Should match snapshot 1`] = `[]`; +exports[`collectFailureMessages > getWarningsByGroup > with field name > Should match snapshot 1`] = `[]`; -exports[`collectFailureMessages getWarningsByGroup with field name Should match snapshot 2`] = ` +exports[`collectFailureMessages > getWarningsByGroup > with field name > Should match snapshot 2`] = ` [ "field_2_warning message 3", ] `; -exports[`collectFailureMessages getWarningsByGroup with field name Should match snapshot 3`] = `[]`; +exports[`collectFailureMessages > getWarningsByGroup > with field name > Should match snapshot 3`] = `[]`; diff --git a/packages/vest/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts index 78bb8d2a5..7f0602876 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/collectFailureMessages.test.ts @@ -1,4 +1,5 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach, test } from 'vitest'; import { dummyTest } from '../../../testUtils/testDummy'; diff --git a/packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts index 48c9a90fc..faeeb9899 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import * as vest from 'vest'; describe('->getFailure (singular form)', () => { diff --git a/packages/vest/src/suiteResult/selectors/__tests__/getFailures.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/getFailures.test.ts index 4fc566d9d..b6e75039d 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/getFailures.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/getFailures.test.ts @@ -1,6 +1,8 @@ +import { Modes } from 'Modes'; +import { describe, it, expect } from 'vitest'; + import { dummyTest } from '../../../testUtils/testDummy'; -import { Modes } from 'Modes'; import * as vest from 'vest'; describe('->getFailures', () => { diff --git a/packages/vest/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts index af312a626..7ef59c4eb 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/getFailuresByGroup.test.ts @@ -1,8 +1,9 @@ +import { Modes } from 'Modes'; import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach } from 'vitest'; import { dummyTest } from '../../../testUtils/testDummy'; -import { Modes } from 'Modes'; import { create, group } from 'vest'; import * as vest from 'vest'; @@ -29,7 +30,7 @@ describe.each(modes)('produce method: %s', mode => { describe('When fieldName passed', () => { it('Should return an empty array', () => { expect(getRes().getErrorsByGroup('group_name', 'field_name')).toEqual( - [] + [], ); }); }); @@ -59,7 +60,7 @@ describe.each(modes)('produce method: %s', mode => { dummyTest.passing(); }); expect(getRes().getErrorsByGroup('group_name', 'field_name')).toEqual( - [] + [], ); }); }); @@ -128,7 +129,7 @@ describe.each(modes)('produce method: %s', mode => { describe('When fieldName passed', () => { it('Should return an empty array', () => { expect( - getRes().getWarningsByGroup('group_name', 'field_name') + getRes().getWarningsByGroup('group_name', 'field_name'), ).toEqual([]); }); }); @@ -158,7 +159,7 @@ describe.each(modes)('produce method: %s', mode => { dummyTest.passing(); }); expect( - getRes().getWarningsByGroup('group_name', 'field_name') + getRes().getWarningsByGroup('group_name', 'field_name'), ).toEqual([]); }); }); diff --git a/packages/vest/src/suiteResult/selectors/__tests__/hasFailures.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/hasFailures.test.ts index 99def221c..b485d3b29 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/hasFailures.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/hasFailures.test.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { describe, it, expect } from 'vitest'; import { dummyTest } from '../../../testUtils/testDummy'; diff --git a/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts index a2bfe9e85..ffb1e1e60 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByGroup.test.ts @@ -1,8 +1,9 @@ import { faker } from '@faker-js/faker'; +import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect } from 'vitest'; import { dummyTest } from '../../../testUtils/testDummy'; -import { TTestSuite } from 'testUtils/TVestMock'; import * as vest from 'vest'; const fieldName = faker.lorem.word(); @@ -79,7 +80,7 @@ describe('hasErrorsByGroup', () => { }); }); expect(suite().hasErrorsByGroup(groupName, 'non_matching_field')).toBe( - false + false, ); }); }); @@ -167,7 +168,7 @@ describe('hasWarningsByGroup', () => { }); }); expect( - suite().hasWarningsByGroup(groupName, 'non_matching_field') + suite().hasWarningsByGroup(groupName, 'non_matching_field'), ).toBe(false); }); }); diff --git a/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts index 7d261210c..9cec3c01e 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/hasFailuresByTestObject.test.ts @@ -1,10 +1,10 @@ import { faker } from '@faker-js/faker'; - import { TIsolateTest } from 'IsolateTest'; import { Severity } from 'Severity'; import { VestTest } from 'VestTest'; import { hasFailuresByTestObject } from 'hasFailuresByTestObjects'; import { mockIsolateTest } from 'vestMocks'; +import { describe, it, expect, beforeEach } from 'vitest'; const fieldName: string = faker.lorem.word(); diff --git a/packages/vest/src/suiteResult/selectors/__tests__/isPending.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/isPending.test.ts index 3e60bfa88..159993e83 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/isPending.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/isPending.test.ts @@ -1,3 +1,4 @@ +import { describe, it, expect } from 'vitest'; import wait from 'wait'; import * as vest from 'vest'; diff --git a/packages/vest/src/suiteResult/selectors/__tests__/isTested.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/isTested.test.ts index 32543cf06..da7b88ca4 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/isTested.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/isTested.test.ts @@ -1,3 +1,4 @@ +import { describe, it, expect } from 'vitest'; import wait from 'wait'; import * as vest from 'vest'; diff --git a/packages/vest/src/suiteResult/selectors/__tests__/isValid.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/isValid.test.ts index efa2b3b60..b3d1408d2 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/isValid.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/isValid.test.ts @@ -1,4 +1,5 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach } from 'vitest'; import wait from 'wait'; import { TestPromise } from '../../../testUtils/testPromise'; @@ -268,7 +269,7 @@ describe('isValid', () => { return true; }); }); - })().isValid() + })().isValid(), ).toBe(false); }); }); @@ -279,7 +280,7 @@ describe('isValid', () => { create(() => { skip('field_1'); test('field_1', () => true); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(false); }); @@ -287,7 +288,7 @@ describe('isValid', () => { expect( create(() => { test('field_1', () => {}); - })().isValid('field 2') + })().isValid('field 2'), ).toBe(false); }); @@ -302,7 +303,7 @@ describe('isValid', () => { return true; }); }); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(false); }); @@ -312,7 +313,7 @@ describe('isValid', () => { test('field_1', () => { return false; }); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(false); }); @@ -322,7 +323,7 @@ describe('isValid', () => { test('field_1', () => { return true; }); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(true); }); @@ -333,7 +334,7 @@ describe('isValid', () => { warn(); return false; }); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(true); }); @@ -344,7 +345,7 @@ describe('isValid', () => { skipWhen(true, () => { test('field_1', () => false); }); - })().isValid('field_1') + })().isValid('field_1'), ).toBe(true); }); }); @@ -354,7 +355,7 @@ describe('isValid', () => { expect( create(() => { test('field_1', () => true); - })().isValid('field_2') + })().isValid('field_2'), ).toBe(false); }); }); diff --git a/packages/vest/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts index 78a75f0f1..a988a024e 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/isValidByGroup.test.ts @@ -1,9 +1,10 @@ +import { Modes } from 'Modes'; +import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, it, expect, beforeEach } from 'vitest'; import wait from 'wait'; import { TestPromise } from '../../../testUtils/testPromise'; -import { Modes } from 'Modes'; -import { TTestSuite } from 'testUtils/TVestMock'; import { test, optional, @@ -50,19 +51,19 @@ describe('isValidByGroup', () => { it('Should return false when an optional test has errors', () => { expect(suite('field_2').isValidByGroup(GROUP_NAME)).toBe(false); expect(suite('field_2').isValidByGroup(GROUP_NAME, 'field_1')).toBe( - false + false, ); }); it('Should return false when a required test has errors', () => { expect(suite('field_1').isValidByGroup(GROUP_NAME)).toBe(false); expect(suite('field_1').isValidByGroup(GROUP_NAME, 'field_2')).toBe( - false + false, ); }); it('Should return false when the queried field is not optional and has errors', () => { expect(suite('field_2').isValidByGroup(GROUP_NAME, 'field_2')).toBe( - false + false, ); }); @@ -147,7 +148,7 @@ describe('isValidByGroup', () => { }); it('Should return false', () => { expect(suite(['field_2', 'field_3']).isValidByGroup(GROUP_NAME)).toBe( - false + false, ); }); }); @@ -310,7 +311,7 @@ describe('isValidByGroup', () => { }); }); }); - })().isValidByGroup(GROUP_NAME) + })().isValidByGroup(GROUP_NAME), ).toBe(false); }); }); @@ -323,7 +324,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => true); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(false); }); @@ -333,7 +334,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => {}); }); - })().isValidByGroup(GROUP_NAME, 'field 2') + })().isValidByGroup(GROUP_NAME, 'field 2'), ).toBe(false); }); @@ -350,7 +351,7 @@ describe('isValidByGroup', () => { }); }); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(false); }); @@ -360,7 +361,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => false); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(false); }); @@ -370,7 +371,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => {}); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(true); }); @@ -383,7 +384,7 @@ describe('isValidByGroup', () => { return false; }); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(true); }); @@ -396,7 +397,7 @@ describe('isValidByGroup', () => { test('field_1', () => false); }); }); - })().isValidByGroup(GROUP_NAME, 'field_1') + })().isValidByGroup(GROUP_NAME, 'field_1'), ).toBe(true); }); }); @@ -408,7 +409,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => true); }); - })().isValidByGroup(GROUP_NAME, 'field_2') + })().isValidByGroup(GROUP_NAME, 'field_2'), ).toBe(false); }); }); @@ -435,7 +436,7 @@ describe('isValidByGroup', () => { group(GROUP_NAME, () => { test('field_1', () => false); }); - })().isValidByGroup(GROUP_NAME) + })().isValidByGroup(GROUP_NAME), ).toBe(true); }); }); diff --git a/packages/vest/src/suiteResult/selectors/__tests__/summaryFailures.test.ts b/packages/vest/src/suiteResult/selectors/__tests__/summaryFailures.test.ts index 1d2e1199d..b7cc72bcb 100644 --- a/packages/vest/src/suiteResult/selectors/__tests__/summaryFailures.test.ts +++ b/packages/vest/src/suiteResult/selectors/__tests__/summaryFailures.test.ts @@ -1,4 +1,5 @@ import { TTestSuite } from 'testUtils/TVestMock'; +import { describe, test, expect, beforeEach } from 'vitest'; import * as vest from 'vest'; diff --git a/packages/vest/src/suiteResult/selectors/collectFailures.ts b/packages/vest/src/suiteResult/selectors/collectFailures.ts index 798d69c70..cc513060d 100644 --- a/packages/vest/src/suiteResult/selectors/collectFailures.ts +++ b/packages/vest/src/suiteResult/selectors/collectFailures.ts @@ -13,7 +13,7 @@ import { export function gatherFailures( testGroup: TestsContainer, severityKey: Severity, - fieldName?: TFieldName + fieldName?: TFieldName, ): string[] | FailureMessages { return fieldName ? getByFieldName(testGroup, severityKey, fieldName) @@ -23,14 +23,14 @@ export function gatherFailures( function getByFieldName( testGroup: TestsContainer, severityKey: Severity, - fieldName: TFieldName + fieldName: TFieldName, ): string[] { return testGroup?.[fieldName]?.[severityKey] || []; } function collectAll( testGroup: TestsContainer, - severityKey: Severity + severityKey: Severity, ): FailureMessages { const output: FailureMessages = {}; diff --git a/packages/vest/src/testUtils/__tests__/partition.test.ts b/packages/vest/src/testUtils/__tests__/partition.test.ts index dc0feef85..3da3b447c 100644 --- a/packages/vest/src/testUtils/__tests__/partition.test.ts +++ b/packages/vest/src/testUtils/__tests__/partition.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import partition from '../partition'; describe('partition', () => { diff --git a/packages/vest/src/testUtils/mockThrowError.ts b/packages/vest/src/testUtils/mockThrowError.ts deleted file mode 100644 index 208a974ed..000000000 --- a/packages/vest/src/testUtils/mockThrowError.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TVestMock } from './TVestMock'; - -export default function mockThrowError() { - const deferThrow = jest.fn(); - jest.resetModules(); - jest.mock('vest-utils', () => ({ - ...jest.requireActual('vest-utils'), - deferThrow, - })); - const vest = require('vest') as TVestMock; - - return { - deferThrow, - vest, - }; -} diff --git a/packages/vest/src/testUtils/partition.ts b/packages/vest/src/testUtils/partition.ts index 8af8050db..8dbbcbaed 100644 --- a/packages/vest/src/testUtils/partition.ts +++ b/packages/vest/src/testUtils/partition.ts @@ -1,12 +1,12 @@ export default function partition( array: T[], - predicate: (value: T, _index: number, array: T[]) => boolean + predicate: (value: T, _index: number, array: T[]) => boolean, ): [T[], T[]] { return array.reduce( (partitions: [T[], T[]], value, number) => { partitions[predicate(value, number, array) ? 0 : 1].push(value); return partitions; }, - [[], []] + [[], []], ); } diff --git a/packages/vest/src/testUtils/suiteDummy.ts b/packages/vest/src/testUtils/suiteDummy.ts index 59917a1d4..8a0f83b2b 100644 --- a/packages/vest/src/testUtils/suiteDummy.ts +++ b/packages/vest/src/testUtils/suiteDummy.ts @@ -31,7 +31,7 @@ export function passing(fields?: OneOrMoreOf) { export function passingWithUntestedOptional( optionals: OneOrMoreOf = 'optional_field', - required: OneOrMoreOf = 'field_1' + required: OneOrMoreOf = 'field_1', ) { return create(() => { optional(optionals); @@ -49,7 +49,7 @@ export function passingWithUntestedOptional( export function passingWithOptional( optionals: OneOrMoreOf = 'optional_field', - required: OneOrMoreOf = 'field_1' + required: OneOrMoreOf = 'field_1', ) { return create(() => { optional(optionals); @@ -66,7 +66,7 @@ export function passingWithOptional( export function failingOptional( optionals: OneOrMoreOf = 'optional_field', - required: OneOrMoreOf = 'field_1' + required: OneOrMoreOf = 'field_1', ) { return create(() => { optional(optionals); @@ -90,14 +90,14 @@ export function untested(fields?: OneOrMoreOf) { function createSuiteRunResult( fieldNames: Maybe, - callback: (_fieldName?: string) => void + callback: (_fieldName?: string) => void, ) { return createSuite(fieldNames, callback)(); } function createSuite( fieldNames: Maybe = 'field_1', - callback: (_fieldName?: string) => void + callback: (_fieldName?: string) => void, ) { return create(() => { asArray(fieldNames).forEach(fieldName => callback(fieldName)); @@ -105,7 +105,7 @@ function createSuite( } export function ser( - res: SuiteResult + res: SuiteResult, ) { return JSON.parse(JSON.stringify(res)); } diff --git a/packages/vest/src/testUtils/testDummy.ts b/packages/vest/src/testUtils/testDummy.ts index ab2f1fe85..2b57759a0 100644 --- a/packages/vest/src/testUtils/testDummy.ts +++ b/packages/vest/src/testUtils/testDummy.ts @@ -1,5 +1,5 @@ -/* eslint-disable jest/valid-title */ import { faker } from '@faker-js/faker'; +import { vi } from 'vitest'; import { test as vestTest, warn } from 'vest'; @@ -10,14 +10,14 @@ import { test as vestTest, warn } from 'vest'; const testDummy = () => { const failing = ( name: string = faker.lorem.word(), - message: string = faker.lorem.words() + message: string = faker.lorem.words(), ) => { const to = vestTest( name, message, - jest.fn(() => { + vi.fn(() => { throw new Error(); - }) + }), ); return to; @@ -25,15 +25,15 @@ const testDummy = () => { const failingWarning = ( name = faker.lorem.word(), - message = faker.lorem.words() + message = faker.lorem.words(), ) => { const to = vestTest( name, message, - jest.fn(() => { + vi.fn(() => { warn(); throw new Error(); - }) + }), ); return to; @@ -41,85 +41,85 @@ const testDummy = () => { const passing = ( name = faker.lorem.word(), - message = faker.lorem.words() + message = faker.lorem.words(), ) => { - const to = vestTest(name, message, jest.fn()); + const to = vestTest(name, message, vi.fn()); return to; }; const passingWarning = ( name = faker.lorem.word(), - message = faker.lorem.words() + message = faker.lorem.words(), ) => { const to = vestTest( name, message, - jest.fn(() => { + vi.fn(() => { warn(); - }) + }), ); return to; }; const failingAsync = ( name = faker.lorem.word(), - { message = faker.lorem.words(), time = 0 } = {} + { message = faker.lorem.words(), time = 0 } = {}, ) => vestTest( name, message, - jest.fn( + vi.fn( () => new Promise((_, reject) => { setTimeout(reject, time); - }) - ) + }), + ), ); const failingWarningAsync = ( name = faker.lorem.word(), - { message = faker.lorem.words(), time = 0 } = {} + { message = faker.lorem.words(), time = 0 } = {}, ) => vestTest( name, message, - jest.fn(() => { + vi.fn(() => { warn(); return new Promise((_, reject) => { setTimeout(reject, time); }); - }) + }), ); const passingAsync = ( name = faker.lorem.word(), - { message = faker.lorem.words(), time = 0 } = {} + { message = faker.lorem.words(), time = 0 } = {}, ) => vestTest( name, message, - jest.fn( + vi.fn( () => new Promise(resolve => { setTimeout(resolve, time); - }) - ) + }), + ), ); const passingWarningAsync = ( name = faker.lorem.word(), - { message = faker.lorem.words(), time = 0 } = {} + { message = faker.lorem.words(), time = 0 } = {}, ) => vestTest( name, message, - jest.fn(() => { + vi.fn(() => { warn(); return new Promise(resolve => { setTimeout(resolve, time); }); - }) + }), ); return { diff --git a/packages/vest/src/testUtils/vestMocks.ts b/packages/vest/src/testUtils/vestMocks.ts index d6804e041..98e980967 100644 --- a/packages/vest/src/testUtils/vestMocks.ts +++ b/packages/vest/src/testUtils/vestMocks.ts @@ -4,11 +4,11 @@ import { IsolateTestBase, IsolateTestPayload, TIsolateTest } from 'IsolateTest'; import { VestIsolateType } from 'VestIsolateType'; export function mockIsolateTest( - payload: Partial = {} + payload: Partial = {}, ): TIsolateTest { const isolate = genTestIsolate({ ...IsolateTestBase(), - testFn: jest.fn(), + testFn: vi.fn(), ...payload, type: VestIsolateType.Test, }) as TIsolateTest; diff --git a/packages/vest/tsconfig.json b/packages/vest/tsconfig.json index 1eee3487e..8feccd6d6 100644 --- a/packages/vest/tsconfig.json +++ b/packages/vest/tsconfig.json @@ -13,7 +13,6 @@ "testDummy": ["./src/testUtils/testDummy.ts"], "suiteDummy": ["./src/testUtils/suiteDummy.ts"], "partition": ["./src/testUtils/partition.ts"], - "mockThrowError": ["./src/testUtils/mockThrowError.ts"], "TVestMock": ["./src/testUtils/TVestMock.ts"], "suiteRunResult": ["./src/suiteResult/suiteRunResult.ts"], "suiteResult": ["./src/suiteResult/suiteResult.ts"], diff --git a/packages/vestjs-runtime/src/Isolate/IsolateInspector.ts b/packages/vestjs-runtime/src/Isolate/IsolateInspector.ts index 98b42ae2b..ab43aa57f 100644 --- a/packages/vestjs-runtime/src/Isolate/IsolateInspector.ts +++ b/packages/vestjs-runtime/src/Isolate/IsolateInspector.ts @@ -26,7 +26,7 @@ export class IsolateInspector { } static allowsReorder>( - isolate: Nullable + isolate: Nullable, ): boolean { return isolate?.allowReorder === true; } @@ -40,7 +40,7 @@ export class IsolateInspector { static getChildByKey( isolate: Nullable, - key: string + key: string, ): Nullable { if (isNullish(isolate)) { return null; diff --git a/packages/vestjs-runtime/src/Isolate/IsolateSelectors.ts b/packages/vestjs-runtime/src/Isolate/IsolateSelectors.ts index 119e0f9f1..37c444d73 100644 --- a/packages/vestjs-runtime/src/Isolate/IsolateSelectors.ts +++ b/packages/vestjs-runtime/src/Isolate/IsolateSelectors.ts @@ -5,21 +5,21 @@ import { IsolateKeys } from 'IsolateKeys'; export function isIsolateType( node: Maybe, - type: string + type: string, ): node is I { return node?.[IsolateKeys.Type] === type; } export function isSameIsolateType( a: A, - b: B + b: B, ): boolean { return isIsolateType(a, b[IsolateKeys.Type]); } export function isSameIsolateIdentity( a: A, - b: B + b: B, ): boolean { return Object.is(a, b) || (isSameIsolateType(a, b) && a.key === b.key); } diff --git a/packages/vestjs-runtime/src/Isolate/__tests__/Isolate.test.ts b/packages/vestjs-runtime/src/Isolate/__tests__/Isolate.test.ts index b34a9c6ba..1f5514761 100644 --- a/packages/vestjs-runtime/src/Isolate/__tests__/Isolate.test.ts +++ b/packages/vestjs-runtime/src/Isolate/__tests__/Isolate.test.ts @@ -1,4 +1,5 @@ import { CB } from 'vest-utils'; +import { describe, it, expect, beforeEach, vi } from 'vitest'; import { TIsolate, Isolate } from 'Isolate'; import { StateRefType, useAvailableRoot } from 'VestRuntime'; @@ -25,7 +26,7 @@ describe('Isolate', () => { }); it('Should run the passed callback', () => { - const spy = jest.fn(); + const spy = vi.fn(); withRunTime(() => { Isolate.create(IsolateType.Isolate, spy); }); @@ -39,7 +40,7 @@ describe('Isolate', () => { () => { return 'foo'; }, - {} + {}, ); }); expect(isolate.output).toBe('foo'); @@ -108,7 +109,7 @@ describe('Isolate', () => { const isolate = withRunTime(() => { return Isolate.create(IsolateType.Isolate, () => {}); }); - const spy = jest.spyOn(isolate.abortController, 'abort'); + const spy = vi.spyOn(isolate.abortController, 'abort'); IsolateMutator.abort(isolate, 'foo'); expect(spy).toHaveBeenCalledWith('foo'); }); diff --git a/packages/vestjs-runtime/src/Isolate/__tests__/IsolateInspector.test.ts b/packages/vestjs-runtime/src/Isolate/__tests__/IsolateInspector.test.ts index 67441ec57..6631e6256 100644 --- a/packages/vestjs-runtime/src/Isolate/__tests__/IsolateInspector.test.ts +++ b/packages/vestjs-runtime/src/Isolate/__tests__/IsolateInspector.test.ts @@ -1,3 +1,5 @@ +import { describe, it, expect } from 'vitest'; + import { TIsolate } from 'Isolate'; import { IsolateInspector } from 'IsolateInspector'; diff --git a/packages/vestjs-runtime/src/Isolate/__tests__/IsolateMutator.test.ts b/packages/vestjs-runtime/src/Isolate/__tests__/IsolateMutator.test.ts index 82f954278..be4461230 100644 --- a/packages/vestjs-runtime/src/Isolate/__tests__/IsolateMutator.test.ts +++ b/packages/vestjs-runtime/src/Isolate/__tests__/IsolateMutator.test.ts @@ -1,5 +1,6 @@ import { TIsolate } from 'Isolate'; import { IsolateMutator } from 'IsolateMutator'; +import { describe, it, expect, vi } from 'vitest'; describe('IsolateMutator', () => { describe('setParent', () => { @@ -121,7 +122,7 @@ describe('IsolateMutator', () => { describe('abort', () => { it('Should abort the controller', () => { const isolate = { - abortController: { abort: jest.fn() }, + abortController: { abort: vi.fn() }, } as unknown as TIsolate; expect(isolate.abortController.abort).not.toHaveBeenCalled(); @@ -141,7 +142,7 @@ describe('IsolateMutator', () => { it('Should abort the controller with the passed reason', () => { const isolate = { - abortController: { abort: jest.fn() }, + abortController: { abort: vi.fn() }, } as unknown as TIsolate; expect(isolate.abortController.abort).not.toHaveBeenCalled(); diff --git a/packages/vestjs-runtime/src/Isolate/__tests__/__snapshots__/asyncIsolate.test.ts.snap b/packages/vestjs-runtime/src/Isolate/__tests__/__snapshots__/asyncIsolate.test.ts.snap index 0629e6442..106400687 100644 --- a/packages/vestjs-runtime/src/Isolate/__tests__/__snapshots__/asyncIsolate.test.ts.snap +++ b/packages/vestjs-runtime/src/Isolate/__tests__/__snapshots__/asyncIsolate.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AsyncIsolate It should resolve async isolate into the parent 2`] = ` +exports[`AsyncIsolate > It should resolve async isolate into the parent 2`] = ` { "$type": "URoot", "abortController": AbortController {}, diff --git a/packages/vestjs-runtime/src/Isolate/__tests__/asyncIsolate.test.ts b/packages/vestjs-runtime/src/Isolate/__tests__/asyncIsolate.test.ts index 61ee003bc..714610bdc 100644 --- a/packages/vestjs-runtime/src/Isolate/__tests__/asyncIsolate.test.ts +++ b/packages/vestjs-runtime/src/Isolate/__tests__/asyncIsolate.test.ts @@ -1,9 +1,10 @@ -import { CB } from 'vest-utils'; -import wait from 'wait'; - import { useBus } from 'Bus'; import { Isolate, TIsolate } from 'Isolate'; import { RuntimeEvents } from 'RuntimeEvents'; +import { CB } from 'vest-utils'; +import { describe, vi, it, expect, test } from 'vitest'; +import wait from 'wait'; + import { VestRuntime } from 'vestjs-runtime'; describe('AsyncIsolate', () => { @@ -32,15 +33,15 @@ describe('AsyncIsolate', () => { expect(root?.children?.[0].parent).toBe(root); expect(root?.children?.[0]?.children?.[0]?.$type).toBe('UGrandChild_1'); expect(root?.children?.[0]?.children?.[0].parent).toBe( - root?.children?.[0] + root?.children?.[0], ); expect(root?.children?.[0]?.children?.[1]?.$type).toBe('UGrandChild_2'); expect(root?.children?.[0]?.children?.[1].parent).toBe( - root?.children?.[0] + root?.children?.[0], ); expect(root?.children?.[0]?.children?.[2]?.$type).toBe('UGrandChild_3'); expect(root?.children?.[0]?.children?.[2].parent).toBe( - root?.children?.[0] + root?.children?.[0], ); expect(root).toMatchSnapshot(); @@ -49,7 +50,7 @@ describe('AsyncIsolate', () => { }); it('Should emit an event when an async isolate is done running', () => { - const cb = jest.fn(); + const cb = vi.fn(); return new Promise(async done => { let child = {} as TIsolate; withRunTime(() => { @@ -88,6 +89,6 @@ async function genChildren() { Isolate.create('UGrandChild_1', () => {}); Isolate.create('UGrandChild_2', () => {}); Isolate.create('UGrandChild_3', () => {}); - }) + }), ); } diff --git a/packages/vestjs-runtime/src/VestRuntime.ts b/packages/vestjs-runtime/src/VestRuntime.ts index 7c4506268..402816a46 100644 --- a/packages/vestjs-runtime/src/VestRuntime.ts +++ b/packages/vestjs-runtime/src/VestRuntime.ts @@ -76,7 +76,7 @@ export function useXAppData() { export function createRef( Reconciler: IRecociler, - setter: DynamicValue> + setter: DynamicValue>, ): StateRefType { return Object.freeze({ Bus: bus.createBus(), diff --git a/packages/vestjs-runtime/src/__tests__/IsolateWalker.test.ts b/packages/vestjs-runtime/src/__tests__/IsolateWalker.test.ts index e86cb3a30..7ff3c5d20 100644 --- a/packages/vestjs-runtime/src/__tests__/IsolateWalker.test.ts +++ b/packages/vestjs-runtime/src/__tests__/IsolateWalker.test.ts @@ -1,5 +1,5 @@ -import { TIsolate } from 'Isolate'; import { walk, reduce, findAll } from 'IsolateWalker'; +import { describe, it, expect, beforeEach } from 'vitest'; // import { TIsolate } from 'Isolate'; type WalkedNode = TIsolate<{ id: string }>; diff --git a/packages/vestjs-runtime/src/exports/__tests__/IsolateSerializer.test.ts b/packages/vestjs-runtime/src/exports/__tests__/IsolateSerializer.test.ts index df9d528aa..553d3e890 100644 --- a/packages/vestjs-runtime/src/exports/__tests__/IsolateSerializer.test.ts +++ b/packages/vestjs-runtime/src/exports/__tests__/IsolateSerializer.test.ts @@ -1,9 +1,9 @@ -import { Maybe } from 'vest-utils'; - import { Isolate, TIsolate } from 'Isolate'; -import { MinifiedKeys } from 'IsolateKeys'; import { IsolateSerializer } from 'IsolateSerializer'; -import { IsolateMutator, VestRuntime } from 'vestjs-runtime'; +import { Maybe } from 'vest-utils'; +import { describe, it, expect, test } from 'vitest'; + +import { VestRuntime } from 'vestjs-runtime'; describe('IsolateSerializer', () => { describe('serialize', () => { diff --git a/packages/vestjs-runtime/src/exports/__tests__/__snapshots__/IsolateSerializer.test.ts.snap b/packages/vestjs-runtime/src/exports/__tests__/__snapshots__/IsolateSerializer.test.ts.snap index bb92986ff..215cf659c 100644 --- a/packages/vestjs-runtime/src/exports/__tests__/__snapshots__/IsolateSerializer.test.ts.snap +++ b/packages/vestjs-runtime/src/exports/__tests__/__snapshots__/IsolateSerializer.test.ts.snap @@ -1,5 +1,5 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`IsolateSerializer Custom Data Serialization Should serialize data with custom keys 1`] = `"[{"0":"URoot","1":{"2":"3"},"children":[{"0":"UChild_1","1":{"2":"3"}},{"0":"UChild_2"},{"0":"UChild_3"}]},{"0":"$type","1":"data","2":"some_data","3":true}]"`; +exports[`IsolateSerializer > Custom Data Serialization > Should serialize data with custom keys 1`] = `"[{"0":"URoot","1":{"2":"3"},"children":[{"0":"UChild_1","1":{"2":"3"}},{"0":"UChild_2"},{"0":"UChild_3"}]},{"0":"$type","1":"data","2":"some_data","3":true}]"`; -exports[`IsolateSerializer serialize Should produce serialized dump 1`] = `"[{"0":"URoot","1":{"2":"3"},"children":[{"0":"UChild_1","1":{"2":"3"}},{"0":"UChild_2"},{"0":"UChild_3"}]},{"0":"$type","1":"data","2":"some_data","3":true}]"`; +exports[`IsolateSerializer > serialize > Should produce serialized dump 1`] = `"[{"0":"URoot","1":{"2":"3"},"children":[{"0":"UChild_1","1":{"2":"3"}},{"0":"UChild_2"},{"0":"UChild_3"}]},{"0":"$type","1":"data","2":"some_data","3":true}]"`; diff --git a/tsconfig.json b/tsconfig.json index f63991d99..f3f147415 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,6 @@ "strict": true, "target": "ES2015" }, - "files": ["./vx/config/jest/globals.d.ts"], + "files": ["./vx/config/vitest/vitest.d.ts"], "include": ["./packages/*/src/**/*.ts"] } diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000..736555f2b --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,17 @@ +import tsconfigPaths from 'vite-tsconfig-paths'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + include: ['packages/**/__tests__/*.test.ts'], + setupFiles: ['vx/config/vitest/customMatchers.ts/customMatchers.ts'], + }, + root: __dirname, + plugins: [ + tsconfigPaths({ + loose: true, + projects: ["packages/vest-utils","packages/context","packages/vestjs-runtime","packages/vast","packages/n4s","packages/vest","packages/anyone"], + }), + ], +}); diff --git a/vitest.workspace.js b/vitest.workspace.js new file mode 100644 index 000000000..a971dee23 --- /dev/null +++ b/vitest.workspace.js @@ -0,0 +1 @@ +export default ['packages/*']; diff --git a/vx/cli.js b/vx/cli.js index cdb25d88a..d5a9801e7 100755 --- a/vx/cli.js +++ b/vx/cli.js @@ -56,7 +56,7 @@ const cli = yargs(argv) const { package, command, fastBuild, _: cliOptions = [] } = cli; // Prepare all packages before running any other command. -if (command !== 'prepare') { +if (command !== 'prepare' && command !== 'dev') { commands.prepare(); } @@ -68,14 +68,14 @@ logger.info( joinTruthy([ `Running command ${command}`, package && `for package ${package}`, - ]) + ]), ); ctx.withPackage(package, () => commands[command]({ fastBuild, cliOptions: cliOptions.join(' '), - }) + }), ); function insidePackageDir() { diff --git a/vx/commands/dev/dev.js b/vx/commands/dev/dev.js index cfa48789e..b8c75e398 100644 --- a/vx/commands/dev/dev.js +++ b/vx/commands/dev/dev.js @@ -5,7 +5,7 @@ module.exports = () => { exec( `${vxPath.vxRoot()}/node_modules/.bin/onchange -d 5000 -i -k ${vxPath.packageSrc( '*', - '**/*.ts' - )} ${vxPath.packageSrc('*', '**/*.ts')} -- vx prepare` + './src/**/*.ts', + )} -- vx prepare`, ); }; diff --git a/vx/commands/init/prompt/index.js b/vx/commands/init/prompt/index.js index 63aa6af9b..a74dccbea 100644 --- a/vx/commands/init/prompt/index.js +++ b/vx/commands/init/prompt/index.js @@ -68,6 +68,7 @@ function scaffold(config) { const template = path.resolve(vxPath.VX_COMMANDS_PATH, 'init/template'); const packagePath = vxPath.package(config.name); fsExtra.copySync(path.join(template), packagePath); + removeTemplateExtensionFromFile(packagePath, config.name); writeEntryPoint(packagePath, config.name); updateValues(packagePath, config); @@ -81,7 +82,7 @@ function writeEntryPoint(packagePath, packageName) { fsExtra.writeFileSync( vxPath.packageSrc(packageName, `${packageName}.ts`), `export const main = () => "${packageName}";`, - 'utf8' + 'utf8', ); } @@ -93,7 +94,7 @@ function updateValues(packagePath, config) { Object.keys(configMapping).forEach(key => { content = content.replace( new RegExp(`{{${key}}}`, 'g'), - config[configMapping[key]] ?? configMapping[key] + config[configMapping[key]] ?? configMapping[key], ); }); @@ -102,6 +103,12 @@ function updateValues(packagePath, config) { }); } +function removeTemplateExtensionFromFile(packagePath, packageName) { + glob.sync(packagePath + '/**/*.tmpl').forEach(file => { + fsExtra.moveSync(file, file.replace('.tmpl', '')); + }); +} + const configMapping = { PACKAGE_AUTHOR: 'author', PACKAGE_DESCRIPTION: 'description', diff --git a/vx/commands/init/template/tsconfig.json b/vx/commands/init/template/tsconfig.json deleted file mode 100644 index 3dda57f43..000000000 --- a/vx/commands/init/template/tsconfig.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "rootDir": ".", - "compilerOptions": { - "baseUrl": ".", - "declarationDir": "./types", - "declarationMap": true, - "outDir": "./dist", - "paths": { - "asArray": ["src/asArray.ts"], - "assign": ["src/assign.ts"], - "bindNot": ["src/bindNot.ts"], - "bus": ["src/bus.ts"], - "cache": ["src/cache.ts"], - "callEach": ["src/callEach.ts"], - "defaultTo": ["src/defaultTo.ts"], - "deferThrow": ["src/deferThrow.ts"], - "either": ["src/either.ts"], - "globals.d": ["src/globals.d.ts"], - "greaterThan": ["src/greaterThan.ts"], - "hasOwnProperty": ["src/hasOwnProperty.ts"], - "invariant": ["src/invariant.ts"], - "isArrayValue": ["src/isArrayValue.ts"], - "isBooleanValue": ["src/isBooleanValue.ts"], - "isEmpty": ["src/isEmpty.ts"], - "isFunction": ["src/isFunction.ts"], - "isNull": ["src/isNull.ts"], - "isNullish": ["src/isNullish.ts"], - "isNumeric": ["src/isNumeric.ts"], - "isPositive": ["src/isPositive.ts"], - "isPromise": ["src/isPromise.ts"], - "isStringValue": ["src/isStringValue.ts"], - "isUndefined": ["src/isUndefined.ts"], - "last": ["src/last.ts"], - "lengthEquals": ["src/lengthEquals.ts"], - "longerThan": ["src/longerThan.ts"], - "mapFirst": ["src/mapFirst.ts"], - "nestedArray": ["src/nestedArray.ts"], - "numberEquals": ["src/numberEquals.ts"], - "optionalFunctionValue": ["src/optionalFunctionValue.ts"], - "seq": ["src/seq.ts"], - "utilityTypes": ["src/utilityTypes.ts"], - "vest-utils": ["src/vest-utils.ts"] - } - } -} diff --git a/vx/commands/init/template/tsconfig.json.tmpl b/vx/commands/init/template/tsconfig.json.tmpl new file mode 100644 index 000000000..6460e44fa --- /dev/null +++ b/vx/commands/init/template/tsconfig.json.tmpl @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "rootDir": ".", + "compilerOptions": { + "baseUrl": ".", + "declarationDir": "./types", + "declarationMap": true, + "outDir": "./dist", + "paths": {} + } +} diff --git a/vx/commands/prepare/prepare.js b/vx/commands/prepare/prepare.js index b56d1b1a5..72551ae4f 100644 --- a/vx/commands/prepare/prepare.js +++ b/vx/commands/prepare/prepare.js @@ -1,3 +1,5 @@ +const genVitestConfig = require('../../scripts/genVitestConfig'); + const genNpmIgnore = require('vx/commands/npmignore/npmignore'); const genTsConfig = require('vx/commands/tsconfig/tsconfig'); const logger = require('vx/logger'); @@ -6,4 +8,5 @@ module.exports = () => { logger.info('Preparing packages...'); genNpmIgnore(); genTsConfig(); + genVitestConfig(); }; diff --git a/vx/commands/test/test.js b/vx/commands/test/test.js index 241cff736..764cad6ca 100644 --- a/vx/commands/test/test.js +++ b/vx/commands/test/test.js @@ -5,17 +5,14 @@ const opts = require('vx/opts'); const { usePackage } = require('vx/vxContext'); const vxPath = require('vx/vxPath'); -const configOpt = `--config ${path.resolve( - vxPath.JEST_CONFIG_PATH, - opts.fileNames.JEST_CONFIG -)}`; +const configOpt = `--config ${path.resolve(vxPath.VITEST_CONFIG_FILE_PATH)}`; function test({ cliOptions }) { const pkgName = usePackage(); exec([ - 'yarn jest', - pkgName && `--rootDir ${vxPath.package(pkgName)}`, + 'yarn vitest', + pkgName && `--project ${vxPath.package(pkgName)}`, configOpt, cliOptions, ]); diff --git a/vx/config/jest/globals.d.ts b/vx/config/jest/globals.d.ts deleted file mode 100644 index e79a000bb..000000000 --- a/vx/config/jest/globals.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare global { - namespace jest { - interface Matchers { - isDeepCopyOf(clone: any): CustomMatcherResult; - } - } -} -export {}; diff --git a/vx/config/jest/jest.config.js b/vx/config/jest/jest.config.js deleted file mode 100644 index e5eba8c46..000000000 --- a/vx/config/jest/jest.config.js +++ /dev/null @@ -1,89 +0,0 @@ -const path = require('path'); - -const glob = require('glob'); - -const opts = require('vx/opts'); -const packageNames = require('vx/packageNames'); -const packageJson = require('vx/util/packageJson'); -const pathsPerPackage = require('vx/util/pathsPerPackage'); -const { usePackage } = require('vx/vxContext'); -const vxPath = require('vx/vxPath'); - -const setupPerPackage = glob.sync( - vxPath.packageConfigPath( - usePackage() ?? '*', - opts.dir.JEST, - opts.fileNames.JEST_SETUP - ) -); - -const setupAfterEnvPerPackage = glob.sync( - vxPath.packageConfigPath( - usePackage() ?? '*', - opts.dir.JEST, - opts.fileNames.JEST_SETUP_AFTER_ENV - ) -); - -const projects = packageNames.list.map(packageName => ({ - ...baseConfig(packageName), - displayName: packageName, - moduleNameMapper: genNameMapper(pathsPerPackage.packages[packageName]), - rootDir: vxPath.package(packageName), - testMatch: [ - vxPath.package(packageName, `**/${opts.dir.TESTS}/*.(spec|test).ts`), - ], -})); - -module.exports = { - projects, -}; - -function baseConfig(packageName) { - const allowResolve = packageJson.getVxAllowResolve(packageName); - return { - clearMocks: true, - maxWorkers: 1, - rootDir: vxPath.ROOT_PATH, - roots: [''], - setupFiles: [ - path.resolve(vxPath.JEST_CONFIG_PATH, opts.fileNames.JEST_SETUP), - ].concat(setupPerPackage), - setupFilesAfterEnv: [ - path.resolve( - vxPath.JEST_CONFIG_PATH, - opts.fileNames.JEST_SETUP_AFTER_ENV - ), - ].concat(setupAfterEnvPerPackage), - testEnvironment: 'node', - transform: { - [`.+\\.(ts|tsx)$`]: [ - 'ts-jest', - { - isolatedModules: true, - tsconfig: { - // This is needed to allow jest to transform js files - // That are originated in node_modules - allowJs: true, - }, - }, - ], - }, - ...(allowResolve.length > 0 && { - preset: 'ts-jest/presets/js-with-ts', - transformIgnorePatterns: [ - `node_modules/(?!(${allowResolve.join('|')})/.*)`, - ], - }), - }; -} - -function genNameMapper(modules) { - return modules.reduce( - (aliases, { name, absolute }) => - Object.assign(aliases, { - [`^${name}$`]: absolute, - }), - {} - ); -} diff --git a/vx/config/jest/jest.setup.ts b/vx/config/jest/jest.setup.ts deleted file mode 100644 index 95f3a2293..000000000 --- a/vx/config/jest/jest.setup.ts +++ /dev/null @@ -1,6 +0,0 @@ -import './globals.d'; - -declare namespace global { - export const __DEV__: boolean; - export const __LIB_VERSION__: string; -} diff --git a/vx/config/rollup/format.js b/vx/config/rollup/format.js index 2fa630b96..f8945b361 100644 --- a/vx/config/rollup/format.js +++ b/vx/config/rollup/format.js @@ -7,7 +7,7 @@ const format = [].concat( opts.format.CJS, opts.format.ES, opts.format.UMD, - ] + ], ); const disallowExternals = format === opts.format.UMD; diff --git a/vx/config/rollup/getPlugins.js b/vx/config/rollup/getPlugins.js index 1b982fb33..e4b9ddbe7 100644 --- a/vx/config/rollup/getPlugins.js +++ b/vx/config/rollup/getPlugins.js @@ -42,7 +42,7 @@ module.exports = function getPlugins({ packageName, opts.dir.TYPES, namespace, - moduleName + '.d.ts' + moduleName + '.d.ts', ); if (kind === 'declaration') return basePath; @@ -82,7 +82,7 @@ module.exports = function getPlugins({ terser(), handleExports({ namespace }), addModulePackageJson(), - addCJSPackageJson() + addCJSPackageJson(), ); } diff --git a/vx/config/rollup/plugins/addCJSPackageJson.js b/vx/config/rollup/plugins/addCJSPackageJson.js index e68e41019..0b1efb152 100644 --- a/vx/config/rollup/plugins/addCJSPackageJson.js +++ b/vx/config/rollup/plugins/addCJSPackageJson.js @@ -16,7 +16,7 @@ function addEsPackageJson() { const packageJsonPath = path.join( path.dirname(file), - opts.fileNames.PACKAGE_JSON + opts.fileNames.PACKAGE_JSON, ); if (fse.existsSync(packageJsonPath)) { diff --git a/vx/config/rollup/plugins/addModulePackageJson.js b/vx/config/rollup/plugins/addModulePackageJson.js index cbe3be09d..0a1d21030 100644 --- a/vx/config/rollup/plugins/addModulePackageJson.js +++ b/vx/config/rollup/plugins/addModulePackageJson.js @@ -16,7 +16,7 @@ function addEsPackageJson() { const packageJsonPath = path.join( path.dirname(file), - opts.fileNames.PACKAGE_JSON + opts.fileNames.PACKAGE_JSON, ); if (fse.existsSync(packageJsonPath)) { diff --git a/vx/config/rollup/plugins/handleExports.js b/vx/config/rollup/plugins/handleExports.js index 0d5ce6a75..22b992d62 100644 --- a/vx/config/rollup/plugins/handleExports.js +++ b/vx/config/rollup/plugins/handleExports.js @@ -41,12 +41,12 @@ function writeEntry(name, namespace) { if (process.env.NODE_ENV === '${opts.env.PRODUCTION}') { module.exports = require('${prefix}/${path.relative( dist(), - dist(exportName(name, opts.env.PRODUCTION)) + dist(exportName(name, opts.env.PRODUCTION)), )}'); } else { module.exports = require('${prefix}/${path.relative( dist(), - dist(exportName(name, opts.env.DEVELOPMENT)) + dist(exportName(name, opts.env.DEVELOPMENT)), )}'); }`; @@ -77,7 +77,7 @@ function writePackageJson(name, exportPath, { namespace } = {}) { pkgJson, { spaces: 2, - } + }, ); } @@ -183,7 +183,7 @@ function genExportedFilesInMainPackageJson() { currentModule, genMainPackageJSONFileExports(moduleName, { namespace, - }) + }), ); return modules; @@ -192,7 +192,7 @@ function genExportedFilesInMainPackageJson() { function genMainPackageJSONFileExports( moduleName, - { env = opts.env.PRODUCTION, namespace = undefined } + { env = opts.env.PRODUCTION, namespace = undefined }, ) { const prefix = '.'; const cjsPath = genDistPath(moduleName, { @@ -261,7 +261,7 @@ function genDistPath( env = opts.env.PRODUCTION, format = opts.format.CJS, prefix, - } + }, ) { return joinPath( // add nesting level @@ -271,7 +271,7 @@ function genDistPath( format, namespace, exportName(moduleName, env), - ]) + ]), ); } @@ -283,7 +283,7 @@ function genTypesPath(moduleName, { namespace = undefined, prefix }) { opts.dir.TYPES, namespace, fileName(moduleName, 'd.ts'), - ]) + ]), ); } diff --git a/vx/config/rollup/rollup.config.cjs b/vx/config/rollup/rollup.config.cjs index ae39a3ac0..8517b6b1a 100644 --- a/vx/config/rollup/rollup.config.cjs +++ b/vx/config/rollup/rollup.config.cjs @@ -16,7 +16,7 @@ const { usePackage } = require('vx/vxContext'); const vxPath = require('vx/vxPath'); const fastBuild = JSON.parse( - process.env.ROLLUP_WATCH ?? process.env.VX_FAST_BUILD ?? false + process.env.ROLLUP_WATCH ?? process.env.VX_FAST_BUILD ?? false, ); module.exports = commandLineArgs => { @@ -42,10 +42,10 @@ module.exports = commandLineArgs => { `Invalid build entry: ${buildEntry}. Must be one of: ${[ opts.vx_config.VX_ROLLUP_BUILD_ENTRY_MAIN, opts.vx_config.VX_ROLLUP_BUILD_ENTRY_EXPORTS, - ].join(', ')}` + ].join(', ')}`, ); } - }) + }), ); }; @@ -72,14 +72,14 @@ function genBaseConfig({ // This turns the installed "internal" dependencies into external dependencies external: [ ...Object.keys( - disallowExternals ? {} : packageJson()?.dependencies ?? {} + disallowExternals ? {} : packageJson()?.dependencies ?? {}, ), moduleName === usePackage() ? null : usePackage(), ].filter(Boolean), input: getInputFile(packageName, moduleName, namespace), output: format.map(format => - genOutput({ env, format, moduleName, namespace }) + genOutput({ env, format, moduleName, namespace }), ), plugins: getPlugins({ env, moduleName, namespace, packageName }), }; @@ -89,7 +89,7 @@ function genBaseConfig({ function genExportsConfig(pkgName, env) { return listExportedModules(pkgName).map(([moduleName, namespace]) => - genBaseConfig({ env, moduleName, namespace }) + genBaseConfig({ env, moduleName, namespace }), ); } @@ -107,7 +107,7 @@ function genOutput({ // creates "globals" from the installed internal packages const globals = Object.keys( - disallowExternals ? {} : packageJson()?.dependencies ?? {} + disallowExternals ? {} : packageJson()?.dependencies ?? {}, ).reduce((g, c) => Object.assign(g, { [c]: c }), { ...{ [usePackage()]: usePackage() }, }); @@ -118,7 +118,7 @@ function genOutput({ usePackage(), format, namespace, - joinTruthy([moduleName, env, 'js'], '.') + joinTruthy([moduleName, env, 'js'], '.'), ), format, globals, @@ -128,7 +128,7 @@ function genOutput({ function getInputFile( packageName = usePackage(), moduleName = usePackage(), - namespace + namespace, ) { const moduleToResolve = getExportedModuleNames(namespace, moduleName); const packageModules = pathsPerPackage.packages[packageName]; diff --git a/vx/config/jest/jest.setupAfterEnv.ts b/vx/config/vitest/customMatchers.ts similarity index 91% rename from vx/config/jest/jest.setupAfterEnv.ts rename to vx/config/vitest/customMatchers.ts index 034ac71e4..3b8c5ee09 100644 --- a/vx/config/jest/jest.setupAfterEnv.ts +++ b/vx/config/vitest/customMatchers.ts @@ -1,12 +1,14 @@ import { isFunction } from 'vest-utils'; -import './globals.d'; +expect.extend({ + isDeepCopyOf, +}); // eslint-disable-next-line complexity -const isDeepCopyOf = ( +function isDeepCopyOf( source: any, - clone: any -): { pass: boolean; message: () => string } => { + clone: any, +): { pass: boolean; message: () => string } { const queue = [[source, clone]]; outer: while (queue.length) { @@ -29,7 +31,7 @@ const isDeepCopyOf = ( pass: false, message: () => `Source and clone are the same object. Expected a deep copy. ${JSON.stringify( - source + source, )}===${JSON.stringify(clone)}`, }; } @@ -44,7 +46,7 @@ const isDeepCopyOf = ( pass: false, message: () => `Source and clone are not of the same type: ${JSON.stringify( - source + source, )} does not equal ${JSON.stringify(clone)}`, }; } @@ -56,7 +58,7 @@ const isDeepCopyOf = ( pass: false, message: () => `source and clone arrays are not identical. ${JSON.stringify( - source + source, )} does not equal ${JSON.stringify(clone)}`, }; } @@ -71,8 +73,4 @@ const isDeepCopyOf = ( } return { pass: true, message: () => 'success' }; -}; - -expect.extend({ - isDeepCopyOf, -}); +} diff --git a/vx/config/vitest/vitest.d.ts b/vx/config/vitest/vitest.d.ts new file mode 100644 index 000000000..2a09b16fd --- /dev/null +++ b/vx/config/vitest/vitest.d.ts @@ -0,0 +1,12 @@ +import 'vitest'; + +interface CustomMatchers { + isDeepCopyOf(clone: any): R; +} + +declare module 'vitest' { + interface Assertion extends CustomMatchers {} + interface AsymmetricMatchersContaining extends CustomMatchers {} +} + +export {}; diff --git a/vx/exec.js b/vx/exec.js index df7017e51..52e13c1d8 100644 --- a/vx/exec.js +++ b/vx/exec.js @@ -12,7 +12,7 @@ function exec( throwOnFailure = false, silent = false, raw = false, - } = {} + } = {}, ) { const cmd = joinTruthy(command?.flat?.() ?? command, ' '); diff --git a/vx/opts.js b/vx/opts.js index 659b76692..c98bc146e 100644 --- a/vx/opts.js +++ b/vx/opts.js @@ -4,13 +4,13 @@ module.exports = { CONFIG: 'config', DIST: 'dist', EXPORTS: 'exports', - JEST: 'jest', PACKAGES: 'packages', ROLLUP: 'rollup', SCRIPTS: 'scripts', SRC: 'src', TESTS: '__tests__', TYPES: 'types', + VITEST: 'vitest', VX: 'vx', }, env: { @@ -20,14 +20,12 @@ module.exports = { }, fileNames: { CHANGELOG: 'CHANGELOG.md', - JEST_CONFIG: 'jest.config.js', - JEST_SETUP: 'jest.setup.ts', - JEST_SETUP_AFTER_ENV: 'jest.setupAfterEnv.ts', MAIN_EXPORT: 'index.js', NPM_IGNORE: '.npmignore', PACKAGE_JSON: 'package.json', ROLLUP_CONFIG: 'rollup.config.cjs', TSCONFIG_JSON: 'tsconfig.json', + VITEST_CONFIG: 'vitest.config.ts', VX_BUILD: 'vx.build.js', }, format: { diff --git a/vx/package.json b/vx/package.json index 8c2931aa2..afecef09c 100644 --- a/vx/package.json +++ b/vx/package.json @@ -9,14 +9,14 @@ "fs-extra": "^11.2.0", "glob": "^10.3.10", "inquirer": "^9.2.12", - "jest": "^29.7.0", "onchange": "^7.1.0", "prettier": "^3.3.1", "rollup": "^4.18.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.4.5", - "ts-jest": "^29.1.4", "vest-utils": "0.0.3", + "vite-tsconfig-paths": "^4.3.2", + "vitest": "^2.0.4", "yargs": "^17.7.2" }, "name": "vx", diff --git a/vx/packageExports.js b/vx/packageExports.js index 09f730905..e1146942f 100644 --- a/vx/packageExports.js +++ b/vx/packageExports.js @@ -12,5 +12,5 @@ module.exports = packageNames.list.reduce( .sync(vxPath.packageSrcExports(packageName, '*.ts')) .map(packageExport => path.basename(packageExport, '.ts')), }), - {} + {}, ); diff --git a/vx/packageNames.js b/vx/packageNames.js index 6e41cfb42..8d7516a33 100644 --- a/vx/packageNames.js +++ b/vx/packageNames.js @@ -16,7 +16,7 @@ module.exports = Object.defineProperty( get: () => { return usePackage(); }, - } + }, ); packageList.pairs.forEach(([name, path]) => { diff --git a/vx/scripts/build/buildPackage.js b/vx/scripts/build/buildPackage.js index 7a4326516..bfa15e190 100644 --- a/vx/scripts/build/buildPackage.js +++ b/vx/scripts/build/buildPackage.js @@ -18,7 +18,7 @@ function buildPackage(options = {}) { const format = []; if (options.fastBuild) { - format.push(opts.format.CJS); + format.push(opts.format.ES); } const baseOptions = { diff --git a/vx/scripts/genTsConfig.js b/vx/scripts/genTsConfig.js index fa312219c..777f74ab0 100644 --- a/vx/scripts/genTsConfig.js +++ b/vx/scripts/genTsConfig.js @@ -6,7 +6,7 @@ const lodash = require('lodash'); const exec = require('vx/exec'); const logger = require('vx/logger'); const packageNames = require('vx/packageNames'); -const pathsPerPackage = require('vx/util/pathsPerPackage'); +const { genPathsPerPackage } = require('vx/util/pathsPerPackage'); const vxPath = require('vx/vxPath'); module.exports = function genTsConfig() { @@ -20,14 +20,14 @@ module.exports = function genTsConfig() { } packageNames.list.forEach(packageName => { - const paths = genPathsPerPackage(packageName); + const paths = genPathsPerPackage(packageName, { addPathToArray: true }); const tsConfig = packageTsConfigTemplate(paths, packageName); const tsConfigPath = vxPath.packageTsConfig(packageName); if (isConfigEqual(tsConfigPath, tsConfig)) { logger.log( - `✅ tsConfig for package '${packageName}' is up to date. Skipping.` + `✅ tsConfig for package '${packageName}' is up to date. Skipping.`, ); return; } @@ -95,19 +95,7 @@ function rootTsConfigTemplate() { strict: true, target: 'ES2015', }, - files: [`${vxPath.rel(vxPath.JEST_CONFIG_PATH)}/globals.d.ts`], + files: [`${vxPath.rel(vxPath.VITEST_CONFIG_PATH)}/vitest.d.ts`], include: [vxPath.rel(vxPath.packageSrc('*', '**/*.ts'))], }; } - -function genPathsPerPackage(packageName) { - const packageData = pathsPerPackage.packages[packageName]; - - return packageData.reduce((paths, currentModule) => { - return Object.assign(paths, { - [currentModule.name]: [ - vxPath.rel(currentModule.absolute, vxPath.package(packageName)), - ], - }); - }, {}); -} diff --git a/vx/scripts/genVitestConfig.js b/vx/scripts/genVitestConfig.js new file mode 100644 index 000000000..3c91e5b11 --- /dev/null +++ b/vx/scripts/genVitestConfig.js @@ -0,0 +1,117 @@ +const fs = require('fs'); + +const exec = require('vx/exec'); +const logger = require('vx/logger'); +const opts = require('vx/opts'); +const packageNames = require('vx/packageNames'); +const packageList = require('vx/util/packageList'); +const { genPathsPerPackage, packages } = require('vx/util/pathsPerPackage'); +const vxPath = require('vx/vxPath'); + +const VITEST_CONFIG_PATH = 'vx/config/vitest/customMatchers.ts'; + +module.exports = function genVitestConfig() { + logger.info('Generating vitest.config.ts files...'); + + mainConfig(); + packageNames.list.forEach(packageName => { + perPackageConfig(packageName); + }); + + logger.info('👌 Done generating vitest.config files.\n'); +}; + +function perPackageConfig(packageName) { + const configPath = vxPath.packageVitestConfig(packageName); + + let existingContent = ''; + + if (fs.existsSync(configPath)) { + existingContent = fs.readFileSync(configPath, 'utf8'); + } + + /** + * @type {Record} alias // { 'moduleName': './path/to/moduleName' } + */ + const allPaths = genPathsPerPackage(packageName, { addPathToArray: false }); + + const alias = Object.entries(allPaths) + .map(([name, path]) => { + // is name one word or multiple words (has -)? + const nameToUse = name.match(/[-@.]/) ? `'${name}'` : name; + return `${nameToUse}: resolve(__dirname, '${path.slice(2)}')`; + }) + .join(',\n '); + + const next = genConfig(alias); + + if (existingContent === next) { + logger.log(`✅ ${packageName} vitest.config is up to date. Skipping.`); + return; + } + + logger.log(`📝 Writing vitest.config file for ${packageName}`); + + fs.writeFileSync(configPath, next, 'utf8'); +} + +function mainConfig() { + const configPath = vxPath.VITEST_CONFIG_FILE_PATH; + + let existingContent = ''; + + if (fs.existsSync(vxPath.VITEST_CONFIG_FILE_PATH)) { + existingContent = fs.readFileSync(vxPath.VITEST_CONFIG_FILE_PATH, 'utf8'); + } + + const mainConfig = mainConfigTemplate(); + + if (existingContent === mainConfig) { + logger.log('✅ Main vitest.config is up to date. Skipping.'); + return; + } + + logger.log('📝 Writing main vitest.config file'); + + fs.writeFileSync(configPath, mainConfig, 'utf8'); +} + +function mainConfigTemplate() { + return `import tsconfigPaths from 'vite-tsconfig-paths'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + include: ['${opts.dir.PACKAGES}/${vxPath.TEST_FILE_PATTERN}'], + setupFiles: ['${VITEST_CONFIG_PATH}/customMatchers.ts'], + }, + root: __dirname, + plugins: [ + tsconfigPaths({ + loose: true, + projects: ${JSON.stringify(packageList.names.map(p => `${opts.dir.PACKAGES}/${p}`))}, + }), + ], +}); +`; +} + +function genConfig(alias = {}) { + return `import { defineConfig } from 'vitest/config'; +import { resolve } from 'path'; + +export default defineConfig({ + test: { + globals: true, + include: ['./**/__tests__/*.test.ts'], + setupFiles: [resolve(__dirname, '../../', '${VITEST_CONFIG_PATH}')], + }, + root: __dirname, + resolve: { + alias: { + ${alias} + } + }, +});`; +} diff --git a/vx/scripts/release/depsTree.js b/vx/scripts/release/depsTree.js index e1cf50bb3..af8501c6a 100644 --- a/vx/scripts/release/depsTree.js +++ b/vx/scripts/release/depsTree.js @@ -25,7 +25,7 @@ const buildDepsMemo = memoize(function (package, deps) { function buildDepsTree() { return packageList.names.reduce( (deps, packageName) => buildDepsMemo(packageName, deps), - {} + {}, ); } @@ -34,7 +34,7 @@ function sortDependencies(packagesList) { const deps = buildDepsTree(); return packagesList.sort( - (a, b) => countMaxDepth(deps[b]) - countMaxDepth(deps[a]) + (a, b) => countMaxDepth(deps[b]) - countMaxDepth(deps[a]), ); } diff --git a/vx/scripts/release/genDiffData.js b/vx/scripts/release/genDiffData.js index 39cb8f742..bf9a003bf 100644 --- a/vx/scripts/release/genDiffData.js +++ b/vx/scripts/release/genDiffData.js @@ -36,8 +36,8 @@ function genDiffData(commits) { versionToPublish: isReleaseKeepVersionBranch ? version : tag - ? tagId - : nextVersion, + ? tagId + : nextVersion, }; } diff --git a/vx/scripts/release/github/commitIgnorePattern.js b/vx/scripts/release/github/commitIgnorePattern.js index 6683bfc39..450b48458 100644 --- a/vx/scripts/release/github/commitIgnorePattern.js +++ b/vx/scripts/release/github/commitIgnorePattern.js @@ -1,7 +1,7 @@ const IGNORE_KEYWORDS = ['docs', 'conf', 'ci', 'build']; const IGNORE_PATTERN = new RegExp( `${IGNORE_KEYWORDS.join('|')}:|dependabot`, - 'i' + 'i', ); module.exports = IGNORE_PATTERN; diff --git a/vx/scripts/release/packagesToRelease.js b/vx/scripts/release/packagesToRelease.js index 50a3e3fb3..7a6b00238 100644 --- a/vx/scripts/release/packagesToRelease.js +++ b/vx/scripts/release/packagesToRelease.js @@ -30,8 +30,8 @@ function packagesToRelease() { } else { logger.info( `💡 The following packages were changed: \n - ${changedPackagesArray.join( - '\n - ' - )}\n` + '\n - ', + )}\n`, ); } @@ -59,7 +59,7 @@ function packagesToRelease() { logger.info( `🧱 The following packages did not change, but will be released because they are indirectly impacted by changes: \n - ${[ ...unchangedDependents, - ].join('\n - ')} \n` + ].join('\n - ')} \n`, ); } @@ -67,8 +67,8 @@ function packagesToRelease() { logger.info( `✅ The packages will be released in the following order: \n - ${allPackagesToRelease.join( - '\n - ' - )}\n` + '\n - ', + )}\n`, ); return { diff --git a/vx/scripts/release/steps/commitChangesToGit.js b/vx/scripts/release/steps/commitChangesToGit.js index ceea105d3..7b69eee4d 100644 --- a/vx/scripts/release/steps/commitChangesToGit.js +++ b/vx/scripts/release/steps/commitChangesToGit.js @@ -15,12 +15,12 @@ const vxPath = require('vx/vxPath'); const RELEASE_SCRIPTS = path.resolve( vxPath.VX_SCRIPTS_PATH, 'release', - 'steps' + 'steps', ); const PUSH_TO_LATEST_BRANCH = path.resolve( RELEASE_SCRIPTS, - 'push_to_latest_branch.sh' + 'push_to_latest_branch.sh', ); const CREATE_GIT_TAG = path.resolve(RELEASE_SCRIPTS, 'create_git_tag.sh'); @@ -66,7 +66,7 @@ function filterChangedPackages(commits) { function createCommitMessage(changedPackages) { const msg = changedPackages .map( - packageName => `[${packageName}]: (${packageJson(packageName).version})` + packageName => `[${packageName}]: (${packageJson(packageName).version})`, ) .join(', '); diff --git a/vx/scripts/release/steps/publishPackage.js b/vx/scripts/release/steps/publishPackage.js index 07374604b..a2b1ad503 100644 --- a/vx/scripts/release/steps/publishPackage.js +++ b/vx/scripts/release/steps/publishPackage.js @@ -41,14 +41,14 @@ function execCommandWithGitConfig(command) { logger.info( `Setting git config: Email "${EMAIL_ADDRESS}" - Name "${GIT_NAME}"` + Name "${GIT_NAME}"`, ); exec( `git config --global user.email "${EMAIL_ADDRESS}" git config --global user.name "${GIT_NAME}" ${joinTruthy(command, ' ')}`, - { exitOnFailure: false } + { exitOnFailure: false }, ); } diff --git a/vx/scripts/release/steps/setNextVersion.js b/vx/scripts/release/steps/setNextVersion.js index 15aa8fd52..028cbe434 100644 --- a/vx/scripts/release/steps/setNextVersion.js +++ b/vx/scripts/release/steps/setNextVersion.js @@ -27,7 +27,7 @@ function setNextVersion({ changeLevel: ${changeLevel} tagId: ${tagId} tag: ${tag} - versionToPublish: ${versionToPublish}` + versionToPublish: ${versionToPublish}`, ); return; } @@ -39,7 +39,7 @@ function setNextVersion({ existingPkgJson.version = versionToPublish; logger.info( - `🔢 Setting next version for ${usePackage()}. From ${prevVersion} to ${versionToPublish}` + `🔢 Setting next version for ${usePackage()}. From ${prevVersion} to ${versionToPublish}`, ); writeJSONSync(vxPath.packageJson(packageName), nextPackageJson, { @@ -50,7 +50,7 @@ function setNextVersion({ if (updated.version !== versionToPublish) { logger.error( - `🚨 Failed to update ${usePackage()} version to: ` + versionToPublish + `🚨 Failed to update ${usePackage()} version to: ` + versionToPublish, ); return process.exit(1); } diff --git a/vx/scripts/release/steps/updateLocalDepsToLatest.js b/vx/scripts/release/steps/updateLocalDepsToLatest.js index d37cbb2ad..1f64239f8 100644 --- a/vx/scripts/release/steps/updateLocalDepsToLatest.js +++ b/vx/scripts/release/steps/updateLocalDepsToLatest.js @@ -38,8 +38,8 @@ module.exports = function updateLocalDepsToLatest() { deps[name] = isNextBranch ? TAG_NEXT : isIntegrationBranch - ? TAG_DEV - : depPkgJson.version; + ? TAG_DEV + : depPkgJson.version; } else { deps[name] = isNextBranch || isIntegrationBranch diff --git a/vx/util/pathsPerPackage.js b/vx/util/pathsPerPackage.js index cd024647e..479cb591c 100644 --- a/vx/util/pathsPerPackage.js +++ b/vx/util/pathsPerPackage.js @@ -40,6 +40,7 @@ findDuplicates(); module.exports = { packages: groupedMatches, list, + genPathsPerPackage, }; function findDuplicates() { @@ -65,11 +66,11 @@ function findDuplicates() { const duplicatesPerPackage = []; for (const [packageName, { duplicates }] of Object.entries( - duplicatesContainer + duplicatesContainer, )) { if (duplicates.size > 0) { duplicatesPerPackage.push( - `${packageName}: ${[...duplicates].map(dup => `\n -${dup}`).join('')}` + `${packageName}: ${[...duplicates].map(dup => `\n -${dup}`).join('')}`, ); } } @@ -77,8 +78,23 @@ function findDuplicates() { if (duplicatesPerPackage.length > 0) { throw new Error( `VX: Duplicates found in the following packages:\n\n${duplicatesPerPackage.join( - '\n' - )}\n` + '\n', + )}\n`, ); } } + +function genPathsPerPackage(packageName, { addPathToArray = false }) { + const packageData = groupedMatches[packageName]; + + return packageData.reduce((paths, currentModule) => { + const filePath = vxPath.rel( + currentModule.absolute, + vxPath.package(packageName), + ); + + return Object.assign(paths, { + [currentModule.name]: addPathToArray ? [filePath] : filePath, + }); + }, {}); +} diff --git a/vx/util/rootPackageJson.js b/vx/util/rootPackageJson.js index df0a33c3e..816640901 100644 --- a/vx/util/rootPackageJson.js +++ b/vx/util/rootPackageJson.js @@ -8,7 +8,7 @@ function rootPackageJson() { // Manually reading it instead of requiring to avoid caching const jsonString = fs.readFileSync( path.join(vxPath.ROOT_PATH, opts.fileNames.PACKAGE_JSON), - 'utf8' + 'utf8', ); return JSON.parse(jsonString); } diff --git a/vx/util/runOnActivePackages.js b/vx/util/runOnActivePackages.js index d12c60971..19edd4336 100644 --- a/vx/util/runOnActivePackages.js +++ b/vx/util/runOnActivePackages.js @@ -10,6 +10,6 @@ module.exports = (callback, ...args) => { return callback(...args); } packages.list.forEach(packageName => - ctx.withPackage(packageName, () => callback(...args)) + ctx.withPackage(packageName, () => callback(...args)), ); }; diff --git a/vx/util/taggedBranch.js b/vx/util/taggedBranch.js index 89bf82114..162df56ca 100644 --- a/vx/util/taggedBranch.js +++ b/vx/util/taggedBranch.js @@ -17,7 +17,7 @@ const isLatestBranch = CURRENT_BRANCH.startsWith(LATEST_BRANCH); const isStableBranch = CURRENT_BRANCH.startsWith(STABLE_BRANCH); const isReleaseBranch = CURRENT_BRANCH.startsWith(RELEASE_BRANCH); const isReleaseKeepVersionBranch = CURRENT_BRANCH.startsWith( - RELEASE_KEEP_VERSION_BRANCH + RELEASE_KEEP_VERSION_BRANCH, ); const [, target = undefined] = isIntegrationBranch || isNextBranch || isNightlyBranch diff --git a/vx/vxPath.js b/vx/vxPath.js index 7e132b6ea..0c7df562b 100644 --- a/vx/vxPath.js +++ b/vx/vxPath.js @@ -27,7 +27,7 @@ vxPath.packageNameFromPath = pathSegment => { const packagesPosition = pathSegment.indexOf(opts.dir.PACKAGES); // 2 const withoutDir = pathSegment.substring( - packagesPosition + opts.dir.PACKAGES.length + packagesPosition + opts.dir.PACKAGES.length, ); // /vest/src/core/isolate/isolates/skipWhen.ts return withoutDir.split(path.sep)[1]; //vest }; @@ -60,6 +60,10 @@ vxPath.packageJson = (pkgName = usePackage()) => { return vxPath.package(pkgName, opts.fileNames.PACKAGE_JSON); }; +vxPath.packageVitestConfig = (pkgName = usePackage()) => { + return vxPath.package(pkgName, opts.fileNames.VITEST_CONFIG); +}; + vxPath.packageNpmIgnore = (pkgName = usePackage()) => { return vxPath.package(pkgName, opts.fileNames.NPM_IGNORE); }; @@ -106,21 +110,26 @@ vxPath.VX_COMMANDS_PATH = path.resolve(vxPath.VX_ROOT_PATH, opts.dir.COMMANDS); vxPath.ROLLUP_CONFIG_PATH = path.resolve( vxPath.VX_CONFIG_PATH, opts.dir.ROLLUP, - opts.fileNames.ROLLUP_CONFIG + opts.fileNames.ROLLUP_CONFIG, ); -vxPath.JEST_CONFIG_PATH = path.resolve(vxPath.VX_CONFIG_PATH, opts.dir.JEST); +vxPath.VITEST_CONFIG_PATH = path.resolve( + vxPath.VX_CONFIG_PATH, + opts.dir.VITEST, +); -vxPath.JEST_CONFIG_FILE_PATH = path.resolve( - vxPath.JEST_CONFIG_PATH, - opts.fileNames.JEST_CONFIG +vxPath.VITEST_CONFIG_FILE_PATH = path.resolve( + vxPath.ROOT_PATH, + opts.fileNames.VITEST_CONFIG, ); vxPath.TSCONFIG_PATH = path.resolve( vxPath.ROOT_PATH, - opts.fileNames.TSCONFIG_JSON + opts.fileNames.TSCONFIG_JSON, ); +vxPath.TEST_FILE_PATTERN = `**/${opts.dir.TESTS}/*.test.ts`; + vxPath.PACKAGES_PATH = path.resolve(vxPath.ROOT_PATH, opts.dir.PACKAGES); module.exports = vxPath; diff --git a/website/docs/enforce/builtin-enforce-plugins/compound_rules.md b/website/docs/enforce/builtin-enforce-plugins/compound_rules.md index f14169e75..ede1dc9d2 100644 --- a/website/docs/enforce/builtin-enforce-plugins/compound_rules.md +++ b/website/docs/enforce/builtin-enforce-plugins/compound_rules.md @@ -48,7 +48,7 @@ enforce.oneOf can be used to determine if _exactly_ one of the rules applies. It enforce(value).oneOf( enforce.isString(), enforce.isNumber(), - enforce.longerThan(1) + enforce.longerThan(1), ); /* diff --git a/website/docs/enforce/builtin-enforce-plugins/schema_rules.md b/website/docs/enforce/builtin-enforce-plugins/schema_rules.md index 983ba1c70..221a48c47 100644 --- a/website/docs/enforce/builtin-enforce-plugins/schema_rules.md +++ b/website/docs/enforce/builtin-enforce-plugins/schema_rules.md @@ -105,7 +105,7 @@ enforce({}).shape( partial({ firstName: enforce.isString(), lastName: enforce.isString(), - }) + }), ); ``` diff --git a/website/docs/enforce/composing_enforce_rules.md b/website/docs/enforce/composing_enforce_rules.md index 02fcf669f..d74e5a432 100644 --- a/website/docs/enforce/composing_enforce_rules.md +++ b/website/docs/enforce/composing_enforce_rules.md @@ -45,8 +45,8 @@ enforce(userObj).shape({ middle: enforce.optional(enforce.string()), last: enforce.string(), }), - }) - ) + }), + ), ), }); ``` @@ -60,7 +60,7 @@ import 'vest/enforce/schema'; // for the schema rules const Entity = compose( enforce.loose({ id: enforce.number(), - }) + }), ); const Person = compose( @@ -70,7 +70,7 @@ const Person = compose( middle: enforce.optional(enforce.string()), last: enforce.string(), }), - }) + }), ); const User = compose( @@ -79,7 +79,7 @@ const User = compose( enforce.loose({ username: enforce.string(), friends: enforce.optional(enforce.arrayOf(User)), - }) + }), ); ``` diff --git a/website/docs/writing_tests/advanced_test_features/dynamic_tests.md b/website/docs/writing_tests/advanced_test_features/dynamic_tests.md index 279eb562c..8926f5a2f 100644 --- a/website/docs/writing_tests/advanced_test_features/dynamic_tests.md +++ b/website/docs/writing_tests/advanced_test_features/dynamic_tests.md @@ -48,7 +48,7 @@ const suite = create((data = {}) => { () => { enforce(field.price).isNumeric().greaterThan(0); }, - field.id // the key is used to guarantee state persistence on reordering + field.id, // the key is used to guarantee state persistence on reordering ); }); }); diff --git a/website/docs/writing_tests/advanced_test_features/grouping_tests.md b/website/docs/writing_tests/advanced_test_features/grouping_tests.md index 3af0b0563..623a2fbc6 100644 --- a/website/docs/writing_tests/advanced_test_features/grouping_tests.md +++ b/website/docs/writing_tests/advanced_test_features/grouping_tests.md @@ -63,7 +63,7 @@ create(data => { test( 'userName', 'User not found. Please check if you typed it correctly.', - findUserName(data.username) + findUserName(data.username), ); }); @@ -150,13 +150,13 @@ const suite = create(data => { 'promo code purchases are limited to one item only', () => { enforce(data.quantity).equals(1); - } + }, ); test( 'promoCode', 'Promo code can only be used once', - isPromoCodeUsed(data.usedPromo) + isPromoCodeUsed(data.usedPromo), ); }); }); diff --git a/website/docs/writing_tests/advanced_test_features/test.memo.md b/website/docs/writing_tests/advanced_test_features/test.memo.md index fd20757f0..884b0ac86 100644 --- a/website/docs/writing_tests/advanced_test_features/test.memo.md +++ b/website/docs/writing_tests/advanced_test_features/test.memo.md @@ -28,7 +28,7 @@ export default create(data => { 'username', 'username already exists', () => doesUserExist(data.username), - [data.username] + [data.username], ); }); ``` diff --git a/website/docs/writing_tests/warn_only_tests.md b/website/docs/writing_tests/warn_only_tests.md index 6e673e15d..3d66e2d89 100644 --- a/website/docs/writing_tests/warn_only_tests.md +++ b/website/docs/writing_tests/warn_only_tests.md @@ -23,7 +23,7 @@ const suite = create(data => { warn(); enforce(data.password).matches( - /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]$/ + /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]$/, ); }); // this test has a severity level of `warn` @@ -31,7 +31,7 @@ const suite = create(data => { warn(); enforce(data.password).matches( - /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]$/ + /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]$/, ); }); // this test has a severity level of `warn` }); diff --git a/website/docs/writing_your_suite/including_and_excluding/omitWhen.md b/website/docs/writing_your_suite/including_and_excluding/omitWhen.md index ace08d6c7..6c0e8bbe6 100644 --- a/website/docs/writing_your_suite/including_and_excluding/omitWhen.md +++ b/website/docs/writing_your_suite/including_and_excluding/omitWhen.md @@ -72,7 +72,7 @@ omitWhen( // this is an example for a server call return doesUserExist(data.username); }); - } + }, ); ``` @@ -98,6 +98,7 @@ omitWhen( 'You need at least one option', ); ``` + :::caution IMPORTANT The code within omitWhen will always run, regardless of whether the condition is met or not. `omitWhen` only affects the validation result, but if you call a function within `omitWhen`, it will run regardless of the condition. @@ -107,4 +108,4 @@ omitWhen(true, () => { }); ``` -::: \ No newline at end of file +::: diff --git a/website/docs/writing_your_suite/including_and_excluding/skipWhen.md b/website/docs/writing_your_suite/including_and_excluding/skipWhen.md index dd92d7f31..37f760cdb 100644 --- a/website/docs/writing_your_suite/including_and_excluding/skipWhen.md +++ b/website/docs/writing_your_suite/including_and_excluding/skipWhen.md @@ -44,7 +44,7 @@ export default create((data = {}) => { // this is an example for a server call return doesUserExist(data.username); }); - } + }, ); }); ``` diff --git a/website/docs/writing_your_suite/optional_fields.md b/website/docs/writing_your_suite/optional_fields.md index 93f9ab7f1..a174e9274 100644 --- a/website/docs/writing_your_suite/optional_fields.md +++ b/website/docs/writing_your_suite/optional_fields.md @@ -126,7 +126,7 @@ const suite = create(data => { 'Pet Name may be left empty only if owner name is supplied', () => { enforce(data.pet_name).isNotEmpty(); - } + }, ); test( @@ -134,7 +134,7 @@ const suite = create(data => { 'Owner Name may be left empty only if pet name is supplied', () => { enforce(data.owner_name).isNotEmpty(); - } + }, ); }); ``` diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 348312d0e..ba94e8431 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -124,7 +124,7 @@ const config = { value: badgeLink( 'https://www.npmjs.com/package/vest', 'https://badgen.net/npm/v/vest?icon=npm&scale=1.2&color=red&label', - 'npm-badge' + 'npm-badge', ), }, { @@ -133,7 +133,7 @@ const config = { value: badgeLink( 'https://github.com/ealush/vest', 'https://badgen.net/github/stars/ealush/vest?scale=1.2&color=yellow&icon=github', - 'github-badge' + 'github-badge', ), }, { @@ -142,7 +142,7 @@ const config = { value: badgeLink( 'https://discord.gg/WmADZpJnSe', 'https://badgen.net/discord/online-members/WmADZpJnSe?icon=discord&scale=1.2&label=Discord', - 'discord-badge' + 'discord-badge', ), }, { diff --git a/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/compound_rules.md b/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/compound_rules.md index 8abab9539..93ad2ccbf 100644 --- a/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/compound_rules.md +++ b/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/compound_rules.md @@ -48,7 +48,7 @@ enforce.oneOf can be used to determine if _exactly_ one of the rules applies. It enforce(value).oneOf( enforce.isString(), enforce.isNumber(), - enforce.longerThan(1) + enforce.longerThan(1), ); /* diff --git a/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/schema_rules.md b/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/schema_rules.md index aa556e0f3..791a1835b 100644 --- a/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/schema_rules.md +++ b/website/versioned_docs/version-4.x/enforce/builtin-enforce-plugins/schema_rules.md @@ -105,7 +105,7 @@ enforce({}).shape( partial({ firstName: enforce.isString(), lastName: enforce.isString(), - }) + }), ); ``` diff --git a/website/versioned_docs/version-4.x/enforce/composing_enforce_rules.md b/website/versioned_docs/version-4.x/enforce/composing_enforce_rules.md index 02fcf669f..d74e5a432 100644 --- a/website/versioned_docs/version-4.x/enforce/composing_enforce_rules.md +++ b/website/versioned_docs/version-4.x/enforce/composing_enforce_rules.md @@ -45,8 +45,8 @@ enforce(userObj).shape({ middle: enforce.optional(enforce.string()), last: enforce.string(), }), - }) - ) + }), + ), ), }); ``` @@ -60,7 +60,7 @@ import 'vest/enforce/schema'; // for the schema rules const Entity = compose( enforce.loose({ id: enforce.number(), - }) + }), ); const Person = compose( @@ -70,7 +70,7 @@ const Person = compose( middle: enforce.optional(enforce.string()), last: enforce.string(), }), - }) + }), ); const User = compose( @@ -79,7 +79,7 @@ const User = compose( enforce.loose({ username: enforce.string(), friends: enforce.optional(enforce.arrayOf(User)), - }) + }), ); ``` diff --git a/website/versioned_docs/version-4.x/upgrade_guide.md b/website/versioned_docs/version-4.x/upgrade_guide.md index bf752e27f..7ff3a5829 100644 --- a/website/versioned_docs/version-4.x/upgrade_guide.md +++ b/website/versioned_docs/version-4.x/upgrade_guide.md @@ -72,7 +72,7 @@ skipWhen( test('confirm', 'passwords do not match', () => { /*...*/ }); - } + }, ); // ... @@ -104,7 +104,7 @@ each(fields, field => { () => { enforce(field.value).isNotEmpty(); }, - field.id + field.id, ); }); ``` @@ -191,7 +191,7 @@ const suite = create('user_form', () => { res => res.hasErrors('username'), () => { /* ... */ - } + }, ); }); ``` diff --git a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/dynamic_tests.md b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/dynamic_tests.md index 279eb562c..8926f5a2f 100644 --- a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/dynamic_tests.md +++ b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/dynamic_tests.md @@ -48,7 +48,7 @@ const suite = create((data = {}) => { () => { enforce(field.price).isNumeric().greaterThan(0); }, - field.id // the key is used to guarantee state persistence on reordering + field.id, // the key is used to guarantee state persistence on reordering ); }); }); diff --git a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/grouping_tests.md b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/grouping_tests.md index a17312d4a..2b143b15b 100644 --- a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/grouping_tests.md +++ b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/grouping_tests.md @@ -29,7 +29,7 @@ create(data => { test( 'userName', 'User not found. Please check if you typed it correctly.', - findUserName(data.username) + findUserName(data.username), ); }); @@ -107,7 +107,7 @@ const suite = create(data => { test( 'balance', 'Balance is lower than product price', - hasSufficientFunds(data.productId) + hasSufficientFunds(data.productId), ); test('quantity', `Quantity on this item is limited to ${data.limit}`, () => { @@ -120,13 +120,13 @@ const suite = create(data => { 'promo code purchases are limited to one item only', () => { enforce(data.quantity).equals(1); - } + }, ); test( 'promoCode', 'Promo code can only be used once', - isPromoCodeUsed(data.usedPromo) + isPromoCodeUsed(data.usedPromo), ); }); }); diff --git a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/test.memo.md b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/test.memo.md index fd20757f0..884b0ac86 100644 --- a/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/test.memo.md +++ b/website/versioned_docs/version-4.x/writing_tests/advanced_test_features/test.memo.md @@ -28,7 +28,7 @@ export default create(data => { 'username', 'username already exists', () => doesUserExist(data.username), - [data.username] + [data.username], ); }); ``` diff --git a/website/versioned_docs/version-4.x/writing_tests/warn_only_tests.md b/website/versioned_docs/version-4.x/writing_tests/warn_only_tests.md index 3b761ebed..ddeeac92e 100644 --- a/website/versioned_docs/version-4.x/writing_tests/warn_only_tests.md +++ b/website/versioned_docs/version-4.x/writing_tests/warn_only_tests.md @@ -23,7 +23,7 @@ const suite = create(data => { warn(); enforce(data.password).matches( - /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]$/ + /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]$/, ); }); // this test has a severity level of `warn` @@ -31,7 +31,7 @@ const suite = create(data => { warn(); enforce(data.password).matches( - /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]$/ + /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]$/, ); }); // this test has a severity level of `warn` }); diff --git a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/omitWhen.md b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/omitWhen.md index c44a9d879..9f07b7302 100644 --- a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/omitWhen.md +++ b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/omitWhen.md @@ -62,6 +62,6 @@ omitWhen( // this is an example for a server call return doesUserExist(data.username); }); - } + }, ); ``` diff --git a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skipWhen.md b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skipWhen.md index c3d5a488e..85aa281e1 100644 --- a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skipWhen.md +++ b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skipWhen.md @@ -42,7 +42,7 @@ export default create((data = {}) => { // this is an example for a server call return doesUserExist(data.username); }); - } + }, ); }); ``` diff --git a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skip_and_only_group.md b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skip_and_only_group.md index 87124d607..ea98f2eb0 100644 --- a/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skip_and_only_group.md +++ b/website/versioned_docs/version-4.x/writing_your_suite/including_and_excluding/skip_and_only_group.md @@ -28,7 +28,7 @@ create(data => { test( 'userName', 'User not found. Please check if you typed it correctly.', - findUserName(data.username) + findUserName(data.username), ); }); diff --git a/website/versioned_docs/version-4.x/writing_your_suite/optional_fields.md b/website/versioned_docs/version-4.x/writing_your_suite/optional_fields.md index 74177becb..112e080c1 100644 --- a/website/versioned_docs/version-4.x/writing_your_suite/optional_fields.md +++ b/website/versioned_docs/version-4.x/writing_your_suite/optional_fields.md @@ -96,7 +96,7 @@ const suite = create(data => { 'Pet Name may be left empty only if owner name is supplied', () => { enforce(data.pet_name).isNotEmpty(); - } + }, ); test( @@ -104,7 +104,7 @@ const suite = create(data => { 'Owner Name may be left empty only if pet name is supplied', () => { enforce(data.owner_name).isNotEmpty(); - } + }, ); }); ``` diff --git a/website/versioned_docs/version-4.x/writing_your_suite/result_object.md b/website/versioned_docs/version-4.x/writing_your_suite/result_object.md index 99d15689d..c01cb421d 100644 --- a/website/versioned_docs/version-4.x/writing_your_suite/result_object.md +++ b/website/versioned_docs/version-4.x/writing_your_suite/result_object.md @@ -230,13 +230,13 @@ const suite = create(data => { test( 'UserEmail', 'Marked as spam address', - async () => await isKnownSpammer(data.address) + async () => await isKnownSpammer(data.address), ); test( 'UserName', 'must not be blacklisted', - async () => await isBlacklistedUser(data.username) + async () => await isBlacklistedUser(data.username), ); }); diff --git a/yarn.lock b/yarn.lock index 26182c83a..ba1474368 100644 --- a/yarn.lock +++ b/yarn.lock @@ -194,13 +194,13 @@ __metadata: languageName: node linkType: hard -"@ampproject/remapping@npm:^2.2.0": - version: 2.2.1 - resolution: "@ampproject/remapping@npm:2.2.1" +"@ampproject/remapping@npm:^2.2.0, @ampproject/remapping@npm:^2.3.0": + version: 2.3.0 + resolution: "@ampproject/remapping@npm:2.3.0" dependencies: - "@jridgewell/gen-mapping": ^0.3.0 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 03c04fd526acc64a1f4df22651186f3e5ef0a9d6d6530ce4482ec9841269cf7a11dbb8af79237c282d721c5312024ff17529cd72cc4768c11e999b58e2302079 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: d3ad7b89d973df059c4e8e6d7c972cbeb1bb2f18f002a3bd04ae0707da214cb06cc06929b65aa2313b9347463df2914772298bae8b1d7973f246bb3f2ab3e8f0 languageName: node linkType: hard @@ -221,7 +221,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.3": +"@babel/core@npm:^7.21.3, @babel/core@npm:^7.23.3": version: 7.23.5 resolution: "@babel/core@npm:7.23.5" dependencies: @@ -244,7 +244,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.23.5, @babel/generator@npm:^7.7.2": +"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.23.5": version: 7.23.5 resolution: "@babel/generator@npm:7.23.5" dependencies: @@ -516,7 +516,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.5": +"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.5": version: 7.23.5 resolution: "@babel/parser@npm:7.23.5" bin: @@ -581,18 +581,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-bigint@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-bigint@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3a10849d83e47aec50f367a9e56a6b22d662ddce643334b087f9828f4c3dd73bdc5909aaeabe123fed78515767f9ca43498a0e621c438d1cd2802d7fae3c9648 - languageName: node - linkType: hard - -"@babel/plugin-syntax-class-properties@npm:^7.12.13, @babel/plugin-syntax-class-properties@npm:^7.8.3": +"@babel/plugin-syntax-class-properties@npm:^7.12.13": version: 7.12.13 resolution: "@babel/plugin-syntax-class-properties@npm:7.12.13" dependencies: @@ -658,7 +647,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-meta@npm:^7.10.4, @babel/plugin-syntax-import-meta@npm:^7.8.3": +"@babel/plugin-syntax-import-meta@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" dependencies: @@ -680,7 +669,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.23.3, @babel/plugin-syntax-jsx@npm:^7.7.2": +"@babel/plugin-syntax-jsx@npm:^7.23.3": version: 7.23.3 resolution: "@babel/plugin-syntax-jsx@npm:7.23.3" dependencies: @@ -691,7 +680,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4, @babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-logical-assignment-operators@npm:7.10.4" dependencies: @@ -713,7 +702,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-numeric-separator@npm:^7.10.4, @babel/plugin-syntax-numeric-separator@npm:^7.8.3": +"@babel/plugin-syntax-numeric-separator@npm:^7.10.4": version: 7.10.4 resolution: "@babel/plugin-syntax-numeric-separator@npm:7.10.4" dependencies: @@ -768,7 +757,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-top-level-await@npm:^7.14.5, @babel/plugin-syntax-top-level-await@npm:^7.8.3": +"@babel/plugin-syntax-top-level-await@npm:^7.14.5": version: 7.14.5 resolution: "@babel/plugin-syntax-top-level-await@npm:7.14.5" dependencies: @@ -779,7 +768,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.23.3, @babel/plugin-syntax-typescript@npm:^7.7.2": +"@babel/plugin-syntax-typescript@npm:^7.23.3": version: 7.23.3 resolution: "@babel/plugin-syntax-typescript@npm:7.23.3" dependencies: @@ -1632,7 +1621,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.22.15, @babel/template@npm:^7.3.3": +"@babel/template@npm:^7.22.15": version: 7.22.15 resolution: "@babel/template@npm:7.22.15" dependencies: @@ -1661,7 +1650,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": +"@babel/types@npm:^7.21.3, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.5, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.23.5 resolution: "@babel/types@npm:7.23.5" dependencies: @@ -1672,13 +1661,6 @@ __metadata: languageName: node linkType: hard -"@bcoe/v8-coverage@npm:^0.2.3": - version: 0.2.3 - resolution: "@bcoe/v8-coverage@npm:0.2.3" - checksum: 850f9305536d0f2bd13e9e0881cb5f02e4f93fad1189f7b2d4bebf694e3206924eadee1068130d43c11b750efcc9405f88a8e42ef098b6d75239c0f047de1a27 - languageName: node - linkType: hard - "@blakeembrey/deque@npm:^1.0.5": version: 1.0.5 resolution: "@blakeembrey/deque@npm:1.0.5" @@ -2297,6 +2279,167 @@ __metadata: languageName: node linkType: hard +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -2408,93 +2551,6 @@ __metadata: languageName: node linkType: hard -"@istanbuljs/load-nyc-config@npm:^1.0.0": - version: 1.1.0 - resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" - dependencies: - camelcase: ^5.3.1 - find-up: ^4.1.0 - get-package-type: ^0.1.0 - js-yaml: ^3.13.1 - resolve-from: ^5.0.0 - checksum: d578da5e2e804d5c93228450a1380e1a3c691de4953acc162f387b717258512a3e07b83510a936d9fab03eac90817473917e24f5d16297af3867f59328d58568 - languageName: node - linkType: hard - -"@istanbuljs/schema@npm:^0.1.2": - version: 0.1.3 - resolution: "@istanbuljs/schema@npm:0.1.3" - checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 - languageName: node - linkType: hard - -"@jest/console@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/console@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - slash: ^3.0.0 - checksum: 0e3624e32c5a8e7361e889db70b170876401b7d70f509a2538c31d5cd50deb0c1ae4b92dc63fe18a0902e0a48c590c21d53787a0df41a52b34fa7cab96c384d6 - languageName: node - linkType: hard - -"@jest/core@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/core@npm:29.7.0" - dependencies: - "@jest/console": ^29.7.0 - "@jest/reporters": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - ci-info: ^3.2.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - jest-changed-files: ^29.7.0 - jest-config: ^29.7.0 - jest-haste-map: ^29.7.0 - jest-message-util: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-resolve-dependencies: ^29.7.0 - jest-runner: ^29.7.0 - jest-runtime: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - jest-watcher: ^29.7.0 - micromatch: ^4.0.4 - pretty-format: ^29.7.0 - slash: ^3.0.0 - strip-ansi: ^6.0.0 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: af759c9781cfc914553320446ce4e47775ae42779e73621c438feb1e4231a5d4862f84b1d8565926f2d1aab29b3ec3dcfdc84db28608bdf5f29867124ebcfc0d - languageName: node - linkType: hard - -"@jest/environment@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/environment@npm:29.7.0" - dependencies: - "@jest/fake-timers": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-mock: ^29.7.0 - checksum: 6fb398143b2543d4b9b8d1c6dbce83fa5247f84f550330604be744e24c2bd2178bb893657d62d1b97cf2f24baf85c450223f8237cccb71192c36a38ea2272934 - languageName: node - linkType: hard - "@jest/expect-utils@npm:^29.7.0": version: 29.7.0 resolution: "@jest/expect-utils@npm:29.7.0" @@ -2504,79 +2560,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/expect@npm:29.7.0" - dependencies: - expect: ^29.7.0 - jest-snapshot: ^29.7.0 - checksum: a01cb85fd9401bab3370618f4b9013b90c93536562222d920e702a0b575d239d74cecfe98010aaec7ad464f67cf534a353d92d181646a4b792acaa7e912ae55e - languageName: node - linkType: hard - -"@jest/fake-timers@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/fake-timers@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@sinonjs/fake-timers": ^10.0.2 - "@types/node": "*" - jest-message-util: ^29.7.0 - jest-mock: ^29.7.0 - jest-util: ^29.7.0 - checksum: caf2bbd11f71c9241b458d1b5a66cbe95debc5a15d96442444b5d5c7ba774f523c76627c6931cca5e10e76f0d08761f6f1f01a608898f4751a0eee54fc3d8d00 - languageName: node - linkType: hard - -"@jest/globals@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/globals@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/expect": ^29.7.0 - "@jest/types": ^29.6.3 - jest-mock: ^29.7.0 - checksum: 97dbb9459135693ad3a422e65ca1c250f03d82b2a77f6207e7fa0edd2c9d2015fbe4346f3dc9ebff1678b9d8da74754d4d440b7837497f8927059c0642a22123 - languageName: node - linkType: hard - -"@jest/reporters@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/reporters@npm:29.7.0" - dependencies: - "@bcoe/v8-coverage": ^0.2.3 - "@jest/console": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@jridgewell/trace-mapping": ^0.3.18 - "@types/node": "*" - chalk: ^4.0.0 - collect-v8-coverage: ^1.0.0 - exit: ^0.1.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - istanbul-lib-coverage: ^3.0.0 - istanbul-lib-instrument: ^6.0.0 - istanbul-lib-report: ^3.0.0 - istanbul-lib-source-maps: ^4.0.0 - istanbul-reports: ^3.1.3 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - jest-worker: ^29.7.0 - slash: ^3.0.0 - string-length: ^4.0.1 - strip-ansi: ^6.0.0 - v8-to-istanbul: ^9.0.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 7eadabd62cc344f629024b8a268ecc8367dba756152b761bdcb7b7e570a3864fc51b2a9810cd310d85e0a0173ef002ba4528d5ea0329fbf66ee2a3ada9c40455 - languageName: node - linkType: hard - "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -2586,64 +2569,6 @@ __metadata: languageName: node linkType: hard -"@jest/source-map@npm:^29.6.3": - version: 29.6.3 - resolution: "@jest/source-map@npm:29.6.3" - dependencies: - "@jridgewell/trace-mapping": ^0.3.18 - callsites: ^3.0.0 - graceful-fs: ^4.2.9 - checksum: bcc5a8697d471396c0003b0bfa09722c3cd879ad697eb9c431e6164e2ea7008238a01a07193dfe3cbb48b1d258eb7251f6efcea36f64e1ebc464ea3c03ae2deb - languageName: node - linkType: hard - -"@jest/test-result@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/test-result@npm:29.7.0" - dependencies: - "@jest/console": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/istanbul-lib-coverage": ^2.0.0 - collect-v8-coverage: ^1.0.0 - checksum: 67b6317d526e335212e5da0e768e3b8ab8a53df110361b80761353ad23b6aea4432b7c5665bdeb87658ea373b90fb1afe02ed3611ef6c858c7fba377505057fa - languageName: node - linkType: hard - -"@jest/test-sequencer@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/test-sequencer@npm:29.7.0" - dependencies: - "@jest/test-result": ^29.7.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - slash: ^3.0.0 - checksum: 73f43599017946be85c0b6357993b038f875b796e2f0950487a82f4ebcb115fa12131932dd9904026b4ad8be131fe6e28bd8d0aa93b1563705185f9804bff8bd - languageName: node - linkType: hard - -"@jest/transform@npm:^29.7.0": - version: 29.7.0 - resolution: "@jest/transform@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@jest/types": ^29.6.3 - "@jridgewell/trace-mapping": ^0.3.18 - babel-plugin-istanbul: ^6.1.1 - chalk: ^4.0.0 - convert-source-map: ^2.0.0 - fast-json-stable-stringify: ^2.1.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-util: ^29.7.0 - micromatch: ^4.0.4 - pirates: ^4.0.4 - slash: ^3.0.0 - write-file-atomic: ^4.0.2 - checksum: 0f8ac9f413903b3cb6d240102db848f2a354f63971ab885833799a9964999dd51c388162106a807f810071f864302cdd8e3f0c241c29ce02d85a36f18f3f40ab - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -2658,14 +2583,14 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.2": - version: 0.3.3 - resolution: "@jridgewell/gen-mapping@npm:0.3.3" +"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.2, @jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" dependencies: - "@jridgewell/set-array": ^1.0.1 + "@jridgewell/set-array": ^1.2.1 "@jridgewell/sourcemap-codec": ^1.4.10 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 languageName: node linkType: hard @@ -2676,10 +2601,10 @@ __metadata: languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.0.1": - version: 1.1.2 - resolution: "@jridgewell/set-array@npm:1.1.2" - checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 languageName: node linkType: hard @@ -2693,20 +2618,20 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": - version: 1.4.15 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" - checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.19 - resolution: "@jridgewell/trace-mapping@npm:0.3.19" +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: "@jridgewell/resolve-uri": ^3.1.0 "@jridgewell/sourcemap-codec": ^1.4.14 - checksum: 956a6f0f6fec060fb48c6bf1f5ec2064e13cd38c8be3873877d4b92b4a27ba58289a34071752671262a3e3c202abcc3fa2aac64d8447b4b0fa1ba3c9047f1c20 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 languageName: node linkType: hard @@ -3053,114 +2978,114 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.18.0" +"@rollup/rollup-android-arm-eabi@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.19.1" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm64@npm:4.18.0" +"@rollup/rollup-android-arm64@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-android-arm64@npm:4.19.1" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.18.0" +"@rollup/rollup-darwin-arm64@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-darwin-arm64@npm:4.19.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.18.0" +"@rollup/rollup-darwin-x64@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-darwin-x64@npm:4.19.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.19.1" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-musleabihf@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.19.1" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.0" +"@rollup/rollup-linux-arm64-gnu@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.19.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.0" +"@rollup/rollup-linux-arm64-musl@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.19.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.1" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.0" +"@rollup/rollup-linux-riscv64-gnu@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.19.1" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.0" +"@rollup/rollup-linux-s390x-gnu@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.19.1" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.0" +"@rollup/rollup-linux-x64-gnu@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.19.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.0" +"@rollup/rollup-linux-x64-musl@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.19.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.0" +"@rollup/rollup-win32-arm64-msvc@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.19.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.0" +"@rollup/rollup-win32-ia32-msvc@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.19.1" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.0" +"@rollup/rollup-win32-x64-msvc@npm:4.19.1": + version: 4.19.1 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.19.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -3209,24 +3134,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^2.0.0": - version: 2.0.0 - resolution: "@sinonjs/commons@npm:2.0.0" - dependencies: - type-detect: 4.0.8 - checksum: 5023ba17edf2b85ed58262313b8e9b59e23c6860681a9af0200f239fe939e2b79736d04a260e8270ddd57196851dde3ba754d7230be5c5234e777ae2ca8af137 - languageName: node - linkType: hard - -"@sinonjs/fake-timers@npm:^10.0.2": - version: 10.0.2 - resolution: "@sinonjs/fake-timers@npm:10.0.2" - dependencies: - "@sinonjs/commons": ^2.0.0 - checksum: c62aa98e7cefda8dedc101ce227abc888dc46b8ff9706c5f0a8dfd9c3ada97d0a5611384738d9ba0b26b59f99c2ba24efece8e779bb08329e9e87358fa309824 - languageName: node - linkType: hard - "@slorber/remark-comment@npm:^1.0.0": version: 1.0.0 resolution: "@slorber/remark-comment@npm:1.0.0" @@ -3426,47 +3333,6 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.1.14": - version: 7.20.0 - resolution: "@types/babel__core@npm:7.20.0" - dependencies: - "@babel/parser": ^7.20.7 - "@babel/types": ^7.20.7 - "@types/babel__generator": "*" - "@types/babel__template": "*" - "@types/babel__traverse": "*" - checksum: 49b601a0a7637f1f387442c8156bd086cfd10ff4b82b0e1994e73a6396643b5435366fb33d6b604eade8467cca594ef97adcbc412aede90bb112ebe88d0ad6df - languageName: node - linkType: hard - -"@types/babel__generator@npm:*": - version: 7.6.4 - resolution: "@types/babel__generator@npm:7.6.4" - dependencies: - "@babel/types": ^7.0.0 - checksum: 20effbbb5f8a3a0211e95959d06ae70c097fb6191011b73b38fe86deebefad8e09ee014605e0fd3cdaedc73d158be555866810e9166e1f09e4cfd880b874dcb0 - languageName: node - linkType: hard - -"@types/babel__template@npm:*": - version: 7.4.1 - resolution: "@types/babel__template@npm:7.4.1" - dependencies: - "@babel/parser": ^7.1.0 - "@babel/types": ^7.0.0 - checksum: 649fe8b42c2876be1fd28c6ed9b276f78152d5904ec290b6c861d9ef324206e0a5c242e8305c421ac52ecf6358fa7e32ab7a692f55370484825c1df29b1596ee - languageName: node - linkType: hard - -"@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": - version: 7.18.3 - resolution: "@types/babel__traverse@npm:7.18.3" - dependencies: - "@babel/types": ^7.3.0 - checksum: d20953338b2f012ab7750932ece0a78e7d1645b0a6ff42d49be90f55e9998085da1374a9786a7da252df89555c6586695ba4d1d4b4e88ab2b9f306bcd35e00d3 - languageName: node - linkType: hard - "@types/body-parser@npm:*": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" @@ -3573,15 +3439,6 @@ __metadata: languageName: node linkType: hard -"@types/graceful-fs@npm:^4.1.3": - version: 4.1.6 - resolution: "@types/graceful-fs@npm:4.1.6" - dependencies: - "@types/node": "*" - checksum: c3070ccdc9ca0f40df747bced1c96c71a61992d6f7c767e8fd24bb6a3c2de26e8b84135ede000b7e79db530a23e7e88dcd9db60eee6395d0f4ce1dae91369dd4 - languageName: node - linkType: hard - "@types/gtag.js@npm:^0.0.12": version: 0.0.12 resolution: "@types/gtag.js@npm:0.0.12" @@ -3628,7 +3485,7 @@ __metadata: languageName: node linkType: hard -"@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": +"@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0": version: 2.0.4 resolution: "@types/istanbul-lib-coverage@npm:2.0.4" checksum: a25d7589ee65c94d31464c16b72a9dc81dfa0bea9d3e105ae03882d616e2a0712a9c101a599ec482d297c3591e16336962878cb3eb1a0a62d5b76d277a890ce7 @@ -4131,12 +3988,75 @@ __metadata: languageName: node linkType: hard -"@webassemblyjs/ast@npm:1.11.5, @webassemblyjs/ast@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/ast@npm:1.11.5" +"@vitest/expect@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/expect@npm:2.0.5" dependencies: - "@webassemblyjs/helper-numbers": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 + "@vitest/spy": 2.0.5 + "@vitest/utils": 2.0.5 + chai: ^5.1.1 + tinyrainbow: ^1.2.0 + checksum: 0c65eb24c2fd9ef5735d1e65dc8fee59936e6cab1d6ab24a95e014b8337be5598242fceae4e8ec2974e2ae70a30c1906ad41208bf6de6cdf2043594cdb65e627 + languageName: node + linkType: hard + +"@vitest/pretty-format@npm:2.0.5, @vitest/pretty-format@npm:^2.0.5": + version: 2.0.5 + resolution: "@vitest/pretty-format@npm:2.0.5" + dependencies: + tinyrainbow: ^1.2.0 + checksum: d60346001180e5bb3c53be4b4d0b6d9352648b066641d5aba7b97d7c97a8e252dc934204d58818330262a65f07127455fc5f3b5f7e3647c60f6ff302a725733b + languageName: node + linkType: hard + +"@vitest/runner@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/runner@npm:2.0.5" + dependencies: + "@vitest/utils": 2.0.5 + pathe: ^1.1.2 + checksum: 4d6c23ea77ada83d70cb8cfd20b17cd0b9a375bc70b95466acee822734e203952931319abf167abcdba33dca415affed71d98d3f7212e1812dbf81e540fae4a4 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/snapshot@npm:2.0.5" + dependencies: + "@vitest/pretty-format": 2.0.5 + magic-string: ^0.30.10 + pathe: ^1.1.2 + checksum: 468d040106aa186a63ff3a86ce6bf333d52de83a2d906dc8c7c5c63406f2ecb46850ac5d69f5838a15764094946963962fa963d64c62a1a8a127ba20496fa3f1 + languageName: node + linkType: hard + +"@vitest/spy@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/spy@npm:2.0.5" + dependencies: + tinyspy: ^3.0.0 + checksum: a010dec99146832a2586c639fccf533b194482f6f25ffb2d64367598a4e77d094aedd3d82cdb55fc1a3971649577a039513ccf8dc1571492e5982482c530c7b9 + languageName: node + linkType: hard + +"@vitest/utils@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/utils@npm:2.0.5" + dependencies: + "@vitest/pretty-format": 2.0.5 + estree-walker: ^3.0.3 + loupe: ^3.1.1 + tinyrainbow: ^1.2.0 + checksum: 6867556dd7e376437e454b96c7e596ec16e141fb00b002b6ce435611ab3d9d1e3f38ebf48b1fc49f4c97f9754ed37abb602de8bf122f4ac0de621a4dbe0a314e + languageName: node + linkType: hard + +"@webassemblyjs/ast@npm:1.11.5, @webassemblyjs/ast@npm:^1.11.5": + version: 1.11.5 + resolution: "@webassemblyjs/ast@npm:1.11.5" + dependencies: + "@webassemblyjs/helper-numbers": 1.11.5 + "@webassemblyjs/helper-wasm-bytecode": 1.11.5 checksum: 7df16d8d4364d40e2506776330f8114fddc6494e6e18e8d5ec386312a0881a564cef136b0a74cc4a6ba284e2ff6bad890ddc029a0ba6cf45cc15186e638db118 languageName: node linkType: hard @@ -4498,7 +4418,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.2": +"ansi-escapes@npm:^4.3.2": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -4562,7 +4482,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": +"anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" dependencies: @@ -4723,6 +4643,13 @@ __metadata: languageName: node linkType: hard +"assertion-error@npm:^2.0.1": + version: 2.0.1 + resolution: "assertion-error@npm:2.0.1" + checksum: a0789dd882211b87116e81e2648ccb7f60340b34f19877dd020b39ebb4714e475eb943e14ba3e22201c221ef6645b7bfe10297e76b6ac95b48a9898c1211ce66 + languageName: node + linkType: hard + "astring@npm:^1.8.0": version: 1.8.6 resolution: "astring@npm:1.8.6" @@ -4764,23 +4691,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.7.0": - version: 29.7.0 - resolution: "babel-jest@npm:29.7.0" - dependencies: - "@jest/transform": ^29.7.0 - "@types/babel__core": ^7.1.14 - babel-plugin-istanbul: ^6.1.1 - babel-preset-jest: ^29.6.3 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - slash: ^3.0.0 - peerDependencies: - "@babel/core": ^7.8.0 - checksum: ee6f8e0495afee07cac5e4ee167be705c711a8cc8a737e05a587a131fdae2b3c8f9aa55dfd4d9c03009ac2d27f2de63d8ba96d3e8460da4d00e8af19ef9a83f7 - languageName: node - linkType: hard - "babel-loader@npm:^9.1.3": version: 9.1.3 resolution: "babel-loader@npm:9.1.3" @@ -4803,31 +4713,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-istanbul@npm:^6.1.1": - version: 6.1.1 - resolution: "babel-plugin-istanbul@npm:6.1.1" - dependencies: - "@babel/helper-plugin-utils": ^7.0.0 - "@istanbuljs/load-nyc-config": ^1.0.0 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-instrument: ^5.0.4 - test-exclude: ^6.0.0 - checksum: cb4fd95738219f232f0aece1116628cccff16db891713c4ccb501cddbbf9272951a5df81f2f2658dfdf4b3e7b236a9d5cbcf04d5d8c07dd5077297339598061a - languageName: node - linkType: hard - -"babel-plugin-jest-hoist@npm:^29.6.3": - version: 29.6.3 - resolution: "babel-plugin-jest-hoist@npm:29.6.3" - dependencies: - "@babel/template": ^7.3.3 - "@babel/types": ^7.3.3 - "@types/babel__core": ^7.1.14 - "@types/babel__traverse": ^7.0.6 - checksum: 51250f22815a7318f17214a9d44650ba89551e6d4f47a2dc259128428324b52f5a73979d010cefd921fd5a720d8c1d55ad74ff601cd94c7bd44d5f6292fde2d1 - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs2@npm:^0.4.6": version: 0.4.6 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.6" @@ -4864,40 +4749,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-current-node-syntax@npm:^1.0.0": - version: 1.0.1 - resolution: "babel-preset-current-node-syntax@npm:1.0.1" - dependencies: - "@babel/plugin-syntax-async-generators": ^7.8.4 - "@babel/plugin-syntax-bigint": ^7.8.3 - "@babel/plugin-syntax-class-properties": ^7.8.3 - "@babel/plugin-syntax-import-meta": ^7.8.3 - "@babel/plugin-syntax-json-strings": ^7.8.3 - "@babel/plugin-syntax-logical-assignment-operators": ^7.8.3 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - "@babel/plugin-syntax-numeric-separator": ^7.8.3 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - "@babel/plugin-syntax-top-level-await": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: d118c2742498c5492c095bc8541f4076b253e705b5f1ad9a2e7d302d81a84866f0070346662355c8e25fc02caa28dc2da8d69bcd67794a0d60c4d6fab6913cc8 - languageName: node - linkType: hard - -"babel-preset-jest@npm:^29.6.3": - version: 29.6.3 - resolution: "babel-preset-jest@npm:29.6.3" - dependencies: - babel-plugin-jest-hoist: ^29.6.3 - babel-preset-current-node-syntax: ^1.0.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: aa4ff2a8a728d9d698ed521e3461a109a1e66202b13d3494e41eea30729a5e7cc03b3a2d56c594423a135429c37bf63a9fa8b0b9ce275298be3095a88c69f6fb - languageName: node - linkType: hard - "bail@npm:^2.0.0": version: 2.0.2 resolution: "bail@npm:2.0.2" @@ -5082,24 +4933,6 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:0.x": - version: 0.2.6 - resolution: "bs-logger@npm:0.2.6" - dependencies: - fast-json-stable-stringify: 2.x - checksum: d34bdaf68c64bd099ab97c3ea608c9ae7d3f5faa1178b3f3f345acd94e852e608b2d4f9103fb2e503f5e69780e98293df41691b84be909b41cf5045374d54606 - languageName: node - linkType: hard - -"bser@npm:2.1.1": - version: 2.1.1 - resolution: "bser@npm:2.1.1" - dependencies: - node-int64: ^0.4.0 - checksum: 9ba4dc58ce86300c862bffc3ae91f00b2a03b01ee07f3564beeeaf82aa243b8b03ba53f123b0b842c190d4399b94697970c8e7cf7b1ea44b61aa28c3526a4449 - languageName: node - linkType: hard - "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -5138,6 +4971,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^6.7.14": + version: 6.7.14 + resolution: "cac@npm:6.7.14" + checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a + languageName: node + linkType: hard + "cacache@npm:^16.1.0": version: 16.1.3 resolution: "cacache@npm:16.1.3" @@ -5213,13 +5053,6 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^5.3.1": - version: 5.3.1 - resolution: "camelcase@npm:5.3.1" - checksum: e6effce26b9404e3c0f301498184f243811c30dfe6d0b9051863bd8e4034d09c8c2923794f280d6827e5aa055f6c434115ff97864a16a963366fb35fd673024b - languageName: node - linkType: hard - "camelcase@npm:^6.2.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" @@ -5260,6 +5093,19 @@ __metadata: languageName: node linkType: hard +"chai@npm:^5.1.1": + version: 5.1.1 + resolution: "chai@npm:5.1.1" + dependencies: + assertion-error: ^2.0.1 + check-error: ^2.1.1 + deep-eql: ^5.0.1 + loupe: ^3.1.0 + pathval: ^2.0.0 + checksum: 1e0a5e1b5febdfa8ceb97b9aff608286861ecb86533863119b2f39f07c08fb59f3c1791ab554947f009b9d71d509b9e4e734fb12133cb81f231c2c2ee7c1e738 + languageName: node + linkType: hard + "chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" @@ -5330,6 +5176,13 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^2.1.1": + version: 2.1.1 + resolution: "check-error@npm:2.1.1" + checksum: d785ed17b1d4a4796b6e75c765a9a290098cf52ff9728ce0756e8ffd4293d2e419dd30c67200aee34202463b474306913f2fcfaf1890641026d9fc6966fea27a + languageName: node + linkType: hard + "cheerio-select@npm:^2.1.0": version: 2.1.0 resolution: "cheerio-select@npm:2.1.0" @@ -5399,13 +5252,6 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0": - version: 1.2.2 - resolution: "cjs-module-lexer@npm:1.2.2" - checksum: 977f3f042bd4f08e368c890d91eecfbc4f91da0bc009a3c557bc4dfbf32022ad1141244ac1178d44de70fc9f3dea7add7cd9a658a34b9fae98a55d8f92331ce5 - languageName: node - linkType: hard - "clean-css@npm:^5.2.2, clean-css@npm:^5.3.2, clean-css@npm:~5.3.2": version: 5.3.3 resolution: "clean-css@npm:5.3.3" @@ -5508,13 +5354,6 @@ __metadata: languageName: node linkType: hard -"co@npm:^4.6.0": - version: 4.6.0 - resolution: "co@npm:4.6.0" - checksum: 5210d9223010eb95b29df06a91116f2cf7c8e0748a9013ed853b53f362ea0e822f1e5bb054fb3cefc645239a4cf966af1f6133a3b43f40d591f3b68ed6cf0510 - languageName: node - linkType: hard - "collapse-white-space@npm:^2.0.0": version: 2.1.0 resolution: "collapse-white-space@npm:2.1.0" @@ -5522,13 +5361,6 @@ __metadata: languageName: node linkType: hard -"collect-v8-coverage@npm:^1.0.0": - version: 1.0.1 - resolution: "collect-v8-coverage@npm:1.0.1" - checksum: 4efe0a1fccd517b65478a2364b33dadd0a43fc92a56f59aaece9b6186fe5177b2de471253587de7c91516f07c7268c2f6770b6cbcffc0e0ece353b766ec87e55 - languageName: node - linkType: hard - "color-convert@npm:^1.9.0": version: 1.9.3 resolution: "color-convert@npm:1.9.3" @@ -5766,13 +5598,6 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.6.0": - version: 1.9.0 - resolution: "convert-source-map@npm:1.9.0" - checksum: dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 - languageName: node - linkType: hard - "convert-source-map@npm:^2.0.0": version: 2.0.0 resolution: "convert-source-map@npm:2.0.0" @@ -5877,23 +5702,6 @@ __metadata: languageName: node linkType: hard -"create-jest@npm:^29.7.0": - version: 29.7.0 - resolution: "create-jest@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - jest-config: ^29.7.0 - jest-util: ^29.7.0 - prompts: ^2.0.1 - bin: - create-jest: bin/create-jest.js - checksum: 1427d49458adcd88547ef6fa39041e1fe9033a661293aa8d2c3aa1b4967cb5bf4f0c00436c7a61816558f28ba2ba81a94d5c962e8022ea9a883978fc8e1f2945 - languageName: node - linkType: hard - "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" @@ -6160,15 +5968,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": - version: 4.3.5 - resolution: "debug@npm:4.3.5" +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5": + version: 4.3.6 + resolution: "debug@npm:4.3.6" dependencies: ms: 2.1.2 peerDependenciesMeta: supports-color: optional: true - checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e + checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f languageName: node linkType: hard @@ -6199,15 +6007,10 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^1.0.0": - version: 1.5.1 - resolution: "dedent@npm:1.5.1" - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - checksum: c3c300a14edf1bdf5a873f9e4b22e839d62490bc5c8d6169c1f15858a1a76733d06a9a56930e963d677a2ceeca4b6b0894cc5ea2f501aa382ca5b92af3413c2a +"deep-eql@npm:^5.0.1": + version: 5.0.2 + resolution: "deep-eql@npm:5.0.2" + checksum: 6aaaadb4c19cbce42e26b2bbe5bd92875f599d2602635dc97f0294bae48da79e89470aedee05f449e0ca8c65e9fd7e7872624d1933a1db02713d99c2ca8d1f24 languageName: node linkType: hard @@ -6325,13 +6128,6 @@ __metadata: languageName: node linkType: hard -"detect-newline@npm:^3.0.0": - version: 3.1.0 - resolution: "detect-newline@npm:3.1.0" - checksum: ae6cd429c41ad01b164c59ea36f264a2c479598e61cba7c99da24175a7ab80ddf066420f2bec9a1c57a6bead411b4655ff15ad7d281c000a89791f48cbe939e7 - languageName: node - linkType: hard - "detect-node@npm:^2.0.4": version: 2.1.0 resolution: "detect-node@npm:2.1.0" @@ -6556,13 +6352,6 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.13.1": - version: 0.13.1 - resolution: "emittery@npm:0.13.1" - checksum: 2b089ab6306f38feaabf4f6f02792f9ec85fc054fda79f44f6790e61bbf6bc4e1616afb9b232e0c5ec5289a8a452f79bfa6d905a6fd64e94b49981f0934001c6 - languageName: node - linkType: hard - "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -6755,6 +6544,86 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:^0.21.3": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -7119,7 +6988,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^3.0.0": +"estree-walker@npm:^3.0.0, estree-walker@npm:^3.0.3": version: 3.0.3 resolution: "estree-walker@npm:3.0.3" dependencies: @@ -7207,14 +7076,24 @@ __metadata: languageName: node linkType: hard -"exit@npm:^0.1.2": - version: 0.1.2 - resolution: "exit@npm:0.1.2" - checksum: abc407f07a875c3961e4781dfcb743b58d6c93de9ab263f4f8c9d23bb6da5f9b7764fc773f86b43dd88030444d5ab8abcb611cb680fba8ca075362b77114bba3 +"execa@npm:^8.0.1": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: ^7.0.3 + get-stream: ^8.0.1 + human-signals: ^5.0.0 + is-stream: ^3.0.0 + merge-stream: ^2.0.0 + npm-run-path: ^5.1.0 + onetime: ^6.0.0 + signal-exit: ^4.1.0 + strip-final-newline: ^3.0.0 + checksum: cac1bf86589d1d9b73bdc5dda65c52012d1a9619c44c526891956745f7b366ca2603d29fe3f7460bacc2b48c6eab5d6a4f7afe0534b31473d3708d1265545e1f languageName: node linkType: hard -"expect@npm:^29.0.0, expect@npm:^29.7.0": +"expect@npm:^29.0.0": version: 29.7.0 resolution: "expect@npm:29.7.0" dependencies: @@ -7313,7 +7192,7 @@ __metadata: languageName: node linkType: hard -"fast-json-stable-stringify@npm:2.x, fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": +"fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb @@ -7363,15 +7242,6 @@ __metadata: languageName: node linkType: hard -"fb-watchman@npm:^2.0.0": - version: 2.0.2 - resolution: "fb-watchman@npm:2.0.2" - dependencies: - bser: 2.1.1 - checksum: b15a124cef28916fe07b400eb87cbc73ca082c142abf7ca8e8de6af43eca79ca7bd13eb4d4d48240b3bd3136eaac40d16e42d6edf87a8e5d1dd8070626860c78 - languageName: node - linkType: hard - "feed@npm:^4.2.2": version: 4.2.2 resolution: "feed@npm:4.2.2" @@ -7462,7 +7332,7 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^4.0.0, find-up@npm:^4.1.0": +"find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" dependencies: @@ -7670,19 +7540,19 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" +"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" dependencies: node-gyp: latest - checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 conditions: os=darwin languageName: node linkType: hard -"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" +"fsevents@patch:fsevents@~2.3.2#~builtin, fsevents@patch:fsevents@~2.3.3#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" dependencies: node-gyp: latest conditions: os=darwin @@ -7745,6 +7615,13 @@ __metadata: languageName: node linkType: hard +"get-func-name@npm:^2.0.1": + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1": version: 1.2.1 resolution: "get-intrinsic@npm:1.2.1" @@ -7764,13 +7641,6 @@ __metadata: languageName: node linkType: hard -"get-package-type@npm:^0.1.0": - version: 0.1.0 - resolution: "get-package-type@npm:0.1.0" - checksum: bba0811116d11e56d702682ddef7c73ba3481f114590e705fc549f4d868972263896af313c57a25c076e3c0d567e11d919a64ba1b30c879be985fc9d44f96148 - languageName: node - linkType: hard - "get-stream@npm:^5.0.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" @@ -7787,6 +7657,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 01e3d3cf29e1393f05f44d2f00445c5f9ec3d1c49e8179b31795484b9c117f4c695e5e07b88b50785d5c8248a788c85d9913a79266fc77e3ef11f78f10f1b974 + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -7959,6 +7836,13 @@ __metadata: languageName: node linkType: hard +"globrex@npm:^0.1.2": + version: 0.1.2 + resolution: "globrex@npm:0.1.2" + checksum: adca162494a176ce9ecf4dd232f7b802956bb1966b37f60c15e49d2e7d961b66c60826366dc2649093cad5a0d69970cfa8875bd1695b5a1a2f33dcd2aa88da3c + languageName: node + linkType: hard + "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -8309,7 +8193,7 @@ __metadata: languageName: node linkType: hard -"html-escaper@npm:^2.0.0, html-escaper@npm:^2.0.2": +"html-escaper@npm:^2.0.2": version: 2.0.2 resolution: "html-escaper@npm:2.0.2" checksum: d2df2da3ad40ca9ee3a39c5cc6475ef67c8f83c234475f24d8e9ce0dc80a2c82df8e1d6fa78ddd1e9022a586ea1bd247a615e80a5cd9273d90111ddda7d9e974 @@ -8523,6 +8407,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 6504560d5ed91444f16bea3bd9dfc66110a339442084e56c3e7fa7bbdf3f406426d6563d662bdce67064b165eac31eeabfc0857ed170aaa612cf14ec9f9a464c + languageName: node + linkType: hard + "humanize-ms@npm:^1.2.1": version: 1.2.1 resolution: "humanize-ms@npm:1.2.1" @@ -8624,18 +8515,6 @@ __metadata: languageName: node linkType: hard -"import-local@npm:^3.0.2": - version: 3.1.0 - resolution: "import-local@npm:3.1.0" - dependencies: - pkg-dir: ^4.2.0 - resolve-cwd: ^3.0.0 - bin: - import-local-fixture: fixtures/cli.js - checksum: bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd - languageName: node - linkType: hard - "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -8932,13 +8811,6 @@ __metadata: languageName: node linkType: hard -"is-generator-fn@npm:^2.0.0": - version: 2.1.0 - resolution: "is-generator-fn@npm:2.1.0" - checksum: a6ad5492cf9d1746f73b6744e0c43c0020510b59d56ddcb78a91cbc173f09b5e6beff53d75c9c5a29feb618bfef2bf458e025ecf3a57ad2268e2fb2569f56215 - languageName: node - linkType: hard - "is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" @@ -9123,6 +8995,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "is-stream@npm:3.0.0" + checksum: 172093fe99119ffd07611ab6d1bcccfe8bc4aa80d864b15f43e63e54b7abc71e779acd69afdb854c4e2a67fdc16ae710e370eda40088d1cfc956a50ed82d8f16 + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -9242,71 +9121,6 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": - version: 3.2.0 - resolution: "istanbul-lib-coverage@npm:3.2.0" - checksum: a2a545033b9d56da04a8571ed05c8120bf10e9bce01cf8633a3a2b0d1d83dff4ac4fe78d6d5673c27fc29b7f21a41d75f83a36be09f82a61c367b56aa73c1ff9 - languageName: node - linkType: hard - -"istanbul-lib-instrument@npm:^5.0.4": - version: 5.2.1 - resolution: "istanbul-lib-instrument@npm:5.2.1" - dependencies: - "@babel/core": ^7.12.3 - "@babel/parser": ^7.14.7 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-coverage: ^3.2.0 - semver: ^6.3.0 - checksum: bf16f1803ba5e51b28bbd49ed955a736488381e09375d830e42ddeb403855b2006f850711d95ad726f2ba3f1ae8e7366de7e51d2b9ac67dc4d80191ef7ddf272 - languageName: node - linkType: hard - -"istanbul-lib-instrument@npm:^6.0.0": - version: 6.0.0 - resolution: "istanbul-lib-instrument@npm:6.0.0" - dependencies: - "@babel/core": ^7.12.3 - "@babel/parser": ^7.14.7 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-coverage: ^3.2.0 - semver: ^7.5.4 - checksum: b9dc3723a769e65dbe1b912f935088ffc07cf393fa78a3ce79022c91aabb0ad01405ffd56083cdd822e514798e9daae3ea7bfe85633b094ecb335d28eb0a3f97 - languageName: node - linkType: hard - -"istanbul-lib-report@npm:^3.0.0": - version: 3.0.0 - resolution: "istanbul-lib-report@npm:3.0.0" - dependencies: - istanbul-lib-coverage: ^3.0.0 - make-dir: ^3.0.0 - supports-color: ^7.1.0 - checksum: 3f29eb3f53c59b987386e07fe772d24c7f58c6897f34c9d7a296f4000de7ae3de9eb95c3de3df91dc65b134c84dee35c54eee572a56243e8907c48064e34ff1b - languageName: node - linkType: hard - -"istanbul-lib-source-maps@npm:^4.0.0": - version: 4.0.1 - resolution: "istanbul-lib-source-maps@npm:4.0.1" - dependencies: - debug: ^4.1.1 - istanbul-lib-coverage: ^3.0.0 - source-map: ^0.6.1 - checksum: 21ad3df45db4b81852b662b8d4161f6446cd250c1ddc70ef96a585e2e85c26ed7cd9c2a396a71533cfb981d1a645508bc9618cae431e55d01a0628e7dec62ef2 - languageName: node - linkType: hard - -"istanbul-reports@npm:^3.1.3": - version: 3.1.5 - resolution: "istanbul-reports@npm:3.1.5" - dependencies: - html-escaper: ^2.0.0 - istanbul-lib-report: ^3.0.0 - checksum: 7867228f83ed39477b188ea07e7ccb9b4f5320b6f73d1db93a0981b7414fa4ef72d3f80c4692c442f90fc250d9406e71d8d7ab65bb615cb334e6292b73192b89 - languageName: node - linkType: hard - "jackspeak@npm:^2.3.5": version: 2.3.6 resolution: "jackspeak@npm:2.3.6" @@ -9320,109 +9134,6 @@ __metadata: languageName: node linkType: hard -"jest-changed-files@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-changed-files@npm:29.7.0" - dependencies: - execa: ^5.0.0 - jest-util: ^29.7.0 - p-limit: ^3.1.0 - checksum: 963e203893c396c5dfc75e00a49426688efea7361b0f0e040035809cecd2d46b3c01c02be2d9e8d38b1138357d2de7719ea5b5be21f66c10f2e9685a5a73bb99 - languageName: node - linkType: hard - -"jest-circus@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-circus@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/expect": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - co: ^4.6.0 - dedent: ^1.0.0 - is-generator-fn: ^2.0.0 - jest-each: ^29.7.0 - jest-matcher-utils: ^29.7.0 - jest-message-util: ^29.7.0 - jest-runtime: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - p-limit: ^3.1.0 - pretty-format: ^29.7.0 - pure-rand: ^6.0.0 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: 349437148924a5a109c9b8aad6d393a9591b4dac1918fc97d81b7fc515bc905af9918495055071404af1fab4e48e4b04ac3593477b1d5dcf48c4e71b527c70a7 - languageName: node - linkType: hard - -"jest-cli@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-cli@npm:29.7.0" - dependencies: - "@jest/core": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - create-jest: ^29.7.0 - exit: ^0.1.2 - import-local: ^3.0.2 - jest-config: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - yargs: ^17.3.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 664901277a3f5007ea4870632ed6e7889db9da35b2434e7cb488443e6bf5513889b344b7fddf15112135495b9875892b156faeb2d7391ddb9e2a849dcb7b6c36 - languageName: node - linkType: hard - -"jest-config@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-config@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@jest/test-sequencer": ^29.7.0 - "@jest/types": ^29.6.3 - babel-jest: ^29.7.0 - chalk: ^4.0.0 - ci-info: ^3.2.0 - deepmerge: ^4.2.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-circus: ^29.7.0 - jest-environment-node: ^29.7.0 - jest-get-type: ^29.6.3 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-runner: ^29.7.0 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - micromatch: ^4.0.4 - parse-json: ^5.2.0 - pretty-format: ^29.7.0 - slash: ^3.0.0 - strip-json-comments: ^3.1.1 - peerDependencies: - "@types/node": "*" - ts-node: ">=9.0.0" - peerDependenciesMeta: - "@types/node": - optional: true - ts-node: - optional: true - checksum: 4cabf8f894c180cac80b7df1038912a3fc88f96f2622de33832f4b3314f83e22b08fb751da570c0ab2b7988f21604bdabade95e3c0c041068ac578c085cf7dff - languageName: node - linkType: hard - "jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" @@ -9435,42 +9146,6 @@ __metadata: languageName: node linkType: hard -"jest-docblock@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-docblock@npm:29.7.0" - dependencies: - detect-newline: ^3.0.0 - checksum: 66390c3e9451f8d96c5da62f577a1dad701180cfa9b071c5025acab2f94d7a3efc2515cfa1654ebe707213241541ce9c5530232cdc8017c91ed64eea1bd3b192 - languageName: node - linkType: hard - -"jest-each@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-each@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - chalk: ^4.0.0 - jest-get-type: ^29.6.3 - jest-util: ^29.7.0 - pretty-format: ^29.7.0 - checksum: e88f99f0184000fc8813f2a0aa79e29deeb63700a3b9b7928b8a418d7d93cd24933608591dbbdea732b473eb2021c72991b5cc51a17966842841c6e28e6f691c - languageName: node - linkType: hard - -"jest-environment-node@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-environment-node@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/fake-timers": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-mock: ^29.7.0 - jest-util: ^29.7.0 - checksum: 501a9966292cbe0ca3f40057a37587cb6def25e1e0c5e39ac6c650fe78d3c70a2428304341d084ac0cced5041483acef41c477abac47e9a290d5545fd2f15646 - languageName: node - linkType: hard - "jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" @@ -9478,39 +9153,6 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-haste-map@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/graceful-fs": ^4.1.3 - "@types/node": "*" - anymatch: ^3.0.3 - fb-watchman: ^2.0.0 - fsevents: ^2.3.2 - graceful-fs: ^4.2.9 - jest-regex-util: ^29.6.3 - jest-util: ^29.7.0 - jest-worker: ^29.7.0 - micromatch: ^4.0.4 - walker: ^1.0.8 - dependenciesMeta: - fsevents: - optional: true - checksum: c2c8f2d3e792a963940fbdfa563ce14ef9e14d4d86da645b96d3cd346b8d35c5ce0b992ee08593939b5f718cf0a1f5a90011a056548a1dbf58397d4356786f01 - languageName: node - linkType: hard - -"jest-leak-detector@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-leak-detector@npm:29.7.0" - dependencies: - jest-get-type: ^29.6.3 - pretty-format: ^29.7.0 - checksum: e3950e3ddd71e1d0c22924c51a300a1c2db6cf69ec1e51f95ccf424bcc070f78664813bef7aed4b16b96dfbdeea53fe358f8aeaaea84346ae15c3735758f1605 - languageName: node - linkType: hard - "jest-matcher-utils@npm:^29.7.0": version: 29.7.0 resolution: "jest-matcher-utils@npm:29.7.0" @@ -9529,202 +9171,28 @@ __metadata: dependencies: "@babel/code-frame": ^7.12.13 "@jest/types": ^29.6.3 - "@types/stack-utils": ^2.0.0 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - micromatch: ^4.0.4 - pretty-format: ^29.7.0 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: a9d025b1c6726a2ff17d54cc694de088b0489456c69106be6b615db7a51b7beb66788bea7a59991a019d924fbf20f67d085a445aedb9a4d6760363f4d7d09930 - languageName: node - linkType: hard - -"jest-mock@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-mock@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/node": "*" - jest-util: ^29.7.0 - checksum: 81ba9b68689a60be1482212878973700347cb72833c5e5af09895882b9eb5c4e02843a1bbdf23f94c52d42708bab53a30c45a3482952c9eec173d1eaac5b86c5 - languageName: node - linkType: hard - -"jest-pnp-resolver@npm:^1.2.2": - version: 1.2.3 - resolution: "jest-pnp-resolver@npm:1.2.3" - peerDependencies: - jest-resolve: "*" - peerDependenciesMeta: - jest-resolve: - optional: true - checksum: db1a8ab2cb97ca19c01b1cfa9a9c8c69a143fde833c14df1fab0766f411b1148ff0df878adea09007ac6a2085ec116ba9a996a6ad104b1e58c20adbf88eed9b2 - languageName: node - linkType: hard - -"jest-regex-util@npm:^29.6.3": - version: 29.6.3 - resolution: "jest-regex-util@npm:29.6.3" - checksum: 0518beeb9bf1228261695e54f0feaad3606df26a19764bc19541e0fc6e2a3737191904607fb72f3f2ce85d9c16b28df79b7b1ec9443aa08c3ef0e9efda6f8f2a - languageName: node - linkType: hard - -"jest-resolve-dependencies@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-resolve-dependencies@npm:29.7.0" - dependencies: - jest-regex-util: ^29.6.3 - jest-snapshot: ^29.7.0 - checksum: aeb75d8150aaae60ca2bb345a0d198f23496494677cd6aefa26fc005faf354061f073982175daaf32b4b9d86b26ca928586344516e3e6969aa614cb13b883984 - languageName: node - linkType: hard - -"jest-resolve@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-resolve@npm:29.7.0" - dependencies: - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-pnp-resolver: ^1.2.2 - jest-util: ^29.7.0 - jest-validate: ^29.7.0 - resolve: ^1.20.0 - resolve.exports: ^2.0.0 - slash: ^3.0.0 - checksum: 0ca218e10731aa17920526ec39deaec59ab9b966237905ffc4545444481112cd422f01581230eceb7e82d86f44a543d520a71391ec66e1b4ef1a578bd5c73487 - languageName: node - linkType: hard - -"jest-runner@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-runner@npm:29.7.0" - dependencies: - "@jest/console": ^29.7.0 - "@jest/environment": ^29.7.0 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - emittery: ^0.13.1 - graceful-fs: ^4.2.9 - jest-docblock: ^29.7.0 - jest-environment-node: ^29.7.0 - jest-haste-map: ^29.7.0 - jest-leak-detector: ^29.7.0 - jest-message-util: ^29.7.0 - jest-resolve: ^29.7.0 - jest-runtime: ^29.7.0 - jest-util: ^29.7.0 - jest-watcher: ^29.7.0 - jest-worker: ^29.7.0 - p-limit: ^3.1.0 - source-map-support: 0.5.13 - checksum: f0405778ea64812bf9b5c50b598850d94ccf95d7ba21f090c64827b41decd680ee19fcbb494007cdd7f5d0d8906bfc9eceddd8fa583e753e736ecd462d4682fb - languageName: node - linkType: hard - -"jest-runtime@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-runtime@npm:29.7.0" - dependencies: - "@jest/environment": ^29.7.0 - "@jest/fake-timers": ^29.7.0 - "@jest/globals": ^29.7.0 - "@jest/source-map": ^29.6.3 - "@jest/test-result": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - cjs-module-lexer: ^1.0.0 - collect-v8-coverage: ^1.0.0 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.7.0 - jest-message-util: ^29.7.0 - jest-mock: ^29.7.0 - jest-regex-util: ^29.6.3 - jest-resolve: ^29.7.0 - jest-snapshot: ^29.7.0 - jest-util: ^29.7.0 - slash: ^3.0.0 - strip-bom: ^4.0.0 - checksum: d19f113d013e80691e07047f68e1e3448ef024ff2c6b586ce4f90cd7d4c62a2cd1d460110491019719f3c59bfebe16f0e201ed005ef9f80e2cf798c374eed54e - languageName: node - linkType: hard - -"jest-snapshot@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-snapshot@npm:29.7.0" - dependencies: - "@babel/core": ^7.11.6 - "@babel/generator": ^7.7.2 - "@babel/plugin-syntax-jsx": ^7.7.2 - "@babel/plugin-syntax-typescript": ^7.7.2 - "@babel/types": ^7.3.3 - "@jest/expect-utils": ^29.7.0 - "@jest/transform": ^29.7.0 - "@jest/types": ^29.6.3 - babel-preset-current-node-syntax: ^1.0.0 - chalk: ^4.0.0 - expect: ^29.7.0 - graceful-fs: ^4.2.9 - jest-diff: ^29.7.0 - jest-get-type: ^29.6.3 - jest-matcher-utils: ^29.7.0 - jest-message-util: ^29.7.0 - jest-util: ^29.7.0 - natural-compare: ^1.4.0 - pretty-format: ^29.7.0 - semver: ^7.5.3 - checksum: 86821c3ad0b6899521ce75ee1ae7b01b17e6dfeff9166f2cf17f012e0c5d8c798f30f9e4f8f7f5bed01ea7b55a6bc159f5eda778311162cbfa48785447c237ad - languageName: node - linkType: hard - -"jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-util@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - "@types/node": "*" - chalk: ^4.0.0 - ci-info: ^3.2.0 - graceful-fs: ^4.2.9 - picomatch: ^2.2.3 - checksum: 042ab4980f4ccd4d50226e01e5c7376a8556b472442ca6091a8f102488c0f22e6e8b89ea874111d2328a2080083bf3225c86f3788c52af0bd0345a00eb57a3ca - languageName: node - linkType: hard - -"jest-validate@npm:^29.7.0": - version: 29.7.0 - resolution: "jest-validate@npm:29.7.0" - dependencies: - "@jest/types": ^29.6.3 - camelcase: ^6.2.0 + "@types/stack-utils": ^2.0.0 chalk: ^4.0.0 - jest-get-type: ^29.6.3 - leven: ^3.1.0 + graceful-fs: ^4.2.9 + micromatch: ^4.0.4 pretty-format: ^29.7.0 - checksum: 191fcdc980f8a0de4dbdd879fa276435d00eb157a48683af7b3b1b98b0f7d9de7ffe12689b617779097ff1ed77601b9f7126b0871bba4f776e222c40f62e9dae + slash: ^3.0.0 + stack-utils: ^2.0.3 + checksum: a9d025b1c6726a2ff17d54cc694de088b0489456c69106be6b615db7a51b7beb66788bea7a59991a019d924fbf20f67d085a445aedb9a4d6760363f4d7d09930 languageName: node linkType: hard -"jest-watcher@npm:^29.7.0": +"jest-util@npm:^29.7.0": version: 29.7.0 - resolution: "jest-watcher@npm:29.7.0" + resolution: "jest-util@npm:29.7.0" dependencies: - "@jest/test-result": ^29.7.0 "@jest/types": ^29.6.3 "@types/node": "*" - ansi-escapes: ^4.2.1 chalk: ^4.0.0 - emittery: ^0.13.1 - jest-util: ^29.7.0 - string-length: ^4.0.1 - checksum: 67e6e7fe695416deff96b93a14a561a6db69389a0667e9489f24485bb85e5b54e12f3b2ba511ec0b777eca1e727235b073e3ebcdd473d68888650489f88df92f + ci-info: ^3.2.0 + graceful-fs: ^4.2.9 + picomatch: ^2.2.3 + checksum: 042ab4980f4ccd4d50226e01e5c7376a8556b472442ca6091a8f102488c0f22e6e8b89ea874111d2328a2080083bf3225c86f3788c52af0bd0345a00eb57a3ca languageName: node linkType: hard @@ -9750,7 +9218,7 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^29.4.3, jest-worker@npm:^29.7.0": +"jest-worker@npm:^29.4.3": version: 29.7.0 resolution: "jest-worker@npm:29.7.0" dependencies: @@ -9762,25 +9230,6 @@ __metadata: languageName: node linkType: hard -"jest@npm:^29.7.0": - version: 29.7.0 - resolution: "jest@npm:29.7.0" - dependencies: - "@jest/core": ^29.7.0 - "@jest/types": ^29.6.3 - import-local: ^3.0.2 - jest-cli: ^29.7.0 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: 17ca8d67504a7dbb1998cf3c3077ec9031ba3eb512da8d71cb91bcabb2b8995c4e4b292b740cb9bf1cbff5ce3e110b3f7c777b0cefb6f41ab05445f248d0ee0b - languageName: node - linkType: hard - "jiti@npm:^1.18.2, jiti@npm:^1.20.0": version: 1.21.0 resolution: "jiti@npm:1.21.0" @@ -10070,7 +9519,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 9ff3942feeccffa4f1fafa88d32f0d24fdc62fd15ded5a74a5f950ff5f0c6f61916157246744c620173dddf38d37095a92327d5fd3861e2063e736a5c207d089 @@ -10126,6 +9575,15 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^3.1.0, loupe@npm:^3.1.1": + version: 3.1.1 + resolution: "loupe@npm:3.1.1" + dependencies: + get-func-name: ^2.0.1 + checksum: c7efa6bc6d71f25ca03eb13c9a069e35ed86799e308ca27a7a3eff8cdf9500e7c22d1f2411468d154a8e960e91e5e685e0c6c83e96db748f177c1adf30811153 + languageName: node + linkType: hard + "lower-case@npm:^2.0.2": version: 2.0.2 resolution: "lower-case@npm:2.0.2" @@ -10188,28 +9646,12 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.2, magic-string@npm:^0.30.3": - version: 0.30.5 - resolution: "magic-string@npm:0.30.5" - dependencies: - "@jridgewell/sourcemap-codec": ^1.4.15 - checksum: da10fecff0c0a7d3faf756913ce62bd6d5e7b0402be48c3b27bfd651b90e29677e279069a63b764bcdc1b8ecdcdb898f29a5c5ec510f2323e8d62ee057a6eb18 - languageName: node - linkType: hard - -"make-dir@npm:^3.0.0": - version: 3.1.0 - resolution: "make-dir@npm:3.1.0" +"magic-string@npm:^0.30.10, magic-string@npm:^0.30.2, magic-string@npm:^0.30.3": + version: 0.30.11 + resolution: "magic-string@npm:0.30.11" dependencies: - semver: ^6.0.0 - checksum: 484200020ab5a1fdf12f393fe5f385fc8e4378824c940fba1729dcd198ae4ff24867bc7a5646331e50cead8abff5d9270c456314386e629acec6dff4b8016b78 - languageName: node - linkType: hard - -"make-error@npm:1.x": - version: 1.3.6 - resolution: "make-error@npm:1.3.6" - checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 + "@jridgewell/sourcemap-codec": ^1.5.0 + checksum: e041649453c9a3f31d2e731fc10e38604d50e20d3585cd48bc7713a6e2e1a3ad3012105929ca15750d59d0a3f1904405e4b95a23b7e69dc256db3c277a73a3ca languageName: node linkType: hard @@ -10237,15 +9679,6 @@ __metadata: languageName: node linkType: hard -"makeerror@npm:1.0.12": - version: 1.0.12 - resolution: "makeerror@npm:1.0.12" - dependencies: - tmpl: 1.0.5 - checksum: b38a025a12c8146d6eeea5a7f2bf27d51d8ad6064da8ca9405fcf7bf9b54acd43e3b30ddd7abb9b1bfa4ddb266019133313482570ddb207de568f71ecfcf6060 - languageName: node - linkType: hard - "mark.js@npm:^8.11.1": version: 8.11.1 resolution: "mark.js@npm:8.11.1" @@ -11133,6 +10566,13 @@ __metadata: languageName: node linkType: hard +"mimic-fn@npm:^4.0.0": + version: 4.0.0 + resolution: "mimic-fn@npm:4.0.0" + checksum: 995dcece15ee29aa16e188de6633d43a3db4611bcf93620e7e62109ec41c79c0f34277165b8ce5e361205049766e371851264c21ac64ca35499acb5421c2ba56 + languageName: node + linkType: hard + "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -11436,13 +10876,6 @@ __metadata: languageName: node linkType: hard -"node-int64@npm:^0.4.0": - version: 0.4.0 - resolution: "node-int64@npm:0.4.0" - checksum: d0b30b1ee6d961851c60d5eaa745d30b5c95d94bc0e74b81e5292f7c42a49e3af87f1eb9e89f59456f80645d679202537de751b7d72e9e40ceea40c5e449057e - languageName: node - linkType: hard - "node-releases@npm:^2.0.14": version: 2.0.14 resolution: "node-releases@npm:2.0.14" @@ -11491,6 +10924,15 @@ __metadata: languageName: node linkType: hard +"npm-run-path@npm:^5.1.0": + version: 5.3.0 + resolution: "npm-run-path@npm:5.3.0" + dependencies: + path-key: ^4.0.0 + checksum: ae8e7a89da9594fb9c308f6555c73f618152340dcaae423e5fb3620026fefbec463618a8b761920382d666fa7a2d8d240b6fe320e8a6cdd54dc3687e2b659d25 + languageName: node + linkType: hard + "npmlog@npm:^6.0.0": version: 6.0.2 resolution: "npmlog@npm:6.0.2" @@ -11651,6 +11093,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^6.0.0": + version: 6.0.0 + resolution: "onetime@npm:6.0.0" + dependencies: + mimic-fn: ^4.0.0 + checksum: 0846ce78e440841335d4e9182ef69d5762e9f38aa7499b19f42ea1c4cd40f0b4446094c455c713f9adac3f4ae86f613bb5e30c99e52652764d06a89f709b3788 + languageName: node + linkType: hard + "open@npm:^8.0.9, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" @@ -11725,7 +11176,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^3.0.2, p-limit@npm:^3.1.0": +"p-limit@npm:^3.0.2": version: 3.1.0 resolution: "p-limit@npm:3.1.0" dependencies: @@ -11949,6 +11400,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^4.0.0": + version: 4.0.0 + resolution: "path-key@npm:4.0.0" + checksum: 8e6c314ae6d16b83e93032c61020129f6f4484590a777eed709c4a01b50e498822b00f76ceaf94bc64dbd90b327df56ceadce27da3d83393790f1219e07721d7 + languageName: node + linkType: hard + "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -11996,6 +11454,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^1.1.2": + version: 1.1.2 + resolution: "pathe@npm:1.1.2" + checksum: ec5f778d9790e7b9ffc3e4c1df39a5bb1ce94657a4e3ad830c1276491ca9d79f189f47609884671db173400256b005f4955f7952f52a2aeb5834ad5fb4faf134 + languageName: node + linkType: hard + +"pathval@npm:^2.0.0": + version: 2.0.0 + resolution: "pathval@npm:2.0.0" + checksum: 682b6a6289de7990909effef7dae9aa7bb6218c0426727bccf66a35b34e7bfbc65615270c5e44e3c9557a5cb44b1b9ef47fc3cb18bce6ad3ba92bcd28467ed7d + languageName: node + linkType: hard + "periscopic@npm:^3.0.0": version: 3.1.0 resolution: "periscopic@npm:3.1.0" @@ -12007,10 +11479,10 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 +"picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": + version: 1.0.1 + resolution: "picocolors@npm:1.0.1" + checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 languageName: node linkType: hard @@ -12028,22 +11500,6 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.4": - version: 4.0.5 - resolution: "pirates@npm:4.0.5" - checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227 - languageName: node - linkType: hard - -"pkg-dir@npm:^4.2.0": - version: 4.2.0 - resolution: "pkg-dir@npm:4.2.0" - dependencies: - find-up: ^4.0.0 - checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 - languageName: node - linkType: hard - "pkg-dir@npm:^7.0.0": version: 7.0.0 resolution: "pkg-dir@npm:7.0.0" @@ -12495,14 +11951,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.38": - version: 8.4.38 - resolution: "postcss@npm:8.4.38" +"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.38, postcss@npm:^8.4.39": + version: 8.4.40 + resolution: "postcss@npm:8.4.40" dependencies: nanoid: ^3.3.7 - picocolors: ^1.0.0 + picocolors: ^1.0.1 source-map-js: ^1.2.0 - checksum: 649f9e60a763ca4b5a7bbec446a069edf07f057f6d780a5a0070576b841538d1ecf7dd888f2fbfd1f76200e26c969e405aeeae66332e6927dbdc8bdcb90b9451 + checksum: afd0cc49d2169dcd96c0f17e155c5d75de048956306a3017f1cfa6a7d66b941592245bed20f7796ceeccb2d8967749b623be2c7b010a74f67ea10fb5bdb8ba28 languageName: node linkType: hard @@ -12612,7 +12068,7 @@ __metadata: languageName: node linkType: hard -"prompts@npm:^2.0.1, prompts@npm:^2.4.2": +"prompts@npm:^2.4.2": version: 2.4.2 resolution: "prompts@npm:2.4.2" dependencies: @@ -12690,13 +12146,6 @@ __metadata: languageName: node linkType: hard -"pure-rand@npm:^6.0.0": - version: 6.0.1 - resolution: "pure-rand@npm:6.0.1" - checksum: 4bb565399993b815658a72e359f574ce4f04827a42a905105d61163ae86f456d91595a0e4241e7bce04328fae0638ae70ac0428d93ecb55971c465bd084f8648 - languageName: node - linkType: hard - "qs@npm:6.11.0": version: 6.11.0 resolution: "qs@npm:6.11.0" @@ -13264,15 +12713,6 @@ __metadata: languageName: node linkType: hard -"resolve-cwd@npm:^3.0.0": - version: 3.0.0 - resolution: "resolve-cwd@npm:3.0.0" - dependencies: - resolve-from: ^5.0.0 - checksum: 546e0816012d65778e580ad62b29e975a642989108d9a3c5beabfb2304192fa3c9f9146fbdfe213563c6ff51975ae41bac1d3c6e047dd9572c94863a057b4d81 - languageName: node - linkType: hard - "resolve-from@npm:^4.0.0": version: 4.0.0 resolution: "resolve-from@npm:4.0.0" @@ -13280,13 +12720,6 @@ __metadata: languageName: node linkType: hard -"resolve-from@npm:^5.0.0": - version: 5.0.0 - resolution: "resolve-from@npm:5.0.0" - checksum: 4ceeb9113e1b1372d0cd969f3468fa042daa1dd9527b1b6bb88acb6ab55d8b9cd65dbf18819f9f9ddf0db804990901dcdaade80a215e7b2c23daae38e64f5bdf - languageName: node - linkType: hard - "resolve-pathname@npm:^3.0.0": version: 3.0.0 resolution: "resolve-pathname@npm:3.0.0" @@ -13294,14 +12727,7 @@ __metadata: languageName: node linkType: hard -"resolve.exports@npm:^2.0.0": - version: 2.0.2 - resolution: "resolve.exports@npm:2.0.2" - checksum: 1c7778ca1b86a94f8ab4055d196c7d87d1874b96df4d7c3e67bbf793140f0717fd506dcafd62785b079cd6086b9264424ad634fb904409764c3509c3df1653f2 - languageName: node - linkType: hard - -"resolve@npm:^1.1.6, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4": +"resolve@npm:^1.1.6, resolve@npm:^1.14.2, resolve@npm:^1.22.1, resolve@npm:^1.22.4": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -13314,7 +12740,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.22.4#~builtin": +"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.22.4#~builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -13435,26 +12861,26 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.18.0": - version: 4.18.0 - resolution: "rollup@npm:4.18.0" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.18.0 - "@rollup/rollup-android-arm64": 4.18.0 - "@rollup/rollup-darwin-arm64": 4.18.0 - "@rollup/rollup-darwin-x64": 4.18.0 - "@rollup/rollup-linux-arm-gnueabihf": 4.18.0 - "@rollup/rollup-linux-arm-musleabihf": 4.18.0 - "@rollup/rollup-linux-arm64-gnu": 4.18.0 - "@rollup/rollup-linux-arm64-musl": 4.18.0 - "@rollup/rollup-linux-powerpc64le-gnu": 4.18.0 - "@rollup/rollup-linux-riscv64-gnu": 4.18.0 - "@rollup/rollup-linux-s390x-gnu": 4.18.0 - "@rollup/rollup-linux-x64-gnu": 4.18.0 - "@rollup/rollup-linux-x64-musl": 4.18.0 - "@rollup/rollup-win32-arm64-msvc": 4.18.0 - "@rollup/rollup-win32-ia32-msvc": 4.18.0 - "@rollup/rollup-win32-x64-msvc": 4.18.0 +"rollup@npm:^4.13.0, rollup@npm:^4.18.0": + version: 4.19.1 + resolution: "rollup@npm:4.19.1" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.19.1 + "@rollup/rollup-android-arm64": 4.19.1 + "@rollup/rollup-darwin-arm64": 4.19.1 + "@rollup/rollup-darwin-x64": 4.19.1 + "@rollup/rollup-linux-arm-gnueabihf": 4.19.1 + "@rollup/rollup-linux-arm-musleabihf": 4.19.1 + "@rollup/rollup-linux-arm64-gnu": 4.19.1 + "@rollup/rollup-linux-arm64-musl": 4.19.1 + "@rollup/rollup-linux-powerpc64le-gnu": 4.19.1 + "@rollup/rollup-linux-riscv64-gnu": 4.19.1 + "@rollup/rollup-linux-s390x-gnu": 4.19.1 + "@rollup/rollup-linux-x64-gnu": 4.19.1 + "@rollup/rollup-linux-x64-musl": 4.19.1 + "@rollup/rollup-win32-arm64-msvc": 4.19.1 + "@rollup/rollup-win32-ia32-msvc": 4.19.1 + "@rollup/rollup-win32-x64-msvc": 4.19.1 "@types/estree": 1.0.5 fsevents: ~2.3.2 dependenciesMeta: @@ -13494,7 +12920,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 54cde921e763017ce952ba76ec77d58dd9c01e3536c3be628d4af8c59d9b2f0e1e6a11b30fda44845c7b74098646cd972feb3bcd2f4a35d3293366f2eeb0a39e + checksum: b431700a5248563c0e1d03521b8262aad9adc46007159b2792569ff56e5b11cbaa555809b90765f291484dad726f2250270112943bcbd8a067608804d96fa3d5 languageName: node linkType: hard @@ -13514,6 +12940,7 @@ __metadata: eslint-plugin-jest: ^27.9.0 husky: ^8.0.3 lodash: ^4.17.21 + prettier: ^3.3.1 pretty-quick: ^3.3.1 tsc: ^2.0.4 tslib: ^2.6.3 @@ -13698,7 +13125,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": +"semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -13707,7 +13134,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -13884,6 +13311,13 @@ __metadata: languageName: node linkType: hard +"siginfo@npm:^2.0.0": + version: 2.0.0 + resolution: "siginfo@npm:2.0.0" + checksum: 8aa5a98640ca09fe00d74416eca97551b3e42991614a3d1b824b115fc1401543650914f651ab1311518177e4d297e80b953f4cd4cd7ea1eabe824e8f2091de01 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -13891,10 +13325,10 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^4.0.1": - version: 4.0.1 - resolution: "signal-exit@npm:4.0.1" - checksum: 832043367dca23e61ab6033e8b41c595fc805119bfe4fee63dea201cdc809a8b086bc54597bbbc1b2cde1a63c7dd554d1295ed2cca92db598233834a0b59b281 +"signal-exit@npm:^4.0.1, signal-exit@npm:^4.1.0": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 languageName: node linkType: hard @@ -14016,16 +13450,6 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:0.5.13": - version: 0.5.13 - resolution: "source-map-support@npm:0.5.13" - dependencies: - buffer-from: ^1.0.0 - source-map: ^0.6.0 - checksum: 933550047b6c1a2328599a21d8b7666507427c0f5ef5eaadd56b5da0fd9505e239053c66fe181bf1df469a3b7af9d775778eee283cbb7ae16b902ddc09e93a97 - languageName: node - linkType: hard - "source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" @@ -14036,7 +13460,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0": +"source-map@npm:^0.6.0, source-map@npm:~0.6.0": version: 0.6.1 resolution: "source-map@npm:0.6.1" checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2 @@ -14116,6 +13540,13 @@ __metadata: languageName: node linkType: hard +"stackback@npm:0.0.2": + version: 0.0.2 + resolution: "stackback@npm:0.0.2" + checksum: 2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99 + languageName: node + linkType: hard + "statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -14130,20 +13561,10 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.0.1": - version: 3.3.2 - resolution: "std-env@npm:3.3.2" - checksum: c02256bb041ba1870d23f8360bc7e47a9cf1fabcd02c8b7c4246d48f2c6bb47b4f45c70964348844e6d36521df84c4a9d09d468654b51e0eb5c600e3392b4570 - languageName: node - linkType: hard - -"string-length@npm:^4.0.1": - version: 4.0.2 - resolution: "string-length@npm:4.0.2" - dependencies: - char-regex: ^1.0.2 - strip-ansi: ^6.0.0 - checksum: ce85533ef5113fcb7e522bcf9e62cb33871aa99b3729cec5595f4447f660b0cefd542ca6df4150c97a677d58b0cb727a3fe09ac1de94071d05526c73579bf505 +"std-env@npm:^3.0.1, std-env@npm:^3.7.0": + version: 3.7.0 + resolution: "std-env@npm:3.7.0" + checksum: 4f489d13ff2ab838c9acd4ed6b786b51aa52ecacdfeaefe9275fcb220ff2ac80c6e95674723508fd29850a694569563a8caaaea738eb82ca16429b3a0b50e510 languageName: node linkType: hard @@ -14273,13 +13694,6 @@ __metadata: languageName: node linkType: hard -"strip-bom@npm:^4.0.0": - version: 4.0.0 - resolution: "strip-bom@npm:4.0.0" - checksum: 9dbcfbaf503c57c06af15fe2c8176fb1bf3af5ff65003851a102749f875a6dbe0ab3b30115eccf6e805e9d756830d3e40ec508b62b3f1ddf3761a20ebe29d3f3 - languageName: node - linkType: hard - "strip-final-newline@npm:^2.0.0": version: 2.0.0 resolution: "strip-final-newline@npm:2.0.0" @@ -14287,6 +13701,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-final-newline@npm:3.0.0" + checksum: 23ee263adfa2070cd0f23d1ac14e2ed2f000c9b44229aec9c799f1367ec001478469560abefd00c5c99ee6f0b31c137d53ec6029c53e9f32a93804e18c201050 + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -14453,17 +13874,6 @@ __metadata: languageName: node linkType: hard -"test-exclude@npm:^6.0.0": - version: 6.0.0 - resolution: "test-exclude@npm:6.0.0" - dependencies: - "@istanbuljs/schema": ^0.1.2 - glob: ^7.1.4 - minimatch: ^3.0.4 - checksum: 3b34a3d77165a2cb82b34014b3aba93b1c4637a5011807557dc2f3da826c59975a5ccad765721c4648b39817e3472789f9b0fa98fc854c5c1c7a1e632aacdc28 - languageName: node - linkType: hard - "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -14492,6 +13902,34 @@ __metadata: languageName: node linkType: hard +"tinybench@npm:^2.8.0": + version: 2.8.0 + resolution: "tinybench@npm:2.8.0" + checksum: 024a307c6a71f6e2903e110952457ee3dfa606093b45d7f49efcfd01d452650e099474080677ff650b0fd76b49074425ac68ff2a70561699a78515a278bf0862 + languageName: node + linkType: hard + +"tinypool@npm:^1.0.0": + version: 1.0.0 + resolution: "tinypool@npm:1.0.0" + checksum: 59dab87b0811da2dc1ecbac9a99cde93d45450744d4a9fca628d805c452bbb5e5f214fd191127f665d062cae9cc159225dea5508d766e40a0c6c33f573e5c3b6 + languageName: node + linkType: hard + +"tinyrainbow@npm:^1.2.0": + version: 1.2.0 + resolution: "tinyrainbow@npm:1.2.0" + checksum: d1e2cb5400032c0092be00e4a3da5450bea8b4fad58bfb5d3c58ca37ff5c5e252f7fcfb9af247914854af79c46014add9d1042fe044358c305a129ed55c8be35 + languageName: node + linkType: hard + +"tinyspy@npm:^3.0.0": + version: 3.0.0 + resolution: "tinyspy@npm:3.0.0" + checksum: b5b686acff2b88de60ff8ecf89a2042320406aaeee2fba1828a7ea8a925fad3ed9f5e4d7a068154a9134473c472aa03da8ca92ee994bc57a741c5ede5fa7de4d + languageName: node + linkType: hard + "tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" @@ -14501,13 +13939,6 @@ __metadata: languageName: node linkType: hard -"tmpl@npm:1.0.5": - version: 1.0.5 - resolution: "tmpl@npm:1.0.5" - checksum: cd922d9b853c00fe414c5a774817be65b058d54a2d01ebb415840960406c669a0fc632f66df885e24cb022ec812739199ccbdb8d1164c3e513f85bfca5ab2873 - languageName: node - linkType: hard - "to-fast-properties@npm:^2.0.0": version: 2.0.0 resolution: "to-fast-properties@npm:2.0.0" @@ -14581,42 +14012,6 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^29.1.4": - version: 29.1.4 - resolution: "ts-jest@npm:29.1.4" - dependencies: - bs-logger: 0.x - fast-json-stable-stringify: 2.x - jest-util: ^29.0.0 - json5: ^2.2.3 - lodash.memoize: 4.x - make-error: 1.x - semver: ^7.5.3 - yargs-parser: ^21.0.1 - peerDependencies: - "@babel/core": ">=7.0.0-beta.0 <8" - "@jest/transform": ^29.0.0 - "@jest/types": ^29.0.0 - babel-jest: ^29.0.0 - jest: ^29.0.0 - typescript: ">=4.3 <6" - peerDependenciesMeta: - "@babel/core": - optional: true - "@jest/transform": - optional: true - "@jest/types": - optional: true - babel-jest: - optional: true - esbuild: - optional: true - bin: - ts-jest: cli.js - checksum: e36cba389adbb3700b46422e883c8d25e76febcc01c4a39c801ef15e6edbd6da1695bdd144100153e992f98a754aea4099906955b1b9a83c3c72d77009c3d7e2 - languageName: node - linkType: hard - "tsc@npm:^2.0.4": version: 2.0.4 resolution: "tsc@npm:2.0.4" @@ -14626,6 +14021,20 @@ __metadata: languageName: node linkType: hard +"tsconfck@npm:^3.0.3": + version: 3.1.1 + resolution: "tsconfck@npm:3.1.1" + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + bin: + tsconfck: bin/tsconfck.js + checksum: 92941c76f5a996a96b5d92c88d20f67c644bb04cfeb9e5d4d2fed5a8ecce207fc70334a6257e3c146a117aa88b75adabc0989ee8d80a4935745f2774bf3f50fe + languageName: node + linkType: hard + "tsconfig-paths@npm:^3.15.0": version: 3.15.0 resolution: "tsconfig-paths@npm:3.15.0" @@ -14672,13 +14081,6 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": - version: 4.0.8 - resolution: "type-detect@npm:4.0.8" - checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 - languageName: node - linkType: hard - "type-fest@npm:^0.20.2": version: 0.20.2 resolution: "type-fest@npm:0.20.2" @@ -15072,17 +14474,6 @@ __metadata: languageName: node linkType: hard -"v8-to-istanbul@npm:^9.0.1": - version: 9.1.0 - resolution: "v8-to-istanbul@npm:9.1.0" - dependencies: - "@jridgewell/trace-mapping": ^0.3.12 - "@types/istanbul-lib-coverage": ^2.0.1 - convert-source-map: ^1.6.0 - checksum: 2069d59ee46cf8d83b4adfd8a5c1a90834caffa9f675e4360f1157ffc8578ef0f763c8f32d128334424159bb6b01f3876acd39cd13297b2769405a9da241f8d1 - languageName: node - linkType: hard - "validator@npm:13.9.0": version: 13.9.0 resolution: "validator@npm:13.9.0" @@ -15177,6 +14568,126 @@ __metadata: languageName: node linkType: hard +"vite-node@npm:2.0.5": + version: 2.0.5 + resolution: "vite-node@npm:2.0.5" + dependencies: + cac: ^6.7.14 + debug: ^4.3.5 + pathe: ^1.1.2 + tinyrainbow: ^1.2.0 + vite: ^5.0.0 + bin: + vite-node: vite-node.mjs + checksum: 30071f1cd3d3b78fd52726d66d18d81b63b321dee70d03c259db959a72f46dce2d71f12a85eaf503497f562ce11fea51197a74888d5892d3c7f3ad0ef093ec25 + languageName: node + linkType: hard + +"vite-tsconfig-paths@npm:^4.3.2": + version: 4.3.2 + resolution: "vite-tsconfig-paths@npm:4.3.2" + dependencies: + debug: ^4.1.1 + globrex: ^0.1.2 + tsconfck: ^3.0.3 + peerDependencies: + vite: "*" + peerDependenciesMeta: + vite: + optional: true + checksum: 7105ff641379f9f7055110f33067b236c8ee71b1390c0e6482412cdcc7a98c2e139c1c2a483d14fe9045d1977c14dc931e1ff302d6257ec919c70379db9d2419 + languageName: node + linkType: hard + +"vite@npm:^5.0.0": + version: 5.3.5 + resolution: "vite@npm:5.3.5" + dependencies: + esbuild: ^0.21.3 + fsevents: ~2.3.3 + postcss: ^8.4.39 + rollup: ^4.13.0 + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 5412700159e8906fc5ec5ac2cbcbee8a11180803b4a7c85494ae024a4f38d77eb5ab19b556a58745d6981361f8d2e181486f115f8abd4dc6ec3761fcd895e1b2 + languageName: node + linkType: hard + +"vitest@npm:^2.0.4": + version: 2.0.5 + resolution: "vitest@npm:2.0.5" + dependencies: + "@ampproject/remapping": ^2.3.0 + "@vitest/expect": 2.0.5 + "@vitest/pretty-format": ^2.0.5 + "@vitest/runner": 2.0.5 + "@vitest/snapshot": 2.0.5 + "@vitest/spy": 2.0.5 + "@vitest/utils": 2.0.5 + chai: ^5.1.1 + debug: ^4.3.5 + execa: ^8.0.1 + magic-string: ^0.30.10 + pathe: ^1.1.2 + std-env: ^3.7.0 + tinybench: ^2.8.0 + tinypool: ^1.0.0 + tinyrainbow: ^1.2.0 + vite: ^5.0.0 + vite-node: 2.0.5 + why-is-node-running: ^2.3.0 + peerDependencies: + "@edge-runtime/vm": "*" + "@types/node": ^18.0.0 || >=20.0.0 + "@vitest/browser": 2.0.5 + "@vitest/ui": 2.0.5 + happy-dom: "*" + jsdom: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@types/node": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + bin: + vitest: vitest.mjs + checksum: 4709e7678d89f957d9bd8e4dd2f99734857df03e22d38d9c3986a75f608205572b73c2faaf059ed41a2dccbc5c65f6717bf66594d6459cf2e57ab175be9aebc1 + languageName: node + linkType: hard + "vx@workspace:*, vx@workspace:vx": version: 0.0.0-use.local resolution: "vx@workspace:vx" @@ -15189,14 +14700,14 @@ __metadata: fs-extra: ^11.2.0 glob: ^10.3.10 inquirer: ^9.2.12 - jest: ^29.7.0 onchange: ^7.1.0 prettier: ^3.3.1 rollup: ^4.18.0 rollup-plugin-terser: ^7.0.2 rollup-plugin-ts: ^3.4.5 - ts-jest: ^29.1.4 vest-utils: 0.0.3 + vite-tsconfig-paths: ^4.3.2 + vitest: ^2.0.4 yargs: ^17.7.2 bin: vx: ./cli.js @@ -15212,15 +14723,6 @@ __metadata: languageName: node linkType: hard -"walker@npm:^1.0.8": - version: 1.0.8 - resolution: "walker@npm:1.0.8" - dependencies: - makeerror: 1.0.12 - checksum: ad7a257ea1e662e57ef2e018f97b3c02a7240ad5093c392186ce0bcf1f1a60bbadd520d073b9beb921ed99f64f065efb63dfc8eec689a80e569f93c1c5d5e16c - languageName: node - linkType: hard - "watchpack@npm:^2.4.0": version: 2.4.0 resolution: "watchpack@npm:2.4.0" @@ -15495,6 +14997,18 @@ __metadata: languageName: node linkType: hard +"why-is-node-running@npm:^2.3.0": + version: 2.3.0 + resolution: "why-is-node-running@npm:2.3.0" + dependencies: + siginfo: ^2.0.0 + stackback: 0.0.2 + bin: + why-is-node-running: cli.js + checksum: 58ebbf406e243ace97083027f0df7ff4c2108baf2595bb29317718ef207cc7a8104e41b711ff65d6fa354f25daa8756b67f2f04931a4fd6ba9d13ae8197496fb + languageName: node + linkType: hard + "wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -15572,16 +15086,6 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.2": - version: 4.0.2 - resolution: "write-file-atomic@npm:4.0.2" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 5da60bd4eeeb935eec97ead3df6e28e5917a6bd317478e4a85a5285e8480b8ed96032bbcc6ecd07b236142a24f3ca871c924ec4a6575e623ec1b11bf8c1c253c - languageName: node - linkType: hard - "ws@npm:^7.3.1": version: 7.5.9 resolution: "ws@npm:7.5.9" @@ -15658,14 +15162,14 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: ed2d96a616a9e3e1cc7d204c62ecc61f7aaab633dcbfab2c6df50f7f87b393993fe6640d017759fe112d0cb1e0119f2b4150a87305cc873fd90831c6a58ccf1c languageName: node linkType: hard -"yargs@npm:^17.3.1, yargs@npm:^17.7.2": +"yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: