From c9db43c36b48b732e8c7fd0cf986b05931541930 Mon Sep 17 00:00:00 2001 From: Evis Drenova Date: Sat, 11 Nov 2023 00:17:22 -0800 Subject: [PATCH 1/3] added jest tests --- jest.config.js | 4 + package-lock.json | 1982 ++++++++++++++++++++++++-- package.json | 6 +- src/lib/schedule.ts | 6 + src/test/cron.invalid.array.test.ts | 44 + src/test/cron.invalid.string.test.ts | 80 ++ src/test/cron.outputStrings.test.ts | 40 + src/test/cron.test.ts | 18 + src/test/cron.valid.array.test.ts | 24 + src/test/range.invalid.test.ts | 64 + src/test/range.valid.test.ts | 96 ++ src/test/schedule.invalid.test.ts | 31 + src/test/schedule.valid.test.ts | 91 ++ src/test/units.test.ts | 13 + src/test/utils.test.ts | 157 ++ 15 files changed, 2499 insertions(+), 157 deletions(-) create mode 100644 jest.config.js create mode 100644 src/test/cron.invalid.array.test.ts create mode 100644 src/test/cron.invalid.string.test.ts create mode 100644 src/test/cron.outputStrings.test.ts create mode 100644 src/test/cron.test.ts create mode 100644 src/test/cron.valid.array.test.ts create mode 100644 src/test/range.invalid.test.ts create mode 100644 src/test/range.valid.test.ts create mode 100644 src/test/schedule.invalid.test.ts create mode 100644 src/test/schedule.valid.test.ts create mode 100644 src/test/units.test.ts create mode 100644 src/test/utils.test.ts diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..4a5b465 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,4 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/package-lock.json b/package-lock.json index 3a5402a..57469c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "neocron", - "version": "0.2.0", + "version": "0.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "neocron", - "version": "0.2.0", + "version": "0.3.8", "dependencies": { "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.4", @@ -41,6 +41,7 @@ "@storybook/nextjs": "^7.4.2", "@storybook/react": "^7.4.2", "@storybook/testing-library": "^0.2.1", + "@types/jest": "^29.5.8", "@types/luxon": "^3.3.2", "@types/node": "20.6.0", "@types/react": "18.2.21", @@ -48,8 +49,10 @@ "babel-loader": "^9.1.3", "eslint": "8.49.0", "eslint-plugin-storybook": "^0.6.13", + "jest": "^29.7.0", "prettier": "^3.0.3", "storybook": "^7.4.2", + "ts-jest": "^29.1.1", "typescript": "5.2.2" }, "engines": { @@ -329,18 +332,6 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3278,6 +3269,275 @@ "node": ">=8" } }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/environment/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", + "dev": true, + "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" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -3290,6 +3550,50 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@jest/transform": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", @@ -3679,18 +3983,6 @@ } } }, - "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@pmmmwh/react-refresh-webpack-plugin/node_modules/loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", @@ -4566,6 +4858,24 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, "node_modules/@storybook/addon-actions": { "version": "7.4.2", "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-7.4.2.tgz", @@ -5781,18 +6091,6 @@ "integrity": "sha512-LKA7ZhY30I8PiUOzBzhtnIULQTACpiEpPXLiYMWyS+tPAORf+rmXUadHZXB/KFrFyMjeHeKc1GFvLd+3f7LE3w==", "dev": true }, - "node_modules/@storybook/nextjs/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@storybook/nextjs/node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", @@ -6582,11 +6880,53 @@ "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", - "dev": true + "node_modules/@types/jest": { + "version": "29.5.8", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.8.tgz", + "integrity": "sha512-fXEFTxMV2Co8ZF5aYFJv+YeA08RTYJfhtN5c9JSv/mFEMe+xxjufCb+PHL+bJcMs/ebPUsBu+UNTEz+ydXrR6g==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jest/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@types/jest/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@types/jest/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true }, "node_modules/@types/lodash": { "version": "4.14.198", @@ -6723,6 +7063,12 @@ "@types/node": "*" } }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true + }, "node_modules/@types/unist": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.8.tgz", @@ -7163,18 +7509,6 @@ "node": ">=8.9" } }, - "node_modules/adjust-sourcemap-loader/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/adjust-sourcemap-loader/node_modules/loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", @@ -7277,6 +7611,33 @@ "ajv": "^6.9.1" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-html-community": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", @@ -7532,6 +7893,27 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, "node_modules/babel-loader": { "version": "9.1.3", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.3.tgz", @@ -7737,6 +8119,21 @@ "node": ">=8" } }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/babel-plugin-named-exports-order": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/babel-plugin-named-exports-order/-/babel-plugin-named-exports-order-0.0.2.tgz", @@ -7802,6 +8199,45 @@ "react-docgen": "^5.0.0" } }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "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" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -8162,6 +8598,18 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -8368,6 +8816,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -8448,6 +8905,12 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, "node_modules/class-variance-authority": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz", @@ -8834,6 +9297,22 @@ } } }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -9176,6 +9655,27 @@ "sha.js": "^2.4.8" } }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -9540,6 +10040,15 @@ "node": ">=8" } }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -9576,6 +10085,15 @@ "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -9845,6 +10363,18 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -10334,6 +10864,31 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -11664,6 +12219,89 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -11893,9 +12531,18 @@ "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dev": true, "dependencies": { @@ -12246,6 +12893,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/istanbul-reports": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", @@ -12256,129 +12926,988 @@ "istanbul-lib-report": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.3.tgz", + "integrity": "sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jake": { + "version": "10.8.7", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", + "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/jest-circus/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "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" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-config/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-leak-detector/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-mock": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", + "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", + "dev": true, + "dependencies": { + "@jest/types": "^27.5.1", + "@types/node": "*" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-mock/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-mock/node_modules/@types/yargs": { + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", + "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "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" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jackspeak": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.3.tgz", - "integrity": "sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==", + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, "engines": { - "node": ">=14" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jake": { - "version": "10.8.7", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", - "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", + "node_modules/jest-snapshot/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "async": "^3.2.3", - "chalk": "^4.0.2", - "filelist": "^1.0.4", - "minimatch": "^3.1.2" - }, - "bin": { - "jake": "bin/cli.js" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-haste-map": { + "node_modules/jest-snapshot/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-util": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", "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" + "picomatch": "^2.2.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" } }, - "node_modules/jest-mock": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", - "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", - "@types/node": "*" + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-mock/node_modules/@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^16.0.0", - "chalk": "^4.0.0" - }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-mock/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "dependencies": { - "@types/yargs-parser": "*" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "node_modules/jest-validate/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-util": { + "node_modules/jest-validate/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/jest-watcher": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { + "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", + "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -12598,6 +14127,18 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -12754,6 +14295,12 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -12857,6 +14404,12 @@ "semver": "bin/semver.js" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -14486,6 +16039,22 @@ "async-limiter": "~1.0.0" } }, + "node_modules/pure-rand": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, "node_modules/qs": { "version": "6.11.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", @@ -15217,6 +16786,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -15248,18 +16838,6 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "node_modules/resolve-url-loader/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/resolve-url-loader/node_modules/loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", @@ -15283,6 +16861,15 @@ "node": ">=0.10.0" } }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -15785,6 +17372,27 @@ "node": ">=0.10.0" } }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/stackframe": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", @@ -15910,6 +17518,19 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -16611,6 +18232,58 @@ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, + "node_modules/ts-jest": { + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "dev": true, + "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" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/ts-pnp": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.2.0.tgz", @@ -16639,18 +18312,6 @@ "node": ">=10.13.0" } }, - "node_modules/tsconfig-paths-webpack-plugin/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/tsconfig-paths-webpack-plugin/node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", @@ -16731,6 +18392,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", diff --git a/package.json b/package.json index b5e6f8e..38355f0 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "prettier:check": "prettier --check .", - "prettier:write": "prettier --write ." + "prettier:write": "prettier --write .", + "test": "jest" }, "dependencies": { "@radix-ui/react-accordion": "^1.1.2", @@ -63,6 +64,7 @@ "@storybook/nextjs": "^7.4.2", "@storybook/react": "^7.4.2", "@storybook/testing-library": "^0.2.1", + "@types/jest": "^29.5.8", "@types/luxon": "^3.3.2", "@types/node": "20.6.0", "@types/react": "18.2.21", @@ -70,8 +72,10 @@ "babel-loader": "^9.1.3", "eslint": "8.49.0", "eslint-plugin-storybook": "^0.6.13", + "jest": "^29.7.0", "prettier": "^3.0.3", "storybook": "^7.4.2", + "ts-jest": "^29.1.1", "typescript": "5.2.2" } } diff --git a/src/lib/schedule.ts b/src/lib/schedule.ts index c4040c8..3d4767d 100644 --- a/src/lib/schedule.ts +++ b/src/lib/schedule.ts @@ -65,6 +65,12 @@ export class Schedule { this.date = findDate(this.arr, this.date, false); return this.date; } + + prev() { + this.pristine = false; + this.date = findDate(this.arr, this.date, true); + return this.date; + } } /** diff --git a/src/test/cron.invalid.array.test.ts b/src/test/cron.invalid.array.test.ts new file mode 100644 index 0000000..8633c4b --- /dev/null +++ b/src/test/cron.invalid.array.test.ts @@ -0,0 +1,44 @@ +import { arrayToString } from "../lib/part"; + +const invalidCron = [ + { + array: [], + error: "Invalid cron array", + }, + { + array: [[], [], [], [], []], + error: "Empty interval value for minute", + }, + { + array: [0, [], [], [], []] as number[][], + error: "Invalid cron array", + }, + { + array: [["a"], [1], [1], [1], [1]] as number[][], + error: 'Invalid value "a" for minute', + }, + { + array: [["12e5"], [1], [1], [1], [1]] as number[][], + error: 'Invalid value "12e5" for minute', + }, + { + array: [[0], [0], [0], [0], [0]], + error: 'Value "0" out of range for day', + }, + { + array: [[1.5], [1], [1], [1], [1]], + error: 'Invalid value "1.5" for minute', + }, + { + array: [[-2], [1], [1], [1], [1]], + error: 'Value "-2" out of range for minute', + }, +]; + +describe("Should throw on invalid cron array", function () { + invalidCron.forEach(function (invalid) { + test(invalid.array.toString(), function () { + expect(() => arrayToString(invalid.array)).toThrow(invalid.error); + }); + }); +}); diff --git a/src/test/cron.invalid.string.test.ts b/src/test/cron.invalid.string.test.ts new file mode 100644 index 0000000..3d605ba --- /dev/null +++ b/src/test/cron.invalid.string.test.ts @@ -0,0 +1,80 @@ +import { stringToArray } from "../lib/part"; + +const invalidCron = [ + { + string: undefined as any, + error: "Invalid cron expression", + }, + { + string: null as any, + error: "Invalid cron expression", + }, + { + string: NaN as any, + error: "Invalid cron expression", + }, + { + string: "", + error: "Invalid cron string format", + }, + { + string: "0", + error: "Invalid cron string format", + }, + { + string: "0 0 0 0 0", + error: 'Value "0" out of range for day', + }, + { + string: "0 0 0 1 0", + error: 'Value "0" out of range for day', + }, + { + string: "0 0 1 0 0", + error: 'Value "0" out of range for month', + }, + { + string: "/ / / / /", + error: 'Invalid value "/" for minute', + }, + { + string: "60 5 5 5 5", + error: 'Value "60" out of range for minute', + }, + { + string: "/5 5 5 5 5", + error: 'Invalid value "/5" for minute', + }, + { + string: "10-5/5 5 5 5 5", + error: 'Max range is less than min range in "10-5" for minute', + }, + { + string: "* * 0 * *", + error: 'Value "0" out of range for day', + }, + { + string: "* * * 0 *", + error: 'Value "0" out of range for month', + }, + { + string: "0/5/5 * * 0 *", + error: 'Invalid value "0/5/5" for minute', + }, + { + string: "5/a * * * *", + error: 'Invalid interval step value "a" for minute', + }, + { + string: "5/ * * * *", + error: 'Invalid interval step value "" for minute', + }, +]; + +describe("Should throw on invalid cron string", function () { + invalidCron.forEach(function (invalid) { + test(`${invalid.string}`, function () { + expect(() => stringToArray(invalid.string)).toThrow(invalid.error); + }); + }); +}); diff --git a/src/test/cron.outputStrings.test.ts b/src/test/cron.outputStrings.test.ts new file mode 100644 index 0000000..415b9b9 --- /dev/null +++ b/src/test/cron.outputStrings.test.ts @@ -0,0 +1,40 @@ +import { arrayToString, stringToArray } from "../lib/part"; + +describe("output strings", function () { + test("Should output weekdays as strings", function () { + const parts = stringToArray("* * * 1-3 1-5"); + expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( + "* * * 1-3 Mon-Fri" + ); + }); + test("Should not output weekdays in step", function () { + const parts = stringToArray("* * * 1-3 */2"); + expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( + "* * * 1-3 */2" + ); + }); + test("Should output month names as strings 1", function () { + const parts = stringToArray("* * * 1-3 1-5"); + expect(arrayToString(parts, { outputMonthNames: true })).toEqual( + "* * * Jan-Mar 1-5" + ); + }); + test("Should output month names as strings 2", function () { + const parts = stringToArray("* * * 5-10 1-5"); + expect(arrayToString(parts, { outputMonthNames: true })).toEqual( + "* * * May-Oct 1-5" + ); + }); + test("Should not output month names in step", function () { + const parts = stringToArray("* * * */2 1-5"); + expect(arrayToString(parts, { outputMonthNames: true })).toEqual( + "* * * */2 1-5" + ); + }); + test("Should output correct string when min and max range values are the same", function () { + const parts = stringToArray("* * * * 1-1"); + expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( + "* * * * Mon" + ); + }); +}); diff --git a/src/test/cron.test.ts b/src/test/cron.test.ts new file mode 100644 index 0000000..6461718 --- /dev/null +++ b/src/test/cron.test.ts @@ -0,0 +1,18 @@ +import { arrayToString, stringToArray } from "../lib/part"; +import { getSchedule } from "../lib/schedule"; + +describe("Should throw on undefined param", () => { + test("on arrayToString", () => { + expect(() => arrayToString(undefined as any)).toThrow("Invalid cron array"); + }); + + test("on stringToArray", () => { + expect(() => stringToArray(undefined as any)).toThrow( + "Invalid cron expression" + ); + }); + + test("on getSchedule", () => { + expect(() => getSchedule(undefined as any)).toThrow("Invalid cron array"); + }); +}); diff --git a/src/test/cron.valid.array.test.ts b/src/test/cron.valid.array.test.ts new file mode 100644 index 0000000..dc7506e --- /dev/null +++ b/src/test/cron.valid.array.test.ts @@ -0,0 +1,24 @@ +import { arrayToString } from "../lib/part"; + +const validCron = [ + { + in: [[0], [0], [1], [1], [0]], + out: "0 0 1 1 0", + }, + { + in: [[1, 2, 3], [1], [2, 3, 4], [5], [0, 1, 2, 3, 4, 5, 6]], + out: "1-3 1 2-4 5 *", + }, + { + in: [[0], [1], [1], [5], [0, 2, 4, 6]], + out: "0 1 1 5 */2", + }, +]; + +describe("Should parse valid cron array", function () { + validCron.forEach(function (valid) { + test(valid.in.toString(), function () { + expect(arrayToString(valid.in)).toEqual(valid.out); + }); + }); +}); diff --git a/src/test/range.invalid.test.ts b/src/test/range.invalid.test.ts new file mode 100644 index 0000000..53b31ee --- /dev/null +++ b/src/test/range.invalid.test.ts @@ -0,0 +1,64 @@ +import { stringToArrayPart } from "../lib/part"; +import { units } from "../lib/units"; + +const invalidRanges = [ + { + unit: units[0], + input: "", + error: 'Invalid value "" for minute', + }, + { + unit: units[1], + input: "33-1", + error: 'Max range is less than min range in "33-1" for hour', + }, + { + unit: units[1], + input: "1-2-3", + error: 'Invalid value "1-2-3" for hour', + }, + { + unit: units[2], + input: "5-35", + error: 'Value "35" out of range for day', + }, + { + unit: units[2], + input: "**", + error: 'Invalid value "**" for day', + }, + { + unit: units[3], + input: "0-", + error: 'Invalid value "0-" for month', + }, + { + unit: units[0], + input: "1a", + error: 'Invalid value "1a" for minute', + }, + { + unit: units[0], + input: "1a-2", + error: 'Invalid value "1a-2" for minute', + }, + { + unit: units[0], + input: "1-2b", + error: 'Invalid value "1-2b" for minute', + }, + { + unit: units[0], + input: "*/2b", + error: 'Invalid interval step value "2b" for minute', + }, +]; +describe("Should throw on invalid range string", function () { + invalidRanges.forEach(function (invalidRange) { + test(invalidRange.input, function () { + expect(() => + stringToArrayPart(invalidRange.input, invalidRange.unit) + ).toThrow(invalidRange.error); + }); + }); +}); diff --git a/src/test/range.valid.test.ts b/src/test/range.valid.test.ts new file mode 100644 index 0000000..8e9b3e2 --- /dev/null +++ b/src/test/range.valid.test.ts @@ -0,0 +1,96 @@ +import { arrayToStringPart, stringToArrayPart } from "../lib/part"; +import { units } from "../lib/units"; + +const validRanges = [ + { + unit: units[4], + input: "0-4", + arr: [0, 1, 2, 3, 4], + output: "0-4", + }, + { + unit: units[0], + input: "1,2,3", + arr: [1, 2, 3], + output: "1-3", + }, + { + unit: units[4], + input: "1,3,2,6,5,0,4", + arr: [0, 1, 2, 3, 4, 5, 6], + output: "*", + }, + { + unit: units[2], + input: "1,2,5-10", + arr: [1, 2, 5, 6, 7, 8, 9, 10], + output: "1-2,5-10", + }, + { + unit: units[4], + input: "*", + arr: [0, 1, 2, 3, 4, 5, 6], + output: "*", + }, + { + unit: units[2], + input: "5", + arr: [5], + output: "5", + }, + { + unit: units[1], + input: "1-10/5", + arr: [1, 6], + output: "1,6", + }, + { + unit: units[0], + input: "5-30/5", + arr: [5, 10, 15, 20, 25, 30], + output: "5-30/5", + }, + { + unit: units[0], + input: "5,10,15,20,25,30", + arr: [5, 10, 15, 20, 25, 30], + output: "5-30/5", + }, + { + unit: units[0], + input: "5-20,35-45/5", + arr: [ + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 40, 45, + ], + output: "5-20,35,40,45", + }, + { + unit: units[0], + input: "5,5,6,6,7,7", + arr: [5, 6, 7], + output: "5-7", + }, + { + unit: units[4], + input: "1-1", + arr: [1], + output: "1", + }, +]; +describe("Should parse valid string", function () { + validRanges.forEach(function (validRange) { + const range = stringToArrayPart(validRange.input, validRange.unit); + test(validRange.input + " as array", function () { + expect(range).toEqual(validRange.arr); + }); + test(validRange.input + " as string", function () { + expect( + arrayToStringPart(range, validRange.unit, { + outputHashes: false, + outputMonthNames: false, + outputWeekdayNames: false, + }) + ).toEqual(validRange.output); + }); + }); +}); diff --git a/src/test/schedule.invalid.test.ts b/src/test/schedule.invalid.test.ts new file mode 100644 index 0000000..2800a8d --- /dev/null +++ b/src/test/schedule.invalid.test.ts @@ -0,0 +1,31 @@ +import { stringToArray } from "../lib/part"; +import { getSchedule } from "../lib/schedule"; + +const schedules = [ + { + string: "* * 30 2 *", + error: "Unable to find execution time for schedule", + }, +]; +describe("Should throw", function () { + schedules.forEach(function (schedule) { + test("on invalid schedule " + schedule.string, function () { + const parts = stringToArray(schedule.string); + expect(() => getSchedule(parts).next()).toThrow(schedule.error); + }); + }); + + test("on invalid date", function () { + const parts = stringToArray("* * * * *"); + expect(() => getSchedule(parts, NaN as any)).toThrow( + "Invalid reference date provided" + ); + }); + + test("on invalid timezone", function () { + const parts = stringToArray("* * * * *"); + expect(() => getSchedule(parts, new Date(), "Invalid/Invalid")).toThrow( + "Invalid timezone provided" + ); + }); +}); diff --git a/src/test/schedule.valid.test.ts b/src/test/schedule.valid.test.ts new file mode 100644 index 0000000..8ce7b5f --- /dev/null +++ b/src/test/schedule.valid.test.ts @@ -0,0 +1,91 @@ +import { stringToArray } from "../lib/part"; +import { getSchedule } from "../lib/schedule"; + +const schedules = [ + { + schedule: "* * * * *", + now: "2013-02-08T09:32:00.000Z", + prev: "2013-02-08T04:31:00.000-05:00", + next: "2013-02-08T04:32:00.000-05:00", + timezone: "America/New_York", + }, + { + schedule: "* * * * *", + now: "2013-02-08T09:32:15.000+00:00", + prev: "2013-02-08T04:32:00.000-05:00", + next: "2013-02-08T04:33:00.000-05:00", + timezone: "America/New_York", + }, + { + schedule: "*/5 * * * *", + now: "2013-02-08T09:32:15.000Z", + prev: "2013-02-08T18:30:00.000+09:00", + next: "2013-02-08T18:35:00.000+09:00", + timezone: "Asia/Tokyo", + }, + { + schedule: "30 1 * * *", + now: "2013-02-08T19:32:15.000Z", + prev: "2013-02-09T01:30:00.000+09:00", + next: "2013-02-10T01:30:00.000+09:00", + timezone: "Asia/Tokyo", + }, + { + schedule: "30 1 1 * *", + now: "2013-02-08T09:32:00.000Z", + prev: "2013-02-01T01:30:00.000Z", + next: "2013-03-01T01:30:00.000Z", + timezone: "utc", + }, + { + schedule: "30 1 * 1 *", + now: "2013-02-08T09:32:00.000Z", + prev: "2013-01-31T01:30:00.000Z", + next: "2014-01-01T01:30:00.000Z", + timezone: "utc", + }, + { + schedule: "30 1 1 1 *", + now: "2013-02-08T09:32:00.000Z", + prev: "2013-01-01T01:30:00.000Z", + next: "2014-01-01T01:30:00.000Z", + timezone: "utc", + }, + { + schedule: "30 1 * * 5", + now: "2013-02-15T09:32:00.000Z", + prev: "2013-02-15T01:30:00.000Z", + next: "2013-02-22T01:30:00.000Z", + timezone: "utc", + }, + { + schedule: "* 6 * * 1-1", + now: "2013-02-15T09:32:15.000Z", + prev: "2013-02-11T06:59:00.000Z", + next: "2013-02-18T06:00:00.000Z", + timezone: "utc", + }, +]; +describe("Should output execution time for valid schedule", function () { + schedules.forEach(function (s) { + const parts = stringToArray(s.schedule); + const schedule = getSchedule(parts, s.now, s.timezone); + test(`should find next schedule for ${s.schedule} in ${s.timezone}`, function () { + expect(schedule.next().toJSON()).toEqual(s.next); + schedule.reset(); + }); + test(`should find prev schedule for ${s.schedule} in ${s.timezone}`, function () { + expect(schedule.prev().toJSON()).toEqual(s.prev); + }); + }); +}); + +describe("Should output execution time for valid schedule twice", function () { + const expression = "*/5 * * * *"; + const parts = stringToArray(expression); + const schedule = getSchedule(parts, "2013-02-08T09:32:15.000Z", "utc"); + test(`should find schedule for '${expression}'`, function () { + expect(schedule.next().toJSON()).toEqual("2013-02-08T09:35:00.000Z"); + expect(schedule.next().toJSON()).toEqual("2013-02-08T09:40:00.000Z"); + }); +}); diff --git a/src/test/units.test.ts b/src/test/units.test.ts new file mode 100644 index 0000000..cf6f91c --- /dev/null +++ b/src/test/units.test.ts @@ -0,0 +1,13 @@ +import { getUnits } from "../lib/units"; + +describe("getUnits", function () { + test("should returns units", function () { + expect(getUnits().map((unit) => unit.name)).toEqual([ + "minute", + "hour", + "day", + "month", + "weekday", + ]); + }); +}); diff --git a/src/test/utils.test.ts b/src/test/utils.test.ts new file mode 100644 index 0000000..d3bc7d1 --- /dev/null +++ b/src/test/utils.test.ts @@ -0,0 +1,157 @@ +import { dedup, flatten, parseNumber, range, sort } from "../lib/utils"; + +const dedupArrray = [ + { + input: [], + output: [], + }, + { + input: [0, 0, 0], + output: [0], + }, + { + input: [1, 1, 1, 2, 3, 4, 5, 6], + output: [1, 2, 3, 4, 5, 6], + }, + { + input: [500, -1, 33, -1, 0, 0, 1, 1, -1], + output: [500, -1, 33, 0, 1], + }, +]; +describe("Should de-dup arrays", function () { + dedupArrray.forEach(function (array) { + test(`[${array.input}]`, function () { + expect(dedup(array.input)).toEqual(array.output); + }); + }); +}); + +const flattenArrays = [ + { + input: [], + flattened: [], + }, + { + input: [[1], [2]], + flattened: [1, 2], + }, + { + input: [ + [1, 5], + [2, 6], + ], + flattened: [1, 5, 2, 6], + }, +]; +describe("Should flatten arrays", function () { + flattenArrays.forEach(function (array) { + test(`[${array.input}]`, function () { + expect(flatten(array.input)).toEqual(array.flattened); + }); + }); +}); + +describe("parseNumber", function () { + [ + { input: 0.0, output: 0 }, + { input: 0, output: 0 }, + { input: "0", output: 0 }, + { input: 123, output: 123 }, + { input: "123", output: 123 }, + { input: " 123 ", output: 123 }, + { input: "0123 ", output: 123 }, + { input: " 000123 ", output: 123 }, + ].forEach(({ input, output }) => { + test(`should parse '${input}'`, function () { + expect(parseNumber(input)).toEqual(output); + }); + }); + [ + "", + " ", + "+123", + "-123", + "1.2", + "1,2", + "12e5", + "12e-5", + "0xAB", + "foo", + " f00 ", + "Infinity", + "+Infinity", + "-Infinity", + null, + undefined, + true, + false, + 10.1, + 0.1, + Infinity, + NaN, + {}, + ].forEach((input) => { + test(`should not parse '${input}'`, function () { + expect(parseNumber(input)).toEqual(undefined); + }); + }); +}); + +const ranges = [ + { + start: 5, + end: 3, + output: [], + }, + { + start: 0, + end: 0, + output: [0], + }, + { + start: 3, + end: 5, + output: [3, 4, 5], + }, +]; +describe("Should create range arrays", function () { + ranges.forEach(function (r) { + test(`${r.start} to ${r.end}`, function () { + expect(range(r.start, r.end)).toEqual(r.output); + }); + }); +}); + +const sortArrays = [ + { + input: [], + sorted: [], + }, + { + input: [0, 1], + sorted: [0, 1], + }, + { + input: [1, 0], + sorted: [0, 1], + }, + { + input: [1, 0, 1], + sorted: [0, 1, 1], + }, + { + input: [5, 4, 3, 2, 1], + sorted: [1, 2, 3, 4, 5], + }, + { + input: [42, 9, 17, 54, 602, -3, 54, 999, -11], + sorted: [-11, -3, 9, 17, 42, 54, 54, 602, 999], + }, +]; +describe("Should sort arrays", function () { + sortArrays.forEach(function (array) { + test(`[${array.input}]`, function () { + expect(sort(array.input)).toEqual(array.sorted); + }); + }); +}); From 89822bc175d393516deecc64a5dee72b7f9fe53b Mon Sep 17 00:00:00 2001 From: Evis Drenova Date: Sat, 11 Nov 2023 00:18:17 -0800 Subject: [PATCH 2/3] styling and bump --- package.json | 2 +- src/globals.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 38355f0..90000a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neocron", - "version": "0.3.8", + "version": "0.3.9", "private": false, "main": "dist/src/Neocron.js", "export": "dist/src/Neocron.js", diff --git a/src/globals.css b/src/globals.css index 16aaf0b..ac5f049 100644 --- a/src/globals.css +++ b/src/globals.css @@ -39,7 +39,7 @@ } .success-alert { - @apply bg-green-100 border border-green-500; + @apply bg-green-100 border border-green-500 shadow-sm; } .commanditem { From 1a3cd8f344974b5fd0573a8903f74cac306d1936 Mon Sep 17 00:00:00 2001 From: Evis Drenova Date: Sat, 11 Nov 2023 00:20:38 -0800 Subject: [PATCH 3/3] prettier --- src/test/cron.invalid.array.test.ts | 14 ++-- src/test/cron.invalid.string.test.ts | 42 +++++------ src/test/cron.outputStrings.test.ts | 40 +++++----- src/test/cron.test.ts | 18 ++--- src/test/cron.valid.array.test.ts | 10 +-- src/test/range.invalid.test.ts | 26 +++---- src/test/range.valid.test.ts | 58 +++++++-------- src/test/schedule.invalid.test.ts | 26 +++---- src/test/schedule.valid.test.ts | 106 +++++++++++++-------------- src/test/units.test.ts | 16 ++-- src/test/utils.test.ts | 50 ++++++------- 11 files changed, 203 insertions(+), 203 deletions(-) diff --git a/src/test/cron.invalid.array.test.ts b/src/test/cron.invalid.array.test.ts index 8633c4b..a838ef2 100644 --- a/src/test/cron.invalid.array.test.ts +++ b/src/test/cron.invalid.array.test.ts @@ -1,24 +1,24 @@ -import { arrayToString } from "../lib/part"; +import { arrayToString } from '../lib/part'; const invalidCron = [ { array: [], - error: "Invalid cron array", + error: 'Invalid cron array', }, { array: [[], [], [], [], []], - error: "Empty interval value for minute", + error: 'Empty interval value for minute', }, { array: [0, [], [], [], []] as number[][], - error: "Invalid cron array", + error: 'Invalid cron array', }, { - array: [["a"], [1], [1], [1], [1]] as number[][], + array: [['a'], [1], [1], [1], [1]] as number[][], error: 'Invalid value "a" for minute', }, { - array: [["12e5"], [1], [1], [1], [1]] as number[][], + array: [['12e5'], [1], [1], [1], [1]] as number[][], error: 'Invalid value "12e5" for minute', }, { @@ -35,7 +35,7 @@ const invalidCron = [ }, ]; -describe("Should throw on invalid cron array", function () { +describe('Should throw on invalid cron array', function () { invalidCron.forEach(function (invalid) { test(invalid.array.toString(), function () { expect(() => arrayToString(invalid.array)).toThrow(invalid.error); diff --git a/src/test/cron.invalid.string.test.ts b/src/test/cron.invalid.string.test.ts index 3d605ba..885a90e 100644 --- a/src/test/cron.invalid.string.test.ts +++ b/src/test/cron.invalid.string.test.ts @@ -1,77 +1,77 @@ -import { stringToArray } from "../lib/part"; +import { stringToArray } from '../lib/part'; const invalidCron = [ { string: undefined as any, - error: "Invalid cron expression", + error: 'Invalid cron expression', }, { string: null as any, - error: "Invalid cron expression", + error: 'Invalid cron expression', }, { string: NaN as any, - error: "Invalid cron expression", + error: 'Invalid cron expression', }, { - string: "", - error: "Invalid cron string format", + string: '', + error: 'Invalid cron string format', }, { - string: "0", - error: "Invalid cron string format", + string: '0', + error: 'Invalid cron string format', }, { - string: "0 0 0 0 0", + string: '0 0 0 0 0', error: 'Value "0" out of range for day', }, { - string: "0 0 0 1 0", + string: '0 0 0 1 0', error: 'Value "0" out of range for day', }, { - string: "0 0 1 0 0", + string: '0 0 1 0 0', error: 'Value "0" out of range for month', }, { - string: "/ / / / /", + string: '/ / / / /', error: 'Invalid value "/" for minute', }, { - string: "60 5 5 5 5", + string: '60 5 5 5 5', error: 'Value "60" out of range for minute', }, { - string: "/5 5 5 5 5", + string: '/5 5 5 5 5', error: 'Invalid value "/5" for minute', }, { - string: "10-5/5 5 5 5 5", + string: '10-5/5 5 5 5 5', error: 'Max range is less than min range in "10-5" for minute', }, { - string: "* * 0 * *", + string: '* * 0 * *', error: 'Value "0" out of range for day', }, { - string: "* * * 0 *", + string: '* * * 0 *', error: 'Value "0" out of range for month', }, { - string: "0/5/5 * * 0 *", + string: '0/5/5 * * 0 *', error: 'Invalid value "0/5/5" for minute', }, { - string: "5/a * * * *", + string: '5/a * * * *', error: 'Invalid interval step value "a" for minute', }, { - string: "5/ * * * *", + string: '5/ * * * *', error: 'Invalid interval step value "" for minute', }, ]; -describe("Should throw on invalid cron string", function () { +describe('Should throw on invalid cron string', function () { invalidCron.forEach(function (invalid) { test(`${invalid.string}`, function () { expect(() => stringToArray(invalid.string)).toThrow(invalid.error); diff --git a/src/test/cron.outputStrings.test.ts b/src/test/cron.outputStrings.test.ts index 415b9b9..32c4749 100644 --- a/src/test/cron.outputStrings.test.ts +++ b/src/test/cron.outputStrings.test.ts @@ -1,40 +1,40 @@ -import { arrayToString, stringToArray } from "../lib/part"; +import { arrayToString, stringToArray } from '../lib/part'; -describe("output strings", function () { - test("Should output weekdays as strings", function () { - const parts = stringToArray("* * * 1-3 1-5"); +describe('output strings', function () { + test('Should output weekdays as strings', function () { + const parts = stringToArray('* * * 1-3 1-5'); expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( - "* * * 1-3 Mon-Fri" + '* * * 1-3 Mon-Fri' ); }); - test("Should not output weekdays in step", function () { - const parts = stringToArray("* * * 1-3 */2"); + test('Should not output weekdays in step', function () { + const parts = stringToArray('* * * 1-3 */2'); expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( - "* * * 1-3 */2" + '* * * 1-3 */2' ); }); - test("Should output month names as strings 1", function () { - const parts = stringToArray("* * * 1-3 1-5"); + test('Should output month names as strings 1', function () { + const parts = stringToArray('* * * 1-3 1-5'); expect(arrayToString(parts, { outputMonthNames: true })).toEqual( - "* * * Jan-Mar 1-5" + '* * * Jan-Mar 1-5' ); }); - test("Should output month names as strings 2", function () { - const parts = stringToArray("* * * 5-10 1-5"); + test('Should output month names as strings 2', function () { + const parts = stringToArray('* * * 5-10 1-5'); expect(arrayToString(parts, { outputMonthNames: true })).toEqual( - "* * * May-Oct 1-5" + '* * * May-Oct 1-5' ); }); - test("Should not output month names in step", function () { - const parts = stringToArray("* * * */2 1-5"); + test('Should not output month names in step', function () { + const parts = stringToArray('* * * */2 1-5'); expect(arrayToString(parts, { outputMonthNames: true })).toEqual( - "* * * */2 1-5" + '* * * */2 1-5' ); }); - test("Should output correct string when min and max range values are the same", function () { - const parts = stringToArray("* * * * 1-1"); + test('Should output correct string when min and max range values are the same', function () { + const parts = stringToArray('* * * * 1-1'); expect(arrayToString(parts, { outputWeekdayNames: true })).toEqual( - "* * * * Mon" + '* * * * Mon' ); }); }); diff --git a/src/test/cron.test.ts b/src/test/cron.test.ts index 6461718..85d2c2d 100644 --- a/src/test/cron.test.ts +++ b/src/test/cron.test.ts @@ -1,18 +1,18 @@ -import { arrayToString, stringToArray } from "../lib/part"; -import { getSchedule } from "../lib/schedule"; +import { arrayToString, stringToArray } from '../lib/part'; +import { getSchedule } from '../lib/schedule'; -describe("Should throw on undefined param", () => { - test("on arrayToString", () => { - expect(() => arrayToString(undefined as any)).toThrow("Invalid cron array"); +describe('Should throw on undefined param', () => { + test('on arrayToString', () => { + expect(() => arrayToString(undefined as any)).toThrow('Invalid cron array'); }); - test("on stringToArray", () => { + test('on stringToArray', () => { expect(() => stringToArray(undefined as any)).toThrow( - "Invalid cron expression" + 'Invalid cron expression' ); }); - test("on getSchedule", () => { - expect(() => getSchedule(undefined as any)).toThrow("Invalid cron array"); + test('on getSchedule', () => { + expect(() => getSchedule(undefined as any)).toThrow('Invalid cron array'); }); }); diff --git a/src/test/cron.valid.array.test.ts b/src/test/cron.valid.array.test.ts index dc7506e..a9ef4e6 100644 --- a/src/test/cron.valid.array.test.ts +++ b/src/test/cron.valid.array.test.ts @@ -1,21 +1,21 @@ -import { arrayToString } from "../lib/part"; +import { arrayToString } from '../lib/part'; const validCron = [ { in: [[0], [0], [1], [1], [0]], - out: "0 0 1 1 0", + out: '0 0 1 1 0', }, { in: [[1, 2, 3], [1], [2, 3, 4], [5], [0, 1, 2, 3, 4, 5, 6]], - out: "1-3 1 2-4 5 *", + out: '1-3 1 2-4 5 *', }, { in: [[0], [1], [1], [5], [0, 2, 4, 6]], - out: "0 1 1 5 */2", + out: '0 1 1 5 */2', }, ]; -describe("Should parse valid cron array", function () { +describe('Should parse valid cron array', function () { validCron.forEach(function (valid) { test(valid.in.toString(), function () { expect(arrayToString(valid.in)).toEqual(valid.out); diff --git a/src/test/range.invalid.test.ts b/src/test/range.invalid.test.ts index 53b31ee..c97828f 100644 --- a/src/test/range.invalid.test.ts +++ b/src/test/range.invalid.test.ts @@ -1,59 +1,59 @@ -import { stringToArrayPart } from "../lib/part"; -import { units } from "../lib/units"; +import { stringToArrayPart } from '../lib/part'; +import { units } from '../lib/units'; const invalidRanges = [ { unit: units[0], - input: "", + input: '', error: 'Invalid value "" for minute', }, { unit: units[1], - input: "33-1", + input: '33-1', error: 'Max range is less than min range in "33-1" for hour', }, { unit: units[1], - input: "1-2-3", + input: '1-2-3', error: 'Invalid value "1-2-3" for hour', }, { unit: units[2], - input: "5-35", + input: '5-35', error: 'Value "35" out of range for day', }, { unit: units[2], - input: "**", + input: '**', error: 'Invalid value "**" for day', }, { unit: units[3], - input: "0-", + input: '0-', error: 'Invalid value "0-" for month', }, { unit: units[0], - input: "1a", + input: '1a', error: 'Invalid value "1a" for minute', }, { unit: units[0], - input: "1a-2", + input: '1a-2', error: 'Invalid value "1a-2" for minute', }, { unit: units[0], - input: "1-2b", + input: '1-2b', error: 'Invalid value "1-2b" for minute', }, { unit: units[0], - input: "*/2b", + input: '*/2b', error: 'Invalid interval step value "2b" for minute', }, ]; -describe("Should throw on invalid range string", function () { +describe('Should throw on invalid range string', function () { invalidRanges.forEach(function (invalidRange) { test(invalidRange.input, function () { expect(() => diff --git a/src/test/range.valid.test.ts b/src/test/range.valid.test.ts index 8e9b3e2..a6e7967 100644 --- a/src/test/range.valid.test.ts +++ b/src/test/range.valid.test.ts @@ -1,89 +1,89 @@ -import { arrayToStringPart, stringToArrayPart } from "../lib/part"; -import { units } from "../lib/units"; +import { arrayToStringPart, stringToArrayPart } from '../lib/part'; +import { units } from '../lib/units'; const validRanges = [ { unit: units[4], - input: "0-4", + input: '0-4', arr: [0, 1, 2, 3, 4], - output: "0-4", + output: '0-4', }, { unit: units[0], - input: "1,2,3", + input: '1,2,3', arr: [1, 2, 3], - output: "1-3", + output: '1-3', }, { unit: units[4], - input: "1,3,2,6,5,0,4", + input: '1,3,2,6,5,0,4', arr: [0, 1, 2, 3, 4, 5, 6], - output: "*", + output: '*', }, { unit: units[2], - input: "1,2,5-10", + input: '1,2,5-10', arr: [1, 2, 5, 6, 7, 8, 9, 10], - output: "1-2,5-10", + output: '1-2,5-10', }, { unit: units[4], - input: "*", + input: '*', arr: [0, 1, 2, 3, 4, 5, 6], - output: "*", + output: '*', }, { unit: units[2], - input: "5", + input: '5', arr: [5], - output: "5", + output: '5', }, { unit: units[1], - input: "1-10/5", + input: '1-10/5', arr: [1, 6], - output: "1,6", + output: '1,6', }, { unit: units[0], - input: "5-30/5", + input: '5-30/5', arr: [5, 10, 15, 20, 25, 30], - output: "5-30/5", + output: '5-30/5', }, { unit: units[0], - input: "5,10,15,20,25,30", + input: '5,10,15,20,25,30', arr: [5, 10, 15, 20, 25, 30], - output: "5-30/5", + output: '5-30/5', }, { unit: units[0], - input: "5-20,35-45/5", + input: '5-20,35-45/5', arr: [ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 40, 45, ], - output: "5-20,35,40,45", + output: '5-20,35,40,45', }, { unit: units[0], - input: "5,5,6,6,7,7", + input: '5,5,6,6,7,7', arr: [5, 6, 7], - output: "5-7", + output: '5-7', }, { unit: units[4], - input: "1-1", + input: '1-1', arr: [1], - output: "1", + output: '1', }, ]; -describe("Should parse valid string", function () { +describe('Should parse valid string', function () { validRanges.forEach(function (validRange) { const range = stringToArrayPart(validRange.input, validRange.unit); - test(validRange.input + " as array", function () { + test(validRange.input + ' as array', function () { expect(range).toEqual(validRange.arr); }); - test(validRange.input + " as string", function () { + test(validRange.input + ' as string', function () { expect( arrayToStringPart(range, validRange.unit, { outputHashes: false, diff --git a/src/test/schedule.invalid.test.ts b/src/test/schedule.invalid.test.ts index 2800a8d..3630151 100644 --- a/src/test/schedule.invalid.test.ts +++ b/src/test/schedule.invalid.test.ts @@ -1,31 +1,31 @@ -import { stringToArray } from "../lib/part"; -import { getSchedule } from "../lib/schedule"; +import { stringToArray } from '../lib/part'; +import { getSchedule } from '../lib/schedule'; const schedules = [ { - string: "* * 30 2 *", - error: "Unable to find execution time for schedule", + string: '* * 30 2 *', + error: 'Unable to find execution time for schedule', }, ]; -describe("Should throw", function () { +describe('Should throw', function () { schedules.forEach(function (schedule) { - test("on invalid schedule " + schedule.string, function () { + test('on invalid schedule ' + schedule.string, function () { const parts = stringToArray(schedule.string); expect(() => getSchedule(parts).next()).toThrow(schedule.error); }); }); - test("on invalid date", function () { - const parts = stringToArray("* * * * *"); + test('on invalid date', function () { + const parts = stringToArray('* * * * *'); expect(() => getSchedule(parts, NaN as any)).toThrow( - "Invalid reference date provided" + 'Invalid reference date provided' ); }); - test("on invalid timezone", function () { - const parts = stringToArray("* * * * *"); - expect(() => getSchedule(parts, new Date(), "Invalid/Invalid")).toThrow( - "Invalid timezone provided" + test('on invalid timezone', function () { + const parts = stringToArray('* * * * *'); + expect(() => getSchedule(parts, new Date(), 'Invalid/Invalid')).toThrow( + 'Invalid timezone provided' ); }); }); diff --git a/src/test/schedule.valid.test.ts b/src/test/schedule.valid.test.ts index 8ce7b5f..57a87c7 100644 --- a/src/test/schedule.valid.test.ts +++ b/src/test/schedule.valid.test.ts @@ -1,72 +1,72 @@ -import { stringToArray } from "../lib/part"; -import { getSchedule } from "../lib/schedule"; +import { stringToArray } from '../lib/part'; +import { getSchedule } from '../lib/schedule'; const schedules = [ { - schedule: "* * * * *", - now: "2013-02-08T09:32:00.000Z", - prev: "2013-02-08T04:31:00.000-05:00", - next: "2013-02-08T04:32:00.000-05:00", - timezone: "America/New_York", + schedule: '* * * * *', + now: '2013-02-08T09:32:00.000Z', + prev: '2013-02-08T04:31:00.000-05:00', + next: '2013-02-08T04:32:00.000-05:00', + timezone: 'America/New_York', }, { - schedule: "* * * * *", - now: "2013-02-08T09:32:15.000+00:00", - prev: "2013-02-08T04:32:00.000-05:00", - next: "2013-02-08T04:33:00.000-05:00", - timezone: "America/New_York", + schedule: '* * * * *', + now: '2013-02-08T09:32:15.000+00:00', + prev: '2013-02-08T04:32:00.000-05:00', + next: '2013-02-08T04:33:00.000-05:00', + timezone: 'America/New_York', }, { - schedule: "*/5 * * * *", - now: "2013-02-08T09:32:15.000Z", - prev: "2013-02-08T18:30:00.000+09:00", - next: "2013-02-08T18:35:00.000+09:00", - timezone: "Asia/Tokyo", + schedule: '*/5 * * * *', + now: '2013-02-08T09:32:15.000Z', + prev: '2013-02-08T18:30:00.000+09:00', + next: '2013-02-08T18:35:00.000+09:00', + timezone: 'Asia/Tokyo', }, { - schedule: "30 1 * * *", - now: "2013-02-08T19:32:15.000Z", - prev: "2013-02-09T01:30:00.000+09:00", - next: "2013-02-10T01:30:00.000+09:00", - timezone: "Asia/Tokyo", + schedule: '30 1 * * *', + now: '2013-02-08T19:32:15.000Z', + prev: '2013-02-09T01:30:00.000+09:00', + next: '2013-02-10T01:30:00.000+09:00', + timezone: 'Asia/Tokyo', }, { - schedule: "30 1 1 * *", - now: "2013-02-08T09:32:00.000Z", - prev: "2013-02-01T01:30:00.000Z", - next: "2013-03-01T01:30:00.000Z", - timezone: "utc", + schedule: '30 1 1 * *', + now: '2013-02-08T09:32:00.000Z', + prev: '2013-02-01T01:30:00.000Z', + next: '2013-03-01T01:30:00.000Z', + timezone: 'utc', }, { - schedule: "30 1 * 1 *", - now: "2013-02-08T09:32:00.000Z", - prev: "2013-01-31T01:30:00.000Z", - next: "2014-01-01T01:30:00.000Z", - timezone: "utc", + schedule: '30 1 * 1 *', + now: '2013-02-08T09:32:00.000Z', + prev: '2013-01-31T01:30:00.000Z', + next: '2014-01-01T01:30:00.000Z', + timezone: 'utc', }, { - schedule: "30 1 1 1 *", - now: "2013-02-08T09:32:00.000Z", - prev: "2013-01-01T01:30:00.000Z", - next: "2014-01-01T01:30:00.000Z", - timezone: "utc", + schedule: '30 1 1 1 *', + now: '2013-02-08T09:32:00.000Z', + prev: '2013-01-01T01:30:00.000Z', + next: '2014-01-01T01:30:00.000Z', + timezone: 'utc', }, { - schedule: "30 1 * * 5", - now: "2013-02-15T09:32:00.000Z", - prev: "2013-02-15T01:30:00.000Z", - next: "2013-02-22T01:30:00.000Z", - timezone: "utc", + schedule: '30 1 * * 5', + now: '2013-02-15T09:32:00.000Z', + prev: '2013-02-15T01:30:00.000Z', + next: '2013-02-22T01:30:00.000Z', + timezone: 'utc', }, { - schedule: "* 6 * * 1-1", - now: "2013-02-15T09:32:15.000Z", - prev: "2013-02-11T06:59:00.000Z", - next: "2013-02-18T06:00:00.000Z", - timezone: "utc", + schedule: '* 6 * * 1-1', + now: '2013-02-15T09:32:15.000Z', + prev: '2013-02-11T06:59:00.000Z', + next: '2013-02-18T06:00:00.000Z', + timezone: 'utc', }, ]; -describe("Should output execution time for valid schedule", function () { +describe('Should output execution time for valid schedule', function () { schedules.forEach(function (s) { const parts = stringToArray(s.schedule); const schedule = getSchedule(parts, s.now, s.timezone); @@ -80,12 +80,12 @@ describe("Should output execution time for valid schedule", function () { }); }); -describe("Should output execution time for valid schedule twice", function () { - const expression = "*/5 * * * *"; +describe('Should output execution time for valid schedule twice', function () { + const expression = '*/5 * * * *'; const parts = stringToArray(expression); - const schedule = getSchedule(parts, "2013-02-08T09:32:15.000Z", "utc"); + const schedule = getSchedule(parts, '2013-02-08T09:32:15.000Z', 'utc'); test(`should find schedule for '${expression}'`, function () { - expect(schedule.next().toJSON()).toEqual("2013-02-08T09:35:00.000Z"); - expect(schedule.next().toJSON()).toEqual("2013-02-08T09:40:00.000Z"); + expect(schedule.next().toJSON()).toEqual('2013-02-08T09:35:00.000Z'); + expect(schedule.next().toJSON()).toEqual('2013-02-08T09:40:00.000Z'); }); }); diff --git a/src/test/units.test.ts b/src/test/units.test.ts index cf6f91c..6210480 100644 --- a/src/test/units.test.ts +++ b/src/test/units.test.ts @@ -1,13 +1,13 @@ -import { getUnits } from "../lib/units"; +import { getUnits } from '../lib/units'; -describe("getUnits", function () { - test("should returns units", function () { +describe('getUnits', function () { + test('should returns units', function () { expect(getUnits().map((unit) => unit.name)).toEqual([ - "minute", - "hour", - "day", - "month", - "weekday", + 'minute', + 'hour', + 'day', + 'month', + 'weekday', ]); }); }); diff --git a/src/test/utils.test.ts b/src/test/utils.test.ts index d3bc7d1..667a5f2 100644 --- a/src/test/utils.test.ts +++ b/src/test/utils.test.ts @@ -1,4 +1,4 @@ -import { dedup, flatten, parseNumber, range, sort } from "../lib/utils"; +import { dedup, flatten, parseNumber, range, sort } from '../lib/utils'; const dedupArrray = [ { @@ -18,7 +18,7 @@ const dedupArrray = [ output: [500, -1, 33, 0, 1], }, ]; -describe("Should de-dup arrays", function () { +describe('Should de-dup arrays', function () { dedupArrray.forEach(function (array) { test(`[${array.input}]`, function () { expect(dedup(array.input)).toEqual(array.output); @@ -43,7 +43,7 @@ const flattenArrays = [ flattened: [1, 5, 2, 6], }, ]; -describe("Should flatten arrays", function () { +describe('Should flatten arrays', function () { flattenArrays.forEach(function (array) { test(`[${array.input}]`, function () { expect(flatten(array.input)).toEqual(array.flattened); @@ -51,36 +51,36 @@ describe("Should flatten arrays", function () { }); }); -describe("parseNumber", function () { +describe('parseNumber', function () { [ { input: 0.0, output: 0 }, { input: 0, output: 0 }, - { input: "0", output: 0 }, + { input: '0', output: 0 }, { input: 123, output: 123 }, - { input: "123", output: 123 }, - { input: " 123 ", output: 123 }, - { input: "0123 ", output: 123 }, - { input: " 000123 ", output: 123 }, + { input: '123', output: 123 }, + { input: ' 123 ', output: 123 }, + { input: '0123 ', output: 123 }, + { input: ' 000123 ', output: 123 }, ].forEach(({ input, output }) => { test(`should parse '${input}'`, function () { expect(parseNumber(input)).toEqual(output); }); }); [ - "", - " ", - "+123", - "-123", - "1.2", - "1,2", - "12e5", - "12e-5", - "0xAB", - "foo", - " f00 ", - "Infinity", - "+Infinity", - "-Infinity", + '', + ' ', + '+123', + '-123', + '1.2', + '1,2', + '12e5', + '12e-5', + '0xAB', + 'foo', + ' f00 ', + 'Infinity', + '+Infinity', + '-Infinity', null, undefined, true, @@ -114,7 +114,7 @@ const ranges = [ output: [3, 4, 5], }, ]; -describe("Should create range arrays", function () { +describe('Should create range arrays', function () { ranges.forEach(function (r) { test(`${r.start} to ${r.end}`, function () { expect(range(r.start, r.end)).toEqual(r.output); @@ -148,7 +148,7 @@ const sortArrays = [ sorted: [-11, -3, 9, 17, 42, 54, 54, 602, 999], }, ]; -describe("Should sort arrays", function () { +describe('Should sort arrays', function () { sortArrays.forEach(function (array) { test(`[${array.input}]`, function () { expect(sort(array.input)).toEqual(array.sorted);