diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cfe62728..2b0851f9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -2,7 +2,7 @@ on: pull_request jobs: release: - name: Validation + name: Create PR build runs-on: ubuntu-latest if: contains(github.event.pull_request.labels.*.name, 'build') steps: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..745a6017 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,16 @@ +on: + pull_request: + paths: + - 'language/**' + +jobs: + release: + name: Test runner + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - run: npm install + - run: node ./node_modules/eslint/bin/eslint src/** --no-error-on-unmatched-pattern + - run: npm run test \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 80b622b0..5328ffcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,29 +1,28 @@ { "name": "vscode-rpgle", - "version": "0.24.0", + "version": "0.26.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-rpgle", - "version": "0.24.0", + "version": "0.26.2", "hasInstallScript": true, "license": "MIT", "devDependencies": { "@halcyontech/vscode-ibmi-types": "^2.1.0", - "@types/mocha": "^9.1.0", - "@types/node": "^16.11.7", + "@types/node": "^18.16.1", "@typescript-eslint/eslint-plugin": "^5.30.0", "@typescript-eslint/parser": "^5.30.0", "esbuild-loader": "^3.0.1", "eslint": "^8.13.0", "glob": "^7.2.0", "merge-options": "^3.0.4", - "mocha": "^9.2.1", "rimraf": "^3.0.2", "semver": "^7.3.5", "tsx": "^3.11.0", "typescript": "^4.8.4", + "vitest": "^1.3.1", "webpack": "^5.76.0", "webpack-cli": "^4.5.0" }, @@ -70,6 +69,22 @@ "get-tsconfig": "^4.2.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.15.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.12.tgz", @@ -484,6 +499,18 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -577,6 +604,181 @@ "node": ">= 8" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -598,9 +800,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", - "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/json-schema": { @@ -609,17 +811,14 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, - "node_modules/@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, "node_modules/@types/node": { - "version": "16.18.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.0.tgz", - "integrity": "sha512-LqYqYzYvnbCaQfLAwRt0zboqnsViwhZm+vjaMSqcfN36vulAg7Pt0T83q4WZO2YOBw3XdyHi8cQ88H22zmULOA==", - "dev": true + "version": "18.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", + "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/semver": { "version": "7.3.12", @@ -813,11 +1012,101 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "node_modules/@vitest/expect": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.3.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", @@ -1014,9 +1303,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1034,6 +1323,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1059,15 +1357,6 @@ "ajv": "^6.9.1" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1092,19 +1381,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1120,6 +1396,15 @@ "node": ">=8" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1135,15 +1420,6 @@ "node": "*" } }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1166,12 +1442,6 @@ "node": ">=8" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, "node_modules/browserslist": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz", @@ -1201,6 +1471,15 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1210,18 +1489,6 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001280", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001280.tgz", @@ -1232,6 +1499,24 @@ "url": "https://opencollective.com/browserslist" } }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1248,43 +1533,16 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "get-func-name": "^2.0.2" }, "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" + "node": "*" } }, "node_modules/chrome-trace-event": { @@ -1296,17 +1554,6 @@ "node": ">=6.0" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "node_modules/clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -1391,16 +1638,16 @@ } } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "type-detect": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=6" } }, "node_modules/deep-is": { @@ -1409,13 +1656,13 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "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": ">=0.3.1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/dir-glob": { @@ -1448,12 +1695,6 @@ "integrity": "sha512-w16Dtd2zl7VZ4N4Db+FIa7n36sgPGCKjrKvUUmp5ialsikvcQLjcJR9RWnlYNxIyEHLdHaoIZEqKsPxU9MdyBg==", "dev": true }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -2164,6 +2405,15 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2306,15 +2556,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -2341,9 +2582,9 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -2360,13 +2601,13 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": "*" } }, "node_modules/get-stream": { @@ -2478,15 +2719,6 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2508,15 +2740,6 @@ "node": ">=8" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -2601,18 +2824,6 @@ "node": ">= 0.10" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-core-module": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", @@ -2634,15 +2845,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2706,18 +2908,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2768,6 +2958,12 @@ "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", "dev": true }, + "node_modules/js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2810,6 +3006,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -2855,6 +3057,22 @@ "node": ">=8.9.0" } }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2876,20 +3094,13 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "get-func-name": "^2.0.1" } }, "node_modules/lru-cache": { @@ -2904,6 +3115,24 @@ "node": ">=10" } }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/magic-string/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, "node_modules/merge-options": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", @@ -2986,103 +3215,16 @@ "node": "*" } }, - "node_modules/mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/mocha/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/mlly": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" } }, "node_modules/ms": { @@ -3092,10 +3234,16 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -3121,15 +3269,6 @@ "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "dev": true }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -3276,6 +3415,21 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -3358,6 +3512,45 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "node_modules/postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3367,6 +3560,32 @@ "node": ">= 0.8.0" } }, + "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/pretty-format/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/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -3405,17 +3624,11 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } + "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/rechoir": { "version": "0.7.1", @@ -3441,15 +3654,6 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -3527,6 +3731,38 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "fsevents": "~2.3.2" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3603,15 +3839,6 @@ "node": ">=10" } }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -3645,6 +3872,12 @@ "node": ">=8" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "node_modules/signal-exit": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", @@ -3675,6 +3908,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -3685,19 +3927,17 @@ "source-map": "^0.6.0" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true }, "node_modules/strip-ansi": { "version": "6.0.1", @@ -3732,10 +3972,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/strip-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "dev": true, + "dependencies": { + "js-tokens": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" @@ -3826,6 +4078,30 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3882,44 +4158,731 @@ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { - "prelude-ls": "^1.2.1" + "prelude-ls": "^1.2.1" + }, + "engines": { + "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", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/ufo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", + "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/vitest": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.3.1", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.3.1", + "@vitest/ui": "1.3.1", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/vitest/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/vitest/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/vitest/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "node_modules/vitest/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, "engines": { - "node": ">=4.2.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "node_modules/vitest/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "dependencies": { - "punycode": "^2.1.0" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/watchpack": { @@ -4071,6 +5034,22 @@ "node": ">= 8" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wildcard": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", @@ -4086,92 +5065,18 @@ "node": ">=0.10.0" } }, - "node_modules/workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -4222,6 +5127,13 @@ "get-tsconfig": "^4.2.0" } }, + "@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.15.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.12.tgz", @@ -4422,6 +5334,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, "@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -4497,6 +5418,103 @@ "fastq": "^1.6.0" } }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "dev": true, + "optional": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -4518,9 +5536,9 @@ } }, "@types/estree": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", - "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "@types/json-schema": { @@ -4529,17 +5547,14 @@ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, - "@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, "@types/node": { - "version": "16.18.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.0.tgz", - "integrity": "sha512-LqYqYzYvnbCaQfLAwRt0zboqnsViwhZm+vjaMSqcfN36vulAg7Pt0T83q4WZO2YOBw3XdyHi8cQ88H22zmULOA==", - "dev": true + "version": "18.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", + "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@types/semver": { "version": "7.3.12", @@ -4644,11 +5659,76 @@ "eslint-visitor-keys": "^3.3.0" } }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "@vitest/expect": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "dev": true, + "requires": { + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "chai": "^4.3.10" + } + }, + "@vitest/runner": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "dev": true, + "requires": { + "@vitest/utils": "1.3.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "dependencies": { + "p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true + } + } + }, + "@vitest/snapshot": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "dev": true, + "requires": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + } + }, + "@vitest/spy": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "dev": true, + "requires": { + "tinyspy": "^2.2.0" + } + }, + "@vitest/utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "dev": true, + "requires": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + } }, "@webassemblyjs/ast": { "version": "1.11.1", @@ -4832,9 +5912,9 @@ "dev": true }, "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, "acorn-jsx": { @@ -4844,6 +5924,12 @@ "dev": true, "requires": {} }, + "acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4863,12 +5949,6 @@ "dev": true, "requires": {} }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -4884,16 +5964,6 @@ "color-convert": "^2.0.1" } }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -4906,6 +5976,12 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -4918,12 +5994,6 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4943,12 +6013,6 @@ "fill-range": "^7.0.1" } }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, "browserslist": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.18.1.tgz", @@ -4968,24 +6032,39 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - }, "caniuse-lite": { "version": "1.0.30001280", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001280.tgz", "integrity": "sha512-kFXwYvHe5rix25uwueBxC569o53J6TpnGu0BEEn+6Lhl2vsnAumRFWEBhDft1fwyo6m1r4i+RqA4+163FpeFcA==", "dev": true }, + "chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4996,31 +6075,13 @@ "supports-color": "^7.1.0" } }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } + "get-func-name": "^2.0.2" } }, "chrome-trace-event": { @@ -5029,17 +6090,6 @@ "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -5104,11 +6154,14 @@ "ms": "2.1.2" } }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } }, "deep-is": { "version": "0.1.4", @@ -5116,10 +6169,10 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "dir-glob": { @@ -5146,12 +6199,6 @@ "integrity": "sha512-w16Dtd2zl7VZ4N4Db+FIa7n36sgPGCKjrKvUUmp5ialsikvcQLjcJR9RWnlYNxIyEHLdHaoIZEqKsPxU9MdyBg==", "dev": true }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -5579,6 +6626,15 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -5693,12 +6749,6 @@ "path-exists": "^4.0.0" } }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -5722,9 +6772,9 @@ "dev": true }, "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, @@ -5734,10 +6784,10 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, "get-stream": { @@ -5819,12 +6869,6 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5840,12 +6884,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -5906,15 +6944,6 @@ "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-core-module": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", @@ -5930,12 +6959,6 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -5978,12 +7001,6 @@ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -6024,6 +7041,12 @@ "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", "dev": true }, + "js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -6057,6 +7080,12 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -6090,6 +7119,16 @@ "json5": "^2.1.2" } }, + "local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "requires": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + } + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -6105,14 +7144,13 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "get-func-name": "^2.0.1" } }, "lru-cache": { @@ -6124,6 +7162,23 @@ "yallist": "^4.0.0" } }, + "magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "dependencies": { + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + } + } + }, "merge-options": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", @@ -6185,79 +7240,16 @@ "brace-expansion": "^1.1.7" } }, - "mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "mlly": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", + "dev": true, + "requires": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" } }, "ms": { @@ -6267,9 +7259,9 @@ "dev": true }, "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true }, "natural-compare": { @@ -6290,12 +7282,6 @@ "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "dev": true }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -6400,6 +7386,18 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -6460,12 +7458,53 @@ } } }, + "pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "requires": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "dev": true, + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "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, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "dependencies": { + "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 + } + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -6487,14 +7526,11 @@ "safe-buffer": "^5.1.0" } }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } + "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 }, "rechoir": { "version": "0.7.1", @@ -6511,12 +7547,6 @@ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true - }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -6571,6 +7601,29 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@types/estree": "1.0.5", + "fsevents": "~2.3.2" + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6606,15 +7659,6 @@ "lru-cache": "^6.0.0" } }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -6639,6 +7683,12 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "signal-exit": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", @@ -6663,6 +7713,12 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, "source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -6673,16 +7729,17 @@ "source-map": "^0.6.0" } }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } + "stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true }, "strip-ansi": { "version": "6.0.1", @@ -6705,6 +7762,15 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strip-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "dev": true, + "requires": { + "js-tokens": "^8.0.2" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -6770,6 +7836,24 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true + }, + "tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6815,6 +7899,12 @@ "prelude-ls": "^1.2.1" } }, + "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 + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -6827,6 +7917,18 @@ "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true }, + "ufo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "dev": true + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6836,6 +7938,325 @@ "punycode": "^2.1.0" } }, + "vite": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", + "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", + "dev": true, + "requires": { + "esbuild": "^0.19.3", + "fsevents": "~2.3.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + } + } + }, + "vite-node": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "dev": true, + "requires": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + } + }, + "vitest": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "dev": true, + "requires": { + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.3.1", + "why-is-node-running": "^2.2.2" + }, + "dependencies": { + "execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + } + }, + "get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true + }, + "human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true + }, + "is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true + }, + "mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true + }, + "npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "requires": { + "path-key": "^4.0.0" + } + }, + "onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "requires": { + "mimic-fn": "^4.0.0" + } + }, + "path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true + }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, + "strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true + } + } + }, "watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -6932,6 +8353,16 @@ "isexe": "^2.0.0" } }, + "why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "requires": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + } + }, "wildcard": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", @@ -6944,74 +8375,18 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, - "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - } - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index ad02e7bd..587ad710 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,8 @@ } }, "scripts": { - "test": "tsx tests", + "test": "vitest run", + "test:watch": "vitest", "package": "vsce package", "package:linter": "LANGUAGE_TOOLS_ENABLED=\"false\" FORMATTER_ENABLED=\"false\" vsce package", "vscode:prepublish": "npm run webpack", @@ -93,19 +94,18 @@ }, "devDependencies": { "@halcyontech/vscode-ibmi-types": "^2.1.0", - "@types/mocha": "^9.1.0", - "@types/node": "^16.11.7", + "@types/node": "^18.16.1", "@typescript-eslint/eslint-plugin": "^5.30.0", "@typescript-eslint/parser": "^5.30.0", "esbuild-loader": "^3.0.1", "eslint": "^8.13.0", "glob": "^7.2.0", "merge-options": "^3.0.4", - "mocha": "^9.2.1", "rimraf": "^3.0.2", "semver": "^7.3.5", "tsx": "^3.11.0", "typescript": "^4.8.4", + "vitest": "^1.3.1", "webpack": "^5.76.0", "webpack-cli": "^4.5.0" } diff --git a/tests/index.js b/tests/index.js deleted file mode 100644 index 482609d5..00000000 --- a/tests/index.js +++ /dev/null @@ -1,25 +0,0 @@ -const specificTests = process.argv[2]; - -async function run() { - const suite = require(`./suite`); - let testNames = Object.keys(suite); - - if (specificTests) { - testNames = testNames.filter(name => name.startsWith(specificTests)); - } - - console.log(`Running ${testNames.length} tests:`); - - const start = process.hrtime(); - - for (const testName of testNames) { - const test = suite[testName]; - await test(); - } - - const elapsed = process.hrtime(start)[1] / 1000000; // divide by a million to get nano to milli - console.log(process.hrtime(start)[0] + `s, ` + elapsed.toFixed(3) + ` ms`); // print message + time - -}; - -run(); \ No newline at end of file diff --git a/tests/suite/basics.js b/tests/suite/basics.test.ts similarity index 58% rename from tests/suite/basics.js rename to tests/suite/basics.test.ts index 416cb42c..56eeda01 100644 --- a/tests/suite/basics.js +++ b/tests/suite/basics.test.ts @@ -1,14 +1,13 @@ -const assert = require(`assert`); -const path = require(`path`); +import path from "path"; +import setupParser from "../parserSetup"; +import Linter from "../../language/linter"; +import { test, expect } from "vitest"; -const { default: parserSetup } = require(`../parserSetup`); -const { default: Linter } = require(`../../language/linter`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; -exports.test1 = async () => { +test('vitestTest1', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable CHAR(20);` @@ -16,14 +15,14 @@ exports.test1 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.variables[0].position.line, 1, `Index of 1 expected`); -} + expect(cache.variables.length).toBe(1); + expect(cache.variables[0].position.line).toBe(1); +}); /** * Multiple variable definition test */ -exports.test2 = async () => { +test('vitestTest2', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable CHAR(20);`, @@ -33,15 +32,12 @@ exports.test2 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); - assert.strictEqual(cache.variables[0].position.line, 1, `Index of 1 expected`); - assert.strictEqual(cache.variables[1].position.line, 3, `Index of 3 expected`); -} + expect(cache.variables.length).toBe(2); + expect(cache.variables[0].position.line).toBe(1); + expect(cache.variables[1].position.line).toBe(3); +}); -/** - * Variable definition and struct definition test - */ -exports.test3 = async () => { +test('vitestTest3', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 CHAR(20);`, @@ -55,25 +51,22 @@ exports.test3 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); - assert.strictEqual(cache.structs.length, 1, `Expect length of 1`); + expect(cache.variables.length).toBe(2); + expect(cache.structs.length).toBe(1); - assert.strictEqual(cache.structs[0].subItems.length, 2, `Expect length of 2 subitems`); + expect(cache.structs[0].subItems.length).toBe(2); - assert.strictEqual(cache.variables[0].position.line, 1, `Index of 1 expected`); - assert.strictEqual(cache.variables[1].position.line, 6, `Index of 6 expected`); - assert.strictEqual(cache.structs[0].position.line, 2, `Index of 2 expected`); + expect(cache.variables[0].position.line).toBe(1); + expect(cache.variables[1].position.line).toBe(6); + expect(cache.structs[0].position.line).toBe(2); - assert.deepStrictEqual(cache.structs[0].range, { + expect(cache.structs[0].range).toEqual({ start: 2, end: 5 }); -} +}); -/** - * Variable and subroutine definition test - * */ -exports.test4 = async () => { +test('vitestTest4', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 CHAR(20);`, @@ -86,202 +79,202 @@ exports.test4 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.subroutines.length, 1, `Expect length of 1`); + expect(cache.variables.length).toBe(1); + expect(cache.subroutines.length).toBe(1); - assert.strictEqual(cache.variables[0].position.line, 1, `Index of 1 expected`); - assert.strictEqual(cache.subroutines[0].range.start, 4, `Index of 4 expected`); - assert.strictEqual(cache.subroutines[0].range.end, 6); -} + expect(cache.variables[0].position.line).toBe(1); + expect(cache.subroutines[0].range.start).toBe(4); + expect(cache.subroutines[0].range.end).toBe(6); +}); /** - * Variable and procedure definition test - */ -exports.test5 = async () => { + * Variable and procedure definition test + */ +test('vitestTest5', async () => { const lines = [ - `**FREE`, - ``, - `Dcl-s MyVariable2 CHAR(20);`, - ``, - `Dcl-Proc theProcedure;`, - ` MyVariable2 = 'Hello world';`, - `End-Proc;`, - ``, - `Dcl-Proc setValue;`, - ` Dcl-Pi *N;`, - ` newValue CHAR(20);`, - ` End-Pi;`, - ` MyVariable2 = newValue;`, - `End-Proc;`, + `**FREE`, + ``, + `Dcl-s MyVariable2 CHAR(20);`, + ``, + `Dcl-Proc theProcedure;`, + ` MyVariable2 = 'Hello world';`, + `End-Proc;`, + ``, + `Dcl-Proc setValue;`, + ` Dcl-Pi *N;`, + ` newValue CHAR(20);`, + ` End-Pi;`, + ` MyVariable2 = newValue;`, + `End-Proc;`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 2, `Expect length of 2`); + expect(cache.variables.length).toBe(1); + expect(cache.procedures.length).toBe(2); - assert.strictEqual(cache.variables[0].position.line, 2, `Index of 2 expected`); - assert.strictEqual(cache.procedures[0].position.line, 4, `Index of 4 expected`); - assert.strictEqual(cache.procedures[1].position.line, 8, `Index of 8 expected`); + expect(cache.variables[0].position.line).toBe(2); + expect(cache.procedures[0].position.line).toBe(4); + expect(cache.procedures[1].position.line).toBe(8); - assert.strictEqual(cache.procedures[0].subItems.length, 0, `Expect length of 0`); - assert.strictEqual(cache.procedures[1].subItems.length, 1, `Expect length of 1`); -} + expect(cache.procedures[0].subItems.length).toBe(0); + expect(cache.procedures[1].subItems.length).toBe(1); +}); -exports.test6 = async () => { +test('vitestTest6', async () => { const lines = [ - `**FREE`, - `Dcl-s MyVariable2 CHAR(20);`, - ``, - `Dcl-Pr TheProcedure;`, - ` parmA CHAR(20);`, - `End-Pr;`, - ``, - `MyVariable2 = 'Hello world';`, + `**FREE`, + `Dcl-s MyVariable2 CHAR(20);`, + ``, + `Dcl-Pr TheProcedure;`, + ` parmA CHAR(20);`, + `End-Pr;`, + ``, + `MyVariable2 = 'Hello world';`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); -} + expect(cache.variables.length).toBe(1); + expect(cache.procedures.length).toBe(1); +}); /** - * Test procedure length. - * When Procedure is defined, the prototype is overridden. - */ -exports.test7 = async () => { + * Test procedure length. + * When Procedure is defined, the prototype is overridden. + */ +test('vitestTest7', async () => { const lines = [ - `**FREE`, - ``, - `Dcl-Pr TheProcedure;`, - ` parmA CHAR(20);`, - `End-Pr;`, - ``, - `Dcl-S theVar CHAR(20);`, - ``, - `Dcl-Proc theProcedure;`, - ` Dcl-Pi *N;`, - ` newValue Char(20);`, - ` End-Pi;`, - ` theVar = newValue;`, - `End-Proc;`, + `**FREE`, + ``, + `Dcl-Pr TheProcedure;`, + ` parmA CHAR(20);`, + `End-Pr;`, + ``, + `Dcl-S theVar CHAR(20);`, + ``, + `Dcl-Proc theProcedure;`, + ` Dcl-Pi *N;`, + ` newValue Char(20);`, + ` End-Pi;`, + ` theVar = newValue;`, + `End-Proc;`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); -} + expect(cache.variables.length).toBe(1); + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); +}); /** - * Test procedure length. - * When Procedure is defined, the prototype is overridden. - */ -exports.test7_fixed = async () => { + * Test procedure length. + * When Procedure is defined, the prototype is overridden. + */ +test('vitestTest7_fixed', async () => { const lines = [ - ` DGetArtDesc PR 50A extproc`, - ` D ARID 6A value`, - ``, - ` PGetArtDesc B export`, - ` DGetArtDesc PI like(ardesc)`, - ` D P_ARID 6A value`, - ` /free`, - ` chainARTICLE1(P_ARID`, - ` );`, - ` return ARDESC;`, - ` /end-free`, - ` pGetArtDesc e`, + ` DGetArtDesc PR 50A extproc`, + ` D ARID 6A value`, + ``, + ` PGetArtDesc B export`, + ` DGetArtDesc PI like(ardesc)`, + ` D P_ARID 6A value`, + ` /free`, + ` chainARTICLE1(P_ARID`, + ` );`, + ` return ARDESC;`, + ` /end-free`, + ` pGetArtDesc e`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); -} + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); +}); /** - * Constant definition test - * */ -exports.test8 = async () => { + * Constant definition test + * */ +test('vitestTest8', async () => { const lines = [ - `**FREE`, - `Dcl-s MyVariable2 Char(20);`, - ``, - `Dcl-C theConstant 'Hello world';`, + `**FREE`, + `Dcl-s MyVariable2 Char(20);`, + ``, + `Dcl-C theConstant 'Hello world';`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); -} + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); +}); /** - * Check that local variables are not in global scope - */ -exports.test9 = async () => { + * Check that local variables are not in global scope + */ +test('vitestTest9', async () => { const lines = [ - `**FREE`, - `Dcl-s MyVariable2 Char(20);`, - ``, - `Dcl-C theConstant 'Hello world';`, - ``, - `Dcl-Proc theProcedure;`, - ` Dcl-Pi *N;`, - ` newValue Char(20);`, - ` End-Pi;`, - ` Dcl-S localVar Char(20);`, - ` localVar = newValue;`, - ` MyVariable2 = localVar;`, - `End-Proc;`, + `**FREE`, + `Dcl-s MyVariable2 Char(20);`, + ``, + `Dcl-C theConstant 'Hello world';`, + ``, + `Dcl-Proc theProcedure;`, + ` Dcl-Pi *N;`, + ` newValue Char(20);`, + ` End-Pi;`, + ` Dcl-S localVar Char(20);`, + ` localVar = newValue;`, + ` MyVariable2 = localVar;`, + `End-Proc;`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); -} + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); +}); /** - * Test copybook - * */ -exports.test10 = async () => { + * Test copybook + * */ +test('vitestTest10', async () => { const lines = [ - `**FREE`, - ``, - `Ctl-Opt DftActGrp(*No);`, - ``, - `/copy './tests/rpgle/copy1.rpgle'`, - ``, - `Dcl-s MyVariable2 Char(20);`, - ``, - `Dcl-C theConstant 'Hello world';`, - ``, - `CallP theExtProcedure(myVariable);`, - ``, - `Return;` + `**FREE`, + ``, + `Ctl-Opt DftActGrp(*No);`, + ``, + `/copy './tests/rpgle/copy1.rpgle'`, + ``, + `Dcl-s MyVariable2 Char(20);`, + ``, + `Dcl-C theConstant 'Hello world';`, + ``, + `CallP theExtProcedure(myVariable);`, + ``, + `Return;` ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(Object.keys(cache.keyword).length, 1); - assert.strictEqual(cache.keyword[`DFTACTGRP`], `*NO`); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); + expect(Object.keys(cache.keyword).length).toBe(1); + expect(cache.keyword[`DFTACTGRP`]).toBe(`*NO`); + expect(cache.includes.length).toBe(1); + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); const baseNameInclude = path.basename(cache.procedures[0].position.path); - assert.strictEqual(baseNameInclude, `copy1.rpgle`, `Path is incorrect`); - assert.strictEqual(cache.procedures[0].position.line, 2, `Index of 3 expected`); -} + expect(baseNameInclude).toBe(`copy1.rpgle`); + expect(cache.procedures[0].position.line).toBe(2); +}); -exports.test10_local_fixedcopy = async () => { +test('test10_local_fixedcopy', async () => { const lines = [ `**FREE`, ``, @@ -300,21 +293,21 @@ exports.test10_local_fixedcopy = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); + expect(cache.includes.length).toBe(1); + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); + expect(cache.procedures.length).toBe(1); const uppercase = cache.find(`UPPERCASE`); const baseNameInclude = path.basename(uppercase.position.path); - assert.strictEqual(baseNameInclude, `eof4.rpgle`, `Path is incorrect`); -} + expect(baseNameInclude).toBe(`eof4.rpgle`); +}); /** * Test many copybooks * */ -exports.test11 = async () => { +test('test11', async () => { const lines = [ `**FREE`, ``, @@ -336,16 +329,16 @@ exports.test11 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.includes.length, 2); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 2, `Expect length of 2`); - assert.strictEqual(cache.structs.length, 1, `Expect length of 1`); - assert.strictEqual(cache.structs[0].subItems.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); -} + expect(cache.includes.length).toBe(2); + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(2); + expect(cache.structs.length).toBe(1); + expect(cache.structs[0].subItems.length).toBe(1); + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); +}); -exports.test12 = async () => { +test('test12', async () => { const lines = [ `**FREE`, ``, @@ -376,36 +369,36 @@ exports.test12 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.includes.length, 1); + expect(cache.includes.length).toBe(1); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); // One prototype and one declared - assert.strictEqual(cache.procedures.length, 2, `Expect length of 2`); + expect(cache.procedures.length).toBe(2); // Valid names - assert.strictEqual(cache.procedures[0].name, `theExtProcedure`, `Expect valid name`); - assert.strictEqual(cache.procedures[1].name, `theLocalProc`, `Expect valid name`); + expect(cache.procedures[0].name).toBe(`theExtProcedure`); + expect(cache.procedures[1].name).toBe(`theLocalProc`); const theLocalProc = cache.find(`theLocalProc`); - assert.deepStrictEqual(theLocalProc.range, { + expect(theLocalProc.range).toEqual({ start: 16, end: 23 }); // Has a parameter - assert.strictEqual(theLocalProc.subItems.length, 1, `Expect length of 1`); + expect(theLocalProc.subItems.length).toBe(1); // Has a local scope - assert.strictEqual(theLocalProc.scope !== undefined, true, `Should have a scope`); + expect(theLocalProc.scope !== undefined).toBe(true); // Should have a local variable - assert.strictEqual(theLocalProc.scope.variables.length, 1, `Expect length of 1`); -}; + expect(theLocalProc.scope.variables.length).toBe(1); +}); -exports.indicators1 = async () => { +test('indicators1', async () => { const lines = [ `**FREE`, `Dcl-S MyVar char(10);`, @@ -426,11 +419,11 @@ exports.indicators1 = async () => { const in10 = cache.find(`IN10`); - assert.strictEqual(in10.references.length, 2); -}; + expect(in10.references.length).toBe(2); +}); -exports.subds1 = async () => { +test('subds1', async () => { const lines = [ `**FREE`, ``, @@ -459,22 +452,22 @@ exports.subds1 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.structs.length, 1); + expect(cache.structs.length).toBe(1); const DsChangingNodeRole = cache.find(`DsChangingNodeRole`); - assert.strictEqual(DsChangingNodeRole.name, `DsChangingNodeRole`); - assert.strictEqual(DsChangingNodeRole.position.line, 2); + expect(DsChangingNodeRole.name).toBe(`DsChangingNodeRole`); + expect(DsChangingNodeRole.position.line).toBe(2); - assert.strictEqual(DsChangingNodeRole.subItems.length, 13); - assert.strictEqual(DsChangingNodeRole.subItems[12].name, `Role`); + expect(DsChangingNodeRole.subItems.length).toBe(13); + expect(DsChangingNodeRole.subItems[12].name).toBe(`Role`); - assert.deepStrictEqual(DsChangingNodeRole.range, { + expect(DsChangingNodeRole.range).toEqual({ start: 2, end: 19 }); -}; +}); -exports.range1 = async () => { +test('range1', async () => { const lines = [ `**FREE`, `///`, @@ -505,23 +498,23 @@ exports.range1 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.procedures.length, 2); + expect(cache.procedures.length).toBe(2); const json_getDelims = cache.find(`json_getDelims`); - assert.deepStrictEqual(json_getDelims.range, { + expect(json_getDelims.range).toEqual({ start: 11, end: 11 }); const json_getDelimiters = cache.find(`json_setDelimiters`); - assert.strictEqual(json_getDelimiters.subItems.length, 1); - assert.deepStrictEqual(json_getDelimiters.range, { + expect(json_getDelimiters.subItems.length).toBe(1); + expect(json_getDelimiters.range).toEqual({ start: 21, end: 23 }); -}; +}); -exports.range2 = async () => { +test('range2', async () => { const lines = [ `**free`, `Dcl-S FullCmd Char(32);`, @@ -533,18 +526,18 @@ exports.range2 = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.variables.length, 2); - assert.strictEqual(cache.structs.length, 1); + expect(cache.variables.length).toBe(2); + expect(cache.structs.length).toBe(1); const ABCD = cache.find(`ABCD`); - assert.strictEqual(ABCD.keyword[`LIKEDS`], `BBOOP`); - assert.deepStrictEqual(ABCD.range, { + expect(ABCD.keyword[`LIKEDS`]).toBe(`BBOOP`); + expect(ABCD.range).toEqual({ start: 2, end: 2 }); -} +}); -exports.inline_end_pi = async () => { +test('inline_end_pi', async () => { const lines = [ ` dcl-proc getHandle;`, ``, @@ -566,11 +559,11 @@ exports.inline_end_pi = async () => { const getHandle = cache.find(`getHandle`); - assert.strictEqual(getHandle.keyword[`LIKE`], `HANDLE_T`); - assert.strictEqual(getHandle.keyword[`END-PI`], undefined); -} + expect(getHandle.keyword[`LIKE`]).toBe(`HANDLE_T`); + expect(getHandle.keyword[`END-PI`]).toBeUndefined(); +}); -exports.issue_168 = async () => { +test('issue_168', async () => { const lines = [ `**free`, `Ctl-opt datfmt(*iso) timfmt(*iso) alwnull(*usrctl) debug;`, @@ -603,9 +596,9 @@ exports.issue_168 = async () => { ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); -} +}); -exports.issues_168a = async () => { +test('issues_168a', async () => { const lines = [ `**free`, `Ctl-opt datfmt(*iso) timfmt(*iso) alwnull(*usrctl) debug;`, @@ -650,9 +643,9 @@ exports.issues_168a = async () => { ].join(`\n`); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); -} +}); -exports.issues_170b = async () => { +test('issues_170b', async () => { const lines = [ `**free`, ``, @@ -677,16 +670,16 @@ exports.issues_170b = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); const WkStnInd = cache.find(`WkStnInd`); - assert.strictEqual(WkStnInd.name, `WkStnInd`); - assert.strictEqual(WkStnInd.subItems.length, 11); + expect(WkStnInd.name).toBe(`WkStnInd`); + expect(WkStnInd.subItems.length).toBe(11); const error = cache.find(`Error`); - assert.strictEqual(error.name, `Error`); - assert.strictEqual(error.keyword[`IND`], true); - assert.strictEqual(error.keyword[`POS`], `25`); -} + expect(error.name).toBe(`Error`); + expect(error.keyword[`IND`]).toBe(true); + expect(error.keyword[`POS`]).toBe(`25`); +}); -exports.issues_dcl_subf = async () => { +test('issues_dcl_subf', async () => { const lines = [ `**free`, ``, @@ -704,13 +697,13 @@ exports.issues_dcl_subf = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); const inputsYo = cache.find(`inputsYo`); - assert.strictEqual(inputsYo.subItems.length, 7); + expect(inputsYo.subItems.length).toBe(7); const boop_Addr1 = inputsYo.subItems[0]; - assert.strictEqual(boop_Addr1.name, `boop_Addr1`); -} + expect(boop_Addr1.name).toBe(`boop_Addr1`); +}); -exports.issue_195a = async () => { +test('issue_195a', async () => { const lines = [ `**free`, `//***********************************************************************`, @@ -737,13 +730,12 @@ exports.issue_195a = async () => { `End-Proc ScomponiStringa;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); cache.clearReferences(); -} +}); -exports.issue_195b = async () => { +test('issue_195b', async () => { const lines = [ `**FREE`, ``, @@ -795,16 +787,15 @@ exports.issue_195b = async () => { `End-Proc;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.procedures.length, 1); + expect(cache.procedures.length).toBe(1); const DoProfileStuff = cache.find(`DoProfileStuff`); - assert.strictEqual(DoProfileStuff.scope.procedures.length, 2); -} + expect(DoProfileStuff.scope.procedures.length).toBe(2); +}); -exports.exec_1 = async () => { +test('exec_1', async () => { const lines = [ `**FREE`, ``, @@ -819,15 +810,14 @@ exports.exec_1 = async () => { `Return;` ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 1); - assert.strictEqual(cache.sqlReferences[0].name, `sysdummy1`); - assert.strictEqual(cache.sqlReferences[0].description, `sysibm`); -} + expect(cache.sqlReferences.length).toBe(1); + expect(cache.sqlReferences[0].name).toBe(`sysdummy1`); + expect(cache.sqlReferences[0].description).toBe(`sysibm`); +}); -exports.exec_2 = async () => { +test('exec_2', async () => { const lines = [ `**free`, `Dcl-s DeptNum Char(3);`, @@ -848,18 +838,17 @@ exports.exec_2 = async () => { ` WHERE WORKDEPT = :deptNum;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); - assert.strictEqual(cache.sqlReferences[0].name, `Employee`); - assert.strictEqual(cache.sqlReferences[0].description, ``); + expect(cache.sqlReferences.length).toBe(2); + expect(cache.sqlReferences[0].name).toBe(`Employee`); + expect(cache.sqlReferences[0].description).toBe(``); - assert.strictEqual(cache.sqlReferences[1].name, `Employee`); - assert.strictEqual(cache.sqlReferences[1].description, `sample`); -} + expect(cache.sqlReferences[1].name).toBe(`Employee`); + expect(cache.sqlReferences[1].description).toBe(`sample`); +}); -exports.exec_3 = async () => { +test('exec_3', async () => { const lines = [ `**FREE`, ``, @@ -874,13 +863,12 @@ exports.exec_3 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 0); -} + expect(cache.sqlReferences.length).toBe(0); +}); -exports.exec_4 = async () => { +test('exec_4', async () => { const lines = [ ` dcl-s NULL pointer inz(*NULL);`, ` dcl-s amount1 packed(7:2);`, @@ -907,15 +895,14 @@ exports.exec_4 = async () => { ` sample.employee;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 1); - assert.strictEqual(cache.sqlReferences[0].name, `employee`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); -} + expect(cache.sqlReferences.length).toBe(1); + expect(cache.sqlReferences[0].name).toBe(`employee`); + expect(cache.sqlReferences[0].description).toBe(`sample`); +}); -exports.exec_5 = async () => { +test('exec_5', async () => { const lines = [ `**FREE`, ``, @@ -930,19 +917,18 @@ exports.exec_5 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `mytable`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); + expect(cache.sqlReferences[0].name).toBe(`mytable`); + expect(cache.sqlReferences[0].description).toBe(`sample`); - assert.strictEqual(cache.sqlReferences[1].name, `othertable`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`othertable`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_6 = async () => { +test('exec_6', async () => { const lines = [ `**FREE`, ``, @@ -959,19 +945,18 @@ exports.exec_6 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `mytable`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); + expect(cache.sqlReferences[0].name).toBe(`mytable`); + expect(cache.sqlReferences[0].description).toBe(`sample`); - assert.strictEqual(cache.sqlReferences[1].name, `othertable`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`othertable`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_7 = async () => { +test('exec_7', async () => { const lines = [ `**FREE`, ``, @@ -988,19 +973,18 @@ exports.exec_7 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `thetable`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); + expect(cache.sqlReferences[0].name).toBe(`thetable`); + expect(cache.sqlReferences[0].description).toBe(`sample`); - assert.strictEqual(cache.sqlReferences[1].name, `cooltable`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`cooltable`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_8 = async () => { +test('exec_8', async () => { const lines = [ `**FREE`, ``, @@ -1017,19 +1001,18 @@ exports.exec_8 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `thetable`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); + expect(cache.sqlReferences[0].name).toBe(`thetable`); + expect(cache.sqlReferences[0].description).toBe(`sample`); - assert.strictEqual(cache.sqlReferences[1].name, `wooptable`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`wooptable`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_9 = async () => { +test('exec_9', async () => { const lines = [ `**FREE`, ``, @@ -1044,19 +1027,18 @@ exports.exec_9 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `MyRandomProc`); - assert.strictEqual(cache.sqlReferences[0].description, `sample`); + expect(cache.sqlReferences[0].name).toBe(`MyRandomProc`); + expect(cache.sqlReferences[0].description).toBe(`sample`); - assert.strictEqual(cache.sqlReferences[1].name, `OtherCoolProc`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`OtherCoolProc`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_10 = async () => { +test('exec_10', async () => { const lines = [ ` EXEC SQL`, ` DECLARE C1 CURSOR FOR`, @@ -1068,19 +1050,18 @@ exports.exec_10 = async () => { ` ORDER BY MSGDAT DESC, MSGTIM DESC;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); + expect(cache.sqlReferences.length).toBe(2); - assert.strictEqual(cache.sqlReferences[0].name, `PSBORDS`); - assert.strictEqual(cache.sqlReferences[0].description, ``); + expect(cache.sqlReferences[0].name).toBe(`PSBORDS`); + expect(cache.sqlReferences[0].description).toBe(``); - assert.strictEqual(cache.sqlReferences[1].name, `PMESSGS`); - assert.strictEqual(cache.sqlReferences[1].description, ``); -} + expect(cache.sqlReferences[1].name).toBe(`PMESSGS`); + expect(cache.sqlReferences[1].description).toBe(``); +}); -exports.exec_11 = async () => { +test('exec_11', async () => { const lines = [ `**FREE`, ``, @@ -1096,15 +1077,14 @@ exports.exec_11 = async () => { `return;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 2); - assert.strictEqual(cache.sqlReferences[0].name, `PrdBlock`); - assert.strictEqual(cache.sqlReferences[1].name, `prdblk2add`); -} + expect(cache.sqlReferences.length).toBe(2); + expect(cache.sqlReferences[0].name).toBe(`PrdBlock`); + expect(cache.sqlReferences[1].name).toBe(`prdblk2add`); +}); -exports.exec_12_a = async () => { +test('exec_12_a', async () => { const lines = [ `**free`, `exec sql declare c2 cursor for`, @@ -1117,15 +1097,14 @@ exports.exec_12_a = async () => { `order by arid ;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences[0].name, `article`); - assert.strictEqual(cache.sqlReferences[1].name, `artiprov`); - assert.strictEqual(cache.sqlReferences.length, 2); -} + expect(cache.sqlReferences[0].name).toBe(`article`); + expect(cache.sqlReferences[1].name).toBe(`artiprov`); + expect(cache.sqlReferences.length).toBe(2); +}); -exports.exec_12_b = async () => { +test('exec_12_b', async () => { const lines = [ `**free`, `exec sql declare c2 cursor for`, @@ -1138,15 +1117,14 @@ exports.exec_12_b = async () => { `order by arid ;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences[0].name, `article`); - assert.strictEqual(cache.sqlReferences[1].name, `artiprov`); - assert.strictEqual(cache.sqlReferences.length, 2); -} + expect(cache.sqlReferences[0].name).toBe(`article`); + expect(cache.sqlReferences[1].name).toBe(`artiprov`); + expect(cache.sqlReferences.length).toBe(2); +}); -exports.exec_13 = async () => { +test('exec_13', async () => { const lines = [ `**FREE`, `EXEC SQL`, @@ -1162,14 +1140,13 @@ exports.exec_13 = async () => { ` );`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.sqlReferences.length, 1); - assert.strictEqual(cache.sqlReferences[0].name, `TRANSACTION`); -} + expect(cache.sqlReferences.length).toBe(1); + expect(cache.sqlReferences[0].name).toBe(`TRANSACTION`); +}); -exports.enum_1 = async () => { +test('enum_1', async () => { const lines = [ `**free`, ``, @@ -1193,16 +1170,15 @@ exports.enum_1 = async () => { `END-DS;`, ].join(`\n`); - const parser = parserSetup(); const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.constants.length, 2); + expect(cache.constants.length).toBe(2); const sizes = cache.find(`sizes`); - assert.strictEqual(sizes.name, `sizes`); - assert.strictEqual(sizes.subItems.length, 4); + expect(sizes.name).toBe(`sizes`); + expect(sizes.subItems.length).toBe(4); const jobMsgQ = cache.find(`jobMsgQ`); - assert.strictEqual(jobMsgQ.name, `jobMsgQ`); - assert.strictEqual(jobMsgQ.subItems.length, 3); -} \ No newline at end of file + expect(jobMsgQ.name).toBe(`jobMsgQ`); + expect(jobMsgQ.subItems.length).toBe(3); +}); \ No newline at end of file diff --git a/tests/suite/directives.js b/tests/suite/directives.js deleted file mode 100644 index 6ece64e3..00000000 --- a/tests/suite/directives.js +++ /dev/null @@ -1,606 +0,0 @@ - -const assert = require(`assert`); - -const {default: parserSetup} = require(`../parserSetup`); -const {default: Linter} = require(`../../language/linter`); -const path = require(`path`); - -const parser = parserSetup(); -const uri = `source.rpgle`; - -module.exports = { - skip1: async () => { - const lines = [ - `**free`, - ``, - `/copy myds.ds`, - `end-ds;`, - ``, - `dsply thingy;`, - ``, - `return`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { indentErrors } = Linter.getErrors({uri, content: lines}, { - indent: 2 - }, cache); - - assert.strictEqual(cache.includes.length, 0); // Because it's not found. - assert.strictEqual(indentErrors.length > 0, true, `Expect indent errors`); - }, - - skip2: async () => { - const lines = [ - `**free`, - ``, - `/copy myds.ds`, - `// @rpglint-skip`, - `end-ds;`, - ``, - `dsply thingy;`, - ``, - `return`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { indentErrors } = Linter.getErrors({uri, content: lines}, { - indent: 2 - }, cache); - - assert.strictEqual(cache.includes.length, 0); // Because it's not found. - assert.strictEqual(indentErrors.length, 0, `Expect no indent errors`); - }, - - skip2_issue91_1: async () => { - const lines = [ - `**free`, - ``, - `/copy myds.ds`, - `// @rpglint-skip-indent`, - `end-ds;`, - ``, - `dsply thingy;`, - ``, - `return`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { indentErrors } = Linter.getErrors({uri, content: lines}, { - indent: 2 - }, cache); - - assert.strictEqual(cache.includes.length, 0); // Because it's not found. - assert.strictEqual(indentErrors.length, 0, `Expect no indent errors`); - }, - - skip2_issue91_2: async () => { - const lines = [ - `**free`, - ``, - `/copy myds.ds`, - `// @rpglint-skip-rules`, - `end-ds;`, - ``, - `dsply thingy;`, - ``, - `return`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { indentErrors } = Linter.getErrors({uri, content: lines}, { - indent: 2 - }, cache); - - assert.strictEqual(cache.includes.length, 0); // Because it's not found. - assert.strictEqual(indentErrors.length, 3, `Expect no indent errors`); - }, - - skip2_issue91: async () => { - const lines = [ - `**FREE`, - ``, - `/IF DEFINED(ABCEEF)`, - `/eof`, - `/EndIf`, - `/DEFINE ABCEEF`, - - `// @rpglint-skip-rules`, - `CallP THEPROCEDURE2;`, - ``, - `Dcl-Proc theProcedure2;`, - ` Dcl-S mylocal char(20);`, - ` MyVariable2 = 'Hello world';`, - ` mylocal = Myvariable2;`, - `End-Proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({uri, content: lines}, { - IncorrectVariableCase: true - }, cache); - - assert.strictEqual(cache.procedures.length, 1); - const theProcedure2 = cache.find(`theProcedure2`); - assert.strictEqual(theProcedure2.name, `theProcedure2`); - - assert.strictEqual(errors.length, 0); - }, - - - skip3: async () => { - const lines = [ - `**free`, - `dcl-s xxField1 char(1);`, - ``, - `// @rpglint-skip`, - `/copy myds.ds`, - ``, - `dsply xxfield1;`, - ``, - `return`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({uri, content: lines}, { - IncorrectVariableCase: true - }, cache); - - assert.strictEqual(cache.includes.length, 0); // Because it's not found. - assert.strictEqual(errors.length, 1, `Expect one errors`); - }, - - eof1: async () => { - const lines = [ - ` D UPPERCASE PR 4096 Varying`, - ` D String 4096 Const Varying`, - ` D Escaped n Const Options(*NoPass)`, - ` /EoF`, - ` Converts all of the letters in String to their`, - ` UPPER CASE equivalents. Non-alphabetic characters`, - ` remain unchanged.`, - ``, - ` Escaped = *ON = converts characters that would crash iPDF and`, - ` HTML to approximately equivalent characters.`, - ` For example, translate " and ' to \` .`, - ` (Default)`, - ` *OFF= Do not convert any characters other than A-Z.`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - const uppercase = cache.find(`UPPERCASE`); - assert.strictEqual(uppercase.name, `UPPERCASE`); - assert.strictEqual(uppercase.position.line, 0); - assert.strictEqual(uppercase.subItems.length, 2); - }, - - eof2: async () => { - const lines = [ - ` D UPPERCASE PR 4096 Varying`, - ` D String 4096 Const Varying`, - ` D Escaped n Const Options(*NoPass)`, - ` /EoF`, - ``, - ` D LOWERCASE PR 4096 Varying`, - ` D String 4096 Const Varying`, - ` D Escaped n Const Options(*NoPass)`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - assert.strictEqual(cache.procedures.length, 1); - - const uppercase = cache.find(`UPPERCASE`); - assert.strictEqual(uppercase.name, `UPPERCASE`); - assert.strictEqual(uppercase.position.line, 0); - assert.strictEqual(uppercase.subItems.length, 2); - }, - - /** - * Similar to linter18 test - */ - eof3: async () => { - const lines = [ - `**FREE`, - `Dcl-s MyVariable2 Char(20);`, - ``, - `theProcedure();`, - `Dsply MyVariable2;`, - ``, - `Dcl-Proc theProcedure;`, - ` Dcl-S mylocal char(20);`, - ` MyVariable2 = 'Hello world';`, - ` mylocal = Myvariable2;`, - `End-Proc;`, - ``, - `/eof`, - ``, - `Dcl-Proc theProcedure2;`, - ` Dcl-S mylocal char(20);`, - ` MyVariable2 = 'Hello world';`, - ` mylocal = Myvariable2;`, - `End-Proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({uri, content: lines}, { - NoGlobalsInProcedures: true - }, cache); - - assert.strictEqual(cache.procedures.length, 1); - assert.strictEqual(errors.length, 2); - }, - - eof4: async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DftActGrp(*No);`, - ``, - `/copy './tests/rpgle/eof4.rpgle'`, - ``, - `Dcl-s MyVariable2 Char(20);`, - ``, - `CallP UPPERCASE(myVariable:*on);`, - ``, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); - - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - - const uppercase = cache.find(`UPPERCASE`); - - assert.strictEqual(uppercase.subItems.length, 2, `Expect length of 2`); - - const baseNameInclude = path.basename(uppercase.position.path); - assert.strictEqual(baseNameInclude, `eof4.rpgle`, `Path is incorrect`); - assert.strictEqual(uppercase.position.line, 0, `Index of 0 expected`); - }, - - - /** - * EOF inside of IF directive - */ - eof5_issue181: async () => { - const lines = [ - `**FREE`, - ``, - `/IF DEFINED(ABCEEF)`, - `/eof`, - `/EndIf`, - `/DEFINE ABCEEF`, - - `CallP THEPROCEDURE2;`, - ``, - `Dcl-Proc theProcedure2;`, - ` Dcl-S mylocal char(20);`, - ` MyVariable2 = 'Hello world';`, - ` mylocal = Myvariable2;`, - `End-Proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({uri, content: lines}, { - IncorrectVariableCase: true - }, cache); - - assert.strictEqual(cache.procedures.length, 1); - const theProcedure2 = cache.find(`theProcedure2`); - assert.strictEqual(theProcedure2.name, `theProcedure2`); - - assert.strictEqual(errors.length, 1); - }, - - incorrectEnd1: async () => { - const lines = [ - `Dcl-S Text Char(52);`, - ``, - `Text = 'Hello world';`, - ``, - `End-Proc;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - const { errors } = Linter.getErrors({uri, content: lines}, { - PrettyComments: true - }, cache); - - assert.deepStrictEqual(errors[0], { - offset: { position: 45, end: 53 }, type: `UnexpectedEnd` - }); - - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `End-Proc`); - }, - - incorrectEnd2: async () => { - const lines = [ - `**free`, - ``, - `dcl-proc *inzsr;`, - ` dsply 'hello world';`, - `endsr;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - const { errors } = Linter.getErrors({uri, content: lines}, { - PrettyComments: true - }, cache); - - assert.deepStrictEqual(errors[0], { - offset: { position: 48, end: 53 }, type: `UnexpectedEnd` - }); - - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `endsr`); - }, - - incorrectEnd3: async () => { - const lines = [ - `**free`, - ``, - `begsr hello;`, - ` dsply 'hello world';`, - `end-proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - const { errors } = Linter.getErrors({uri, content: lines}, { - PrettyComments: true - }, cache); - - assert.deepStrictEqual(errors[0], { - offset: { position: 44, end: 52 }, type: `UnexpectedEnd` - }); - - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `end-proc`); - }, - - incorrectEnd4: async () => { - const lines = [ - `**FREE`, - `Dcl-s MyVariable2 Char(20);`, - ``, - `theProcedure();`, - `Dsply MyVariable2;`, - ``, - `Dcl-Proc theProcedure;`, - ` Exsr theSubroutine;`, - ` Begsr theSubroutine;`, - ` MyVariable2 = 'Hello world';`, - ` // Endsr;`, - `End-Proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - const { errors } = Linter.getErrors({uri, content: lines}, { - PrettyComments: true - }, cache); - - assert.deepStrictEqual(errors[0], { - offset: { position: 187, end: 195 }, type: `UnexpectedEnd` - }); - }, - - if1: async () => { - const lines = [ - `**FREE`, - `// Function Return Param Definitions`, - `Dcl-Ds Prp00a Qualified`, - `/IF DEFINED(PRP00A_TEMPLATE_ALL_DS)`, - ` Template`, - `/ENDIF`, - `;`, - ` Address Char(220);`, - ` Emp Packed(6);`, - ` Empname Char(60);`, - ` Phone_w_errm Char(95);`, - ` Phone Char(15) Overlay(Phone_w_errm :1);`, - ` Zipcode_w_errm Char(90);`, - ` Zipcode Char(10) Overlay(Zipcode_w_errm :1);`, - `End-Ds;`, - ``, - `Dcl-Ds Tmplt_EmpFmtAddress Qualified Template;`, - ` Name Char(60);`, - ` Addr1 Char(40);`, - ` Addr2 Char(40);`, - ` Addr3 Char(40);`, - ` Addr4 Char(40);`, - `End-Ds;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - assert.strictEqual(cache.structs.length, 2); - - const Prp00a = cache.find(`Prp00a`); - assert.strictEqual(Prp00a.subItems.length, 7); - assert.strictEqual(Prp00a.keyword[`QUALIFIED`], true); - assert.strictEqual(Prp00a.keyword[`TEMPLATE`], undefined); - }, - - if2: async () => { - const lines = [ - ` D ObjNam s 10a`, - ` d someDs ds`, - ` /IF DEFINED(RPGBNV)`, - ` d based(somepointer)`, - ` /ENDIF`, - ` d xxxxxx 10i 0`, - ` d xxxxxxxx 10i 0`, - ` d xxxxxx 20i 0`, - ` d xxx 10i 0`, - ` d xxxxx 10i 0`, - ` d yyyyy 10i 0`, - ` d zzzzz 10i 0`, - ` d fffffff N`, - ` d jjjjj N`, - ` d jjjjjjj N`, - ` d mmmmm 10`, - ` d cccccc 3`, - ` d bbbbbbd 10i 0`, - ` d dddd 10i 0`, - ` d ddddd 10i 0`, - ` d bbbbb 10i 0`, - ` d ccc 10i 0`, - ` d bbbwee 7`, - ` d fffbb 10i 0`, - ` d ff 1024a`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - - assert.strictEqual(cache.structs.length, 1); - - const someDs = cache.find(`someDs`); - assert.strictEqual(someDs.keyword[`BASED`], undefined); - }, - - variable_case1: async () => { - const lines = [ - `**FREE`, - `Ctl-Opt DftActGrp(*No);`, - `/copy './tests/rpgle/copy3.rpgle'`, - `Dcl-S MyCustomerName1 like(customername_t);`, - `Dcl-S MyCustomerName2 like(CustomerName_t);`, - `Dcl-S MyCustomerName3 like(CUSTOMERNAME_t);`, - `Dcl-S MyCustomerName4 like(CUSTOMERNAME_T);`, - `MyCustomerName1 = 'John Smith';`, - `dsply MyCustomerName1;`, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - IncorrectVariableCase: true - }, cache); - - assert.strictEqual(errors.length, 3, `Expect length of 3`); - - assert.deepStrictEqual(errors[0], { - offset: { position: 92, end: 106 }, - type: `IncorrectVariableCase`, - newValue: `CustomerName_t` - }); - - assert.deepStrictEqual(errors[1], { - offset: { position: 180, end: 194 }, - type: `IncorrectVariableCase`, - newValue: `CustomerName_t` - }); - - assert.deepStrictEqual(errors[2], { - offset: { position: 224, end: 238 }, - type: `IncorrectVariableCase`, - newValue: `CustomerName_t` - }); - }, - - uppercase1: async () => { - const lines = [ - `**FREE`, - `Ctl-Opt DftActGrp(*No);`, - `/copy './tests/rpgle/copy1.rpgle'`, - `/Copy './tests/rpgle/copy2.rpgle'`, - `/COPY './tests/rpgle/copy3.rpgle'`, - `Dcl-S MyCustomerName1 like(CustomerName_t);`, - `MyCustomerName1 = 'John Smith';`, - `dsply MyCustomerName1;`, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - DirectiveCasing: `upper` - }, cache); - - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.deepStrictEqual(errors[0], { - offset: { position: 31, end: 36 }, - type: `DirectiveCasing`, - newValue: `/COPY` - }); - - assert.deepStrictEqual(errors[1], { - offset: { position: 65, end: 70 }, - type: `DirectiveCasing`, - newValue: `/COPY` - }); - }, - - uppercase2: async () => { - const lines = [ - `**FREE`, - `Ctl-Opt DftActGrp(*No);`, - `/copy './tests/rpgle/copy1.rpgle'`, - `/Copy './tests/rpgle/copy2.rpgle'`, - `/COPY './tests/rpgle/copy3.rpgle'`, - `Dcl-S MyCustomerName1 like(CustomerName_t);`, - `MyCustomerName1 = 'John Smith';`, - `dsply MyCustomerName1;`, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - UppercaseDirectives: true - }, cache); - - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.deepStrictEqual(errors[0], { - offset: { position: 31, end: 36 }, - type: `UppercaseDirectives`, - newValue: `/COPY` - }); - - assert.deepStrictEqual(errors[1], { - offset: { position: 65, end: 70 }, - type: `UppercaseDirectives`, - newValue: `/COPY` - }); - }, - - lowercase1: async () => { - const lines = [ - `**FREE`, - `Ctl-Opt DftActGrp(*No);`, - `/copy './tests/rpgle/copy1.rpgle'`, - `/Copy './tests/rpgle/copy2.rpgle'`, - `/COPY './tests/rpgle/copy3.rpgle'`, - `Dcl-S MyCustomerName1 like(CustomerName_t);`, - `MyCustomerName1 = 'John Smith';`, - `dsply MyCustomerName1;`, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - DirectiveCasing: `lower` - }, cache); - - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.deepStrictEqual(errors[0], { - offset: { position: 65, end: 70 }, - type: `DirectiveCasing`, - newValue: `/copy` - }); - - assert.deepStrictEqual(errors[1], { - offset: { position: 99, end: 104 }, - type: `DirectiveCasing`, - newValue: `/copy` - }); - } -} \ No newline at end of file diff --git a/tests/suite/directives.test.ts b/tests/suite/directives.test.ts new file mode 100644 index 00000000..c5f92878 --- /dev/null +++ b/tests/suite/directives.test.ts @@ -0,0 +1,602 @@ +import path from "path"; +import setupParser from "../parserSetup"; +import Linter from "../../language/linter"; +import { test, expect } from "vitest"; + +const parser = setupParser(); +const uri = `source.rpgle`; + +test('skip1', async () => { + const lines = [ + `**free`, + ``, + `/copy myds.ds`, + `end-ds;`, + ``, + `dsply thingy;`, + ``, + `return`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { indentErrors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + + expect(cache.includes.length).toBe(0); // Because it's not found. + expect(indentErrors.length > 0).toBe(true); +}) + +test('skip2', async () => { + const lines = [ + `**free`, + ``, + `/copy myds.ds`, + `// @rpglint-skip`, + `end-ds;`, + ``, + `dsply thingy;`, + ``, + `return`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { indentErrors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + + expect(cache.includes.length).toBe(0); // Because it's not found. + expect(indentErrors.length).toBe(0); +}) + +test('skip2_issue91_1', async () => { + const lines = [ + `**free`, + ``, + `/copy myds.ds`, + `// @rpglint-skip-indent`, + `end-ds;`, + ``, + `dsply thingy;`, + ``, + `return`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { indentErrors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + + expect(cache.includes.length).toBe(0); // Because it's not found. + expect(indentErrors.length).toBe(0); +}) + +test('skip2_issue91_2', async () => { + const lines = [ + `**free`, + ``, + `/copy myds.ds`, + `// @rpglint-skip-rules`, + `end-ds;`, + ``, + `dsply thingy;`, + ``, + `return`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { indentErrors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + + expect(cache.includes.length).toBe(0); // Because it's not found. + expect(indentErrors.length).toBe(3); +}) + +test('skip2_issue91', async () => { + const lines = [ + `**FREE`, + ``, + `/IF DEFINED(ABCEEF)`, + `/eof`, + `/EndIf`, + `/DEFINE ABCEEF`, + + `// @rpglint-skip-rules`, + `CallP THEPROCEDURE2;`, + ``, + `Dcl-Proc theProcedure2;`, + ` Dcl-S mylocal char(20);`, + ` MyVariable2 = 'Hello world';`, + ` mylocal = Myvariable2;`, + `End-Proc;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + IncorrectVariableCase: true + }, cache); + + expect(cache.procedures.length).toBe(1); + const theProcedure2 = cache.find(`theProcedure2`); + expect(theProcedure2.name).toBe(`theProcedure2`); + + expect(errors.length).toBe(0); +}) + + +test('skip3', async () => { + const lines = [ + `**free`, + `dcl-s xxField1 char(1);`, + ``, + `// @rpglint-skip`, + `/copy myds.ds`, + ``, + `dsply xxfield1;`, + ``, + `return`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + IncorrectVariableCase: true + }, cache); + + expect(cache.includes.length).toBe(0); // Because it's not found. + expect(errors.length).toBe(1); +}) + +test('eof1', async () => { + const lines = [ + ` D UPPERCASE PR 4096 Varying`, + ` D String 4096 Const Varying`, + ` D Escaped n Const Options(*NoPass)`, + ` /EoF`, + ` Converts all of the letters in String to their`, + ` UPPER CASE equivalents. Non-alphabetic characters`, + ` remain unchanged.`, + ``, + ` Escaped = *ON = converts characters that would crash iPDF and`, + ` HTML to approximately equivalent characters.`, + ` For example, translate " and ' to \` .`, + ` (Default)`, + ` *OFF= Do not convert any characters other than A-Z.`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + const uppercase = cache.find(`UPPERCASE`); + expect(uppercase.name).toBe(`UPPERCASE`); + expect(uppercase.position.line).toBe(0); + expect(uppercase.subItems.length).toBe(2); +}) + +test('eof2', async () => { + const lines = [ + ` D UPPERCASE PR 4096 Varying`, + ` D String 4096 Const Varying`, + ` D Escaped n Const Options(*NoPass)`, + ` /EoF`, + ``, + ` D LOWERCASE PR 4096 Varying`, + ` D String 4096 Const Varying`, + ` D Escaped n Const Options(*NoPass)`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + expect(cache.procedures.length).toBe(1); + + const uppercase = cache.find(`UPPERCASE`); + expect(uppercase.name).toBe(`UPPERCASE`); + expect(uppercase.position.line).toBe(0); + expect(uppercase.subItems.length).toBe(2); +}) + +/** + * Similar to linter18 test + */ +test('eof3', async () => { + const lines = [ + `**FREE`, + `Dcl-s MyVariable2 Char(20);`, + ``, + `theProcedure();`, + `Dsply MyVariable2;`, + ``, + `Dcl-Proc theProcedure;`, + ` Dcl-S mylocal char(20);`, + ` MyVariable2 = 'Hello world';`, + ` mylocal = Myvariable2;`, + `End-Proc;`, + ``, + `/eof`, + ``, + `Dcl-Proc theProcedure2;`, + ` Dcl-S mylocal char(20);`, + ` MyVariable2 = 'Hello world';`, + ` mylocal = Myvariable2;`, + `End-Proc;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + NoGlobalsInProcedures: true + }, cache); + + expect(cache.procedures.length).toBe(1); + expect(errors.length).toBe(2); +}) + +test('eof4', async () => { + const lines = [ + `**FREE`, + ``, + `Ctl-Opt DftActGrp(*No);`, + ``, + `/copy './tests/rpgle/eof4.rpgle'`, + ``, + `Dcl-s MyVariable2 Char(20);`, + ``, + `CallP UPPERCASE(myVariable:*on);`, + ``, + `Return;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); + + expect(cache.variables.length).toBe(1); + expect(cache.procedures.length).toBe(1); + + const uppercase = cache.find(`UPPERCASE`); + + expect(uppercase.subItems.length).toBe(2); + + const baseNameInclude = path.basename(uppercase.position.path); + expect(baseNameInclude).toBe(`eof4.rpgle`); + expect(uppercase.position.line).toBe(0); +}) + + +/** + * EOF inside of IF directive + */ +test('eof5_issue181', async () => { + const lines = [ + `**FREE`, + ``, + `/IF DEFINED(ABCEEF)`, + `/eof`, + `/EndIf`, + `/DEFINE ABCEEF`, + + `CallP THEPROCEDURE2;`, + ``, + `Dcl-Proc theProcedure2;`, + ` Dcl-S mylocal char(20);`, + ` MyVariable2 = 'Hello world';`, + ` mylocal = Myvariable2;`, + `End-Proc;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + IncorrectVariableCase: true + }, cache); + + expect(cache.procedures.length).toBe(1); + const theProcedure2 = cache.find(`theProcedure2`); + expect(theProcedure2.name).toBe(`theProcedure2`); + + expect(errors.length).toBe(1); +}) + +test('incorrectEnd1', async () => { + const lines = [ + `Dcl-S Text Char(52);`, + ``, + `Text = 'Hello world';`, + ``, + `End-Proc;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + const { errors } = Linter.getErrors({ uri, content: lines }, { + PrettyComments: true + }, cache); + + expect(errors[0]).toEqual({ + offset: { position: 45, end: 53 }, type: `UnexpectedEnd` + }); + + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`End-Proc`); +}) + +test('incorrectEnd2', async () => { + const lines = [ + `**free`, + ``, + `dcl-proc *inzsr;`, + ` dsply 'hello world';`, + `endsr;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + const { errors } = Linter.getErrors({ uri, content: lines }, { + PrettyComments: true + }, cache); + + expect(errors[0]).toEqual({ + offset: { position: 48, end: 53 }, type: `UnexpectedEnd` + }); + + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`endsr`); +}) + +test('incorrectEnd3', async () => { + const lines = [ + `**free`, + ``, + `begsr hello;`, + ` dsply 'hello world';`, + `end-proc;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + const { errors } = Linter.getErrors({ uri, content: lines }, { + PrettyComments: true + }, cache); + + expect(errors[0]).toEqual({ + offset: { position: 44, end: 52 }, type: `UnexpectedEnd` + }); + + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`end-proc`); +}) + +test('incorrectEnd4', async () => { + const lines = [ + `**FREE`, + `Dcl-s MyVariable2 Char(20);`, + ``, + `theProcedure();`, + `Dsply MyVariable2;`, + ``, + `Dcl-Proc theProcedure;`, + ` Exsr theSubroutine;`, + ` Begsr theSubroutine;`, + ` MyVariable2 = 'Hello world';`, + ` // Endsr;`, + `End-Proc;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + const { errors } = Linter.getErrors({ uri, content: lines }, { + PrettyComments: true + }, cache); + + expect(errors[0]).toEqual({ + offset: { position: 187, end: 195 }, type: `UnexpectedEnd` + }); +}) + +test('if1', async () => { + const lines = [ + `**FREE`, + `// Function Return Param Definitions`, + `Dcl-Ds Prp00a Qualified`, + `/IF DEFINED(PRP00A_TEMPLATE_ALL_DS)`, + ` Template`, + `/ENDIF`, + `;`, + ` Address Char(220);`, + ` Emp Packed(6);`, + ` Empname Char(60);`, + ` Phone_w_errm Char(95);`, + ` Phone Char(15) Overlay(Phone_w_errm :1);`, + ` Zipcode_w_errm Char(90);`, + ` Zipcode Char(10) Overlay(Zipcode_w_errm :1);`, + `End-Ds;`, + ``, + `Dcl-Ds Tmplt_EmpFmtAddress Qualified Template;`, + ` Name Char(60);`, + ` Addr1 Char(40);`, + ` Addr2 Char(40);`, + ` Addr3 Char(40);`, + ` Addr4 Char(40);`, + `End-Ds;`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + expect(cache.structs.length).toBe(2); + + const Prp00a = cache.find(`Prp00a`); + expect(Prp00a.subItems.length).toBe(7); + expect(Prp00a.keyword[`QUALIFIED`]).toBe(true); + expect(Prp00a.keyword[`TEMPLATE`]).toBeUndefined(); +}) + +test('if2', async () => { + const lines = [ + ` D ObjNam s 10a`, + ` d someDs ds`, + ` /IF DEFINED(RPGBNV)`, + ` d based(somepointer)`, + ` /ENDIF`, + ` d xxxxxx 10i 0`, + ` d xxxxxxxx 10i 0`, + ` d xxxxxx 20i 0`, + ` d xxx 10i 0`, + ` d xxxxx 10i 0`, + ` d yyyyy 10i 0`, + ` d zzzzz 10i 0`, + ` d fffffff N`, + ` d jjjjj N`, + ` d jjjjjjj N`, + ` d mmmmm 10`, + ` d cccccc 3`, + ` d bbbbbbd 10i 0`, + ` d dddd 10i 0`, + ` d ddddd 10i 0`, + ` d bbbbb 10i 0`, + ` d ccc 10i 0`, + ` d bbbwee 7`, + ` d fffbb 10i 0`, + ` d ff 1024a`, + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + + expect(cache.structs.length).toBe(1); + + const someDs = cache.find(`someDs`); + expect(someDs.keyword[`BASED`]).toBeUndefined(); +}) + +test('variable_case1', async () => { + const lines = [ + `**FREE`, + `Ctl-Opt DftActGrp(*No);`, + `/copy './tests/rpgle/copy3.rpgle'`, + `Dcl-S MyCustomerName1 like(customername_t);`, + `Dcl-S MyCustomerName2 like(CustomerName_t);`, + `Dcl-S MyCustomerName3 like(CUSTOMERNAME_t);`, + `Dcl-S MyCustomerName4 like(CUSTOMERNAME_T);`, + `MyCustomerName1 = 'John Smith';`, + `dsply MyCustomerName1;`, + `Return;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + IncorrectVariableCase: true + }, cache); + + expect(errors.length).toBe(3); + + expect(errors[0]).toEqual({ + offset: { position: 92, end: 106 }, + type: `IncorrectVariableCase`, + newValue: `CustomerName_t` + }); + + expect(errors[1]).toEqual({ + offset: { position: 180, end: 194 }, + type: `IncorrectVariableCase`, + newValue: `CustomerName_t` + }); + + expect(errors[2]).toEqual({ + offset: { position: 224, end: 238 }, + type: `IncorrectVariableCase`, + newValue: `CustomerName_t` + }); +}) + +test('uppercase1', async () => { + const lines = [ + `**FREE`, + `Ctl-Opt DftActGrp(*No);`, + `/copy './tests/rpgle/copy1.rpgle'`, + `/Copy './tests/rpgle/copy2.rpgle'`, + `/COPY './tests/rpgle/copy3.rpgle'`, + `Dcl-S MyCustomerName1 like(CustomerName_t);`, + `MyCustomerName1 = 'John Smith';`, + `dsply MyCustomerName1;`, + `Return;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + DirectiveCasing: `upper` + }, cache); + + expect(errors.length).toBe(2); + + expect(errors[0]).toEqual({ + offset: { position: 31, end: 36 }, + type: `DirectiveCasing`, + newValue: `/COPY` + }); + + expect(errors[1]).toEqual({ + offset: { position: 65, end: 70 }, + type: `DirectiveCasing`, + newValue: `/COPY` + }); +}) + +test('uppercase2', async () => { + const lines = [ + `**FREE`, + `Ctl-Opt DftActGrp(*No);`, + `/copy './tests/rpgle/copy1.rpgle'`, + `/Copy './tests/rpgle/copy2.rpgle'`, + `/COPY './tests/rpgle/copy3.rpgle'`, + `Dcl-S MyCustomerName1 like(CustomerName_t);`, + `MyCustomerName1 = 'John Smith';`, + `dsply MyCustomerName1;`, + `Return;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + UppercaseDirectives: true + }, cache); + + expect(errors.length).toBe(2); + + expect(errors[0]).toEqual({ + offset: { position: 31, end: 36 }, + type: `UppercaseDirectives`, + newValue: `/COPY` + }); + + expect(errors[1]).toEqual({ + offset: { position: 65, end: 70 }, + type: `UppercaseDirectives`, + newValue: `/COPY` + }); +}) + +test('lowercase1', async () => { + const lines = [ + `**FREE`, + `Ctl-Opt DftActGrp(*No);`, + `/copy './tests/rpgle/copy1.rpgle'`, + `/Copy './tests/rpgle/copy2.rpgle'`, + `/COPY './tests/rpgle/copy3.rpgle'`, + `Dcl-S MyCustomerName1 like(CustomerName_t);`, + `MyCustomerName1 = 'John Smith';`, + `dsply MyCustomerName1;`, + `Return;` + ].join(`\n`); + + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); + const { errors } = Linter.getErrors({ uri, content: lines }, { + DirectiveCasing: `lower` + }, cache); + + expect(errors.length).toBe(2); + + expect(errors[0]).toEqual({ + offset: { position: 65, end: 70 }, + type: `DirectiveCasing`, + newValue: `/copy` + }); + + expect(errors[1]).toEqual({ + offset: { position: 99, end: 104 }, + type: `DirectiveCasing`, + newValue: `/copy` + }); +}) \ No newline at end of file diff --git a/tests/suite/docs.js b/tests/suite/docs.test.ts similarity index 76% rename from tests/suite/docs.js rename to tests/suite/docs.test.ts index b1b642d1..a7b81a81 100644 --- a/tests/suite/docs.js +++ b/tests/suite/docs.test.ts @@ -1,13 +1,12 @@ -const assert = require(`assert`); +import setupParser from "../parserSetup"; +import Linter from "../../language/linter"; +import { test, expect } from "vitest"; -const { default: parserSetup } = require(`../parserSetup`); -const { default: Linter } = require(`../../language/linter`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; -exports.issue_202 = async () => { +test("issue_202", async () => { const lines = [ `**free`, `///`, @@ -30,24 +29,24 @@ exports.issue_202 = async () => { const toLower = cache.find(`ToLower`); - assert.strictEqual(toLower.description, `This procedure will take a string and transform it to lowercase`); + expect(toLower.description).toBe(`This procedure will take a string and transform it to lowercase`); const tags = toLower.tags; - assert.deepStrictEqual(tags[0], { + expect(tags[0]).toEqual({ tag: `param`, content: `The string` }); - assert.deepStrictEqual(tags[1], { + expect(tags[1]).toEqual({ tag: `return`, content: `The lowercase value` }); const stringInParam = toLower.subItems[0]; - assert.strictEqual(stringInParam.description, `The string`); -} + expect(stringInParam.description).toBe(`The string`); +}); -exports.issue_231 = async () => { +test("issue_231", async () => { const lines = [ `**FREE`, `Ctl-Opt Main(MainLine);`, @@ -86,6 +85,6 @@ exports.issue_231 = async () => { PrettyComments: true, }, cache); - assert.strictEqual(indentErrors.length, 0); - assert.strictEqual(errors.length, 0); -} \ No newline at end of file + expect(indentErrors.length).toBe(0); + expect(errors.length).toBe(0); +}); \ No newline at end of file diff --git a/tests/suite/editing.js b/tests/suite/editing.test.ts similarity index 94% rename from tests/suite/editing.js rename to tests/suite/editing.test.ts index 4037024e..c2c9a6e8 100644 --- a/tests/suite/editing.js +++ b/tests/suite/editing.test.ts @@ -1,7 +1,11 @@ -const { default: parserSetup } = require(`../parserSetup`); + +import setupParser from "../parserSetup"; +import { test, expect } from "vitest"; + +const parser = setupParser(); const uri = `source.rpgle`; -exports.edit1 = async () => { +test("edit1", async () => { const lines = [ ` H ALTSEQ(*EXT) CURSYM('$') DATEDIT(*MDY) DATFMT(*MDY/) DEBUG(*YES)`, ` H DECEDIT('.') FORMSALIGN(*YES) FTRANS(*SRC) DFTNAME(name)`, @@ -27,8 +31,6 @@ exports.edit1 = async () => { let currentDoc = ``; - const parser = parserSetup(); - for (const char of lines) { currentDoc += char; @@ -36,9 +38,9 @@ exports.edit1 = async () => { ignoreCache: true }); } -} +}); -exports.edit2 = async () => { +test("edit2", async () => { const lines = [ `**free`, `Ctl-opt datfmt(*iso) timfmt(*iso) alwnull(*usrctl) debug;`, @@ -84,8 +86,6 @@ exports.edit2 = async () => { let currentDoc = ``; - const parser = parserSetup(); - for (const char of lines) { currentDoc += char; @@ -93,9 +93,9 @@ exports.edit2 = async () => { ignoreCache: true }); } -} +}); -exports.edit3 = async () => { +test("edit3", async () => { const lines = [ ` * Field Definitions.`, ` * ~~~~~~~~~~~~~~~~~~~~~~~~`, @@ -153,7 +153,7 @@ exports.edit3 = async () => { let currentDoc = ``; - const parser = parserSetup(); + const parser = setupParser(); for (const char of lines) { currentDoc += char; @@ -162,4 +162,4 @@ exports.edit3 = async () => { ignoreCache: true }); } -} \ No newline at end of file +}); \ No newline at end of file diff --git a/tests/suite/files.js b/tests/suite/files.test.ts similarity index 51% rename from tests/suite/files.js rename to tests/suite/files.test.ts index a2673118..dd31364e 100644 --- a/tests/suite/files.js +++ b/tests/suite/files.test.ts @@ -1,12 +1,12 @@ -const assert = require(`assert`); +import path from "path"; +import setupParser from "../parserSetup"; +import { test, expect } from "vitest"; -const {default: parserSetup} = require(`../parserSetup`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; -exports.simple_file = async () => { +test("simple_file", async () => { const lines = [ `**free`, ``, @@ -19,27 +19,27 @@ exports.simple_file = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.files.length, 1); - assert.strictEqual(cache.structs.length, 0); + expect(cache.files.length).toBe(1); + expect(cache.structs.length).toBe(0); const fileDef = cache.find(`employee`); - assert.strictEqual(fileDef.name, `employee`); - assert.strictEqual(fileDef.keyword[`DISK`], true); - assert.strictEqual(fileDef.keyword[`USAGE`], `*INPUT`); + expect(fileDef.name).toBe(`employee`); + expect(fileDef.keyword[`DISK`]).toBe(true); + expect(fileDef.keyword[`USAGE`]).toBe(`*INPUT`); // file record formats should be expanded into the subitems - assert.strictEqual(fileDef.subItems.length, 1); + expect(fileDef.subItems.length).toBe(1); const empRdcFmt = fileDef.subItems[0]; - assert.strictEqual(empRdcFmt.name, `EMPLOYEE`); + expect(empRdcFmt.name).toBe(`EMPLOYEE`); - assert.strictEqual(empRdcFmt.subItems[1].keywords[0], `VARCHAR(12)`); + expect(empRdcFmt.subItems[1].keywords[0]).toBe(`VARCHAR(12)`); // 14 fields inside of this record format - assert.strictEqual(empRdcFmt.subItems.length, 14); -}; + expect(empRdcFmt.subItems.length).toBe(14); +}); -exports.many_formats = async () => { +test("many_formats", async () => { const lines = [ `**free`, ``, @@ -52,25 +52,25 @@ exports.many_formats = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.files.length, 1); + expect(cache.files.length).toBe(1); const fileDef = cache.find(`emps`); - assert.strictEqual(fileDef.name, `emps`); - assert.strictEqual(fileDef.keyword[`WORKSTN`], true); + expect(fileDef.name).toBe(`emps`); + expect(fileDef.keyword[`WORKSTN`]).toBe(true); // file record formats should be expanded into the subitems - assert.strictEqual(fileDef.subItems.length, 2); + expect(fileDef.subItems.length).toBe(2); const sfldta = fileDef.subItems[0]; - assert.strictEqual(sfldta.name, `SFLDTA`); - assert.strictEqual(sfldta.subItems.length, 5); + expect(sfldta.name).toBe(`SFLDTA`); + expect(sfldta.subItems.length).toBe(5); const sflctl = fileDef.subItems[1]; - assert.strictEqual(sflctl.name, `SFLCTL`); - assert.strictEqual(sflctl.subItems.length, 1); -}; + expect(sflctl.name).toBe(`SFLCTL`); + expect(sflctl.subItems.length).toBe(1); +}); -exports.ds_extname = async () => { +test("ds_extname", async () => { const lines = [ `**free`, ``, @@ -84,15 +84,15 @@ exports.ds_extname = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.files.length, 0); - assert.strictEqual(cache.structs.length, 1); + expect(cache.files.length).toBe(0); + expect(cache.structs.length).toBe(1); const structDef = cache.find(`employee`); - assert.strictEqual(structDef.name, `Employee`); - assert.strictEqual(structDef.subItems.length, 14); -}; + expect(structDef.name).toBe(`Employee`); + expect(structDef.subItems.length).toBe(14); +}); -exports.ds_extname_no_alias = async () => { +test("ds_extname_no_alias", async () => { const lines = [ `**free`, ``, @@ -106,17 +106,17 @@ exports.ds_extname_no_alias = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.files.length, 0); - assert.strictEqual(cache.structs.length, 1); + expect(cache.files.length).toBe(0); + expect(cache.structs.length).toBe(1); const dept = cache.find(`dept`); - assert.strictEqual(dept.subItems.length, 5); + expect(dept.subItems.length).toBe(5); - assert.strictEqual(dept.subItems[0].name, `DEPTNO`); - assert.strictEqual(dept.subItems[1].name, `DEPTNAME`); -} + expect(dept.subItems[0].name).toBe(`DEPTNO`); + expect(dept.subItems[1].name).toBe(`DEPTNAME`); +}); -exports.ds_extname_alias = async () => { +test("ds_extname_alias", async () => { const lines = [ `**free`, ``, @@ -130,17 +130,17 @@ exports.ds_extname_alias = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); - assert.strictEqual(cache.files.length, 0); - assert.strictEqual(cache.structs.length, 1); + expect(cache.files.length).toBe(0); + expect(cache.structs.length).toBe(1); const dept = cache.find(`dept`); - assert.strictEqual(dept.subItems.length, 5); + expect(dept.subItems.length).toBe(5); - assert.strictEqual(dept.subItems[0].name, `DEPTNO`); - assert.strictEqual(dept.subItems[1].name, `DEPTNAME`); -} + expect(dept.subItems[0].name).toBe(`DEPTNO`); + expect(dept.subItems[1].name).toBe(`DEPTNAME`); +}); -exports.file_prefix = async () => { +test("file_prefix", async () => { const lines = [ `**free`, ``, @@ -154,5 +154,5 @@ exports.file_prefix = async () => { const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); const disp = cache.find(`display`); - assert.strictEqual(disp.subItems[0].subItems[0].name, `DE1_OPTION`); -} + expect(disp.subItems[0].subItems[0].name).toBe(`DE1_OPTION`); +}); diff --git a/tests/suite/fixed.js b/tests/suite/fixed.test.ts similarity index 73% rename from tests/suite/fixed.js rename to tests/suite/fixed.test.ts index 31fcb6ff..88441337 100644 --- a/tests/suite/fixed.js +++ b/tests/suite/fixed.test.ts @@ -1,13 +1,12 @@ -const assert = require(`assert`); -const path = require(`path`); +import path from "path"; +import setupParser from "../parserSetup"; +import { test, expect } from "vitest"; -const {default: parserSetup} = require(`../parserSetup`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; - -exports.fixed1 = async () => { + +test('fixed1', async () => { const lines = [ ``, ` FINVMST IF E K DISK`, @@ -20,24 +19,24 @@ exports.fixed1 = async () => { ` C eval *inlr = *on`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.files.length, 1); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); + expect(cache.files.length).to.equal(1); + expect(cache.variables.length).to.equal(2); const wkCorp = cache.variables[0]; - assert.strictEqual(wkCorp.name, `wkCorp`); - assert.strictEqual(wkCorp.position.line, 3); - assert.strictEqual(wkCorp.keywords[0], `CHAR(10)`); - assert.strictEqual(wkCorp.keywords[1], `INZ('100')`); + expect(wkCorp.name).to.equal('wkCorp'); + expect(wkCorp.position.line).to.equal(3); + expect(wkCorp.keywords[0]).to.equal('CHAR(10)'); + expect(wkCorp.keywords[1]).to.equal(`INZ('100')`); const wkInvoice = cache.variables[1]; - assert.strictEqual(wkInvoice.name, `wkInvoice`); - assert.strictEqual(wkInvoice.position.line, 4); - assert.strictEqual(wkInvoice.keywords[0], `CHAR(15)`); -}; + expect(wkInvoice.name).to.equal('wkInvoice'); + expect(wkInvoice.position.line).to.equal(4); + expect(wkInvoice.keywords[0]).to.equal('CHAR(15)'); +}); -exports.fixed2 = async () => { +test('fixed2', async () => { const lines = [ ``, ` *`, @@ -60,19 +59,19 @@ exports.fixed2 = async () => { ` `, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 13, `Expect length of 13`); + expect(cache.variables.length).to.equal(13); const CHARFields = cache.variables.filter(v => v.keywords[0].startsWith(`CHAR`)); - assert.strictEqual(CHARFields.length, 12, `Expect length of 12`); + expect(CHARFields.length).to.equal(12); const countVar = cache.variables.find(v => v.name === `Count`); - assert.strictEqual(countVar.keywords[0], `PACKED(4:0)`); - assert.strictEqual(countVar.keyword[`PACKED`], `4:0`) -}; + expect(countVar.keywords[0]).to.equal(`PACKED(4:0)`); + expect(countVar.keyword[`PACKED`]).to.equal(`4:0`); +}); -exports.fixed3 = async () => { +test('fixed3', async () => { const lines = [ ` d Worktype s 10 INZ('*OUTQ')`, ``, @@ -87,27 +86,26 @@ exports.fixed3 = async () => { ` d MsgQueNbr 25 28B 0`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); + + expect(cache.variables.length).to.equal(1); + expect(cache.structs.length).to.equal(1); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.structs.length, 1, `Expect length of 1`); - const Worktype = cache.variables[0]; - assert.strictEqual(Worktype.name, `Worktype`); - assert.strictEqual(Worktype.position.line, 0); - assert.strictEqual(Worktype.keywords[0], `CHAR(10)`); - assert.strictEqual(Worktype.keywords[1], `INZ('*OUTQ')`); - assert.strictEqual(Worktype.keyword[`CHAR`], `10`); - assert.strictEqual(Worktype.keyword[`INZ`], `'*OUTQ'`); + expect(Worktype.name).to.equal('Worktype'); + expect(Worktype.position.line).to.equal(0); + expect(Worktype.keywords[0]).to.equal('CHAR(10)'); + expect(Worktype.keywords[1]).to.equal(`INZ('*OUTQ')`); + expect(Worktype.keyword[`CHAR`]).to.equal('10'); + expect(Worktype.keyword[`INZ`]).to.equal(`'*OUTQ'`); const DS = cache.structs[0]; - assert.strictEqual(DS.name, `*N`); - assert.strictEqual(DS.position.line, 3); - assert.strictEqual(DS.subItems.length, 7); - assert.strictEqual(DS.subItems.find(i => !i.keyword[`BINDEC`]), undefined); -}; + expect(DS.name).to.equal('*N'); + expect(DS.position.line).to.equal(3); + expect(DS.subItems.length).to.equal(7); +}); -exports.fixed4 = async () => { +test('fixed4', async () => { const lines = [ ``, ` d InType s 10`, @@ -127,26 +125,26 @@ exports.fixed4 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); - assert.strictEqual(cache.structs.length, 1, `Expect length of 1`); + expect(cache.variables.length).to.equal(2); + expect(cache.structs.length).to.equal(1); const InType = cache.find(`InType`); - assert.strictEqual(InType.name, `InType`); - assert.strictEqual(InType.position.line, 1); + expect(InType.name).to.equal(`InType`); + expect(InType.position.line).to.equal(1); const Worktype = cache.variables[1]; - assert.strictEqual(Worktype.name, `Worktype`); - assert.strictEqual(Worktype.position.line, 14); + expect(Worktype.name).to.equal(`Worktype`); + expect(Worktype.position.line).to.equal(14); const InputDs = cache.structs[0]; - assert.strictEqual(InputDs.name, `InputDs`); - assert.strictEqual(InputDs.position.line, 6); - assert.strictEqual(InputDs.subItems.length, 7); -}; + expect(InputDs.name).to.equal(`InputDs`); + expect(InputDs.position.line).to.equal(6); + expect(InputDs.subItems.length).to.equal(7); +}); -exports.fixed5 = async () => { +test('fixed5', async () => { const lines = [ ``, ` *`, @@ -187,21 +185,21 @@ exports.fixed5 = async () => { ` d InpRcdFmt 49 58`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); - assert.strictEqual(cache.structs.length, 2, `Expect length of 2`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); + expect(cache.variables.length).to.equal(2); + expect(cache.structs.length).to.equal(2); + expect(cache.procedures.length).to.equal(1); const RtvObjD = cache.procedures[0]; - assert.strictEqual(RtvObjD.name, `RtvObjD`); - assert.strictEqual(RtvObjD.position.line, 18); - assert.strictEqual(RtvObjD.keywords.join(` `).trim(), `EXTPGM( 'QUSROBJD' )`); - assert.strictEqual(RtvObjD.keyword[`EXTPGM`], `'QUSROBJD'`); - assert.strictEqual(RtvObjD.subItems.length, 6); -}; - -exports.fixed6 = async () => { + expect(RtvObjD.name).to.equal(`RtvObjD`); + expect(RtvObjD.position.line).to.equal(18); + expect(RtvObjD.keywords.join(` `).trim()).to.equal(`EXTPGM( 'QUSROBJD' )`); + expect(RtvObjD.keyword[`EXTPGM`]).to.equal(`'QUSROBJD'`); + expect(RtvObjD.subItems.length).to.equal(6); +}); + +test('fixed6', async () => { const lines = [ ``, `0.00 DDATE0 S D 130124`, @@ -215,34 +213,34 @@ exports.fixed6 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 8, `Expect length of 8`); + expect(cache.variables.length).to.equal(8); const lenVar = cache.find(`len`); - assert.strictEqual(lenVar.name, `len`); - assert.strictEqual(lenVar.position.line, 6); - assert.strictEqual(lenVar.keywords[0], `INT(5)`); - assert.strictEqual(lenVar.keyword[`INT`], `5`); + expect(lenVar.name).to.equal(`len`); + expect(lenVar.position.line).to.equal(6); + expect(lenVar.keywords[0]).to.equal(`INT(5)`); + expect(lenVar.keyword[`INT`]).to.equal(`5`); const date2Var = cache.find(`DATE2`); - assert.strictEqual(date2Var.name, `DATE2`); - assert.strictEqual(date2Var.position.line, 3); - assert.strictEqual(date2Var.keywords[0], `DATE`); - assert.strictEqual(date2Var.keyword[`DATE`], true); - assert.strictEqual(date2Var.keywords[1], `DATFMT(*JIS)`); - assert.strictEqual(date2Var.keyword[`DATFMT`], `*JIS`); + expect(date2Var.name).to.equal(`DATE2`); + expect(date2Var.position.line).to.equal(3); + expect(date2Var.keywords[0]).to.equal(`DATE`); + expect(date2Var.keyword[`DATE`]).to.equal(true); + expect(date2Var.keywords[1]).to.equal(`DATFMT(*JIS)`); + expect(date2Var.keyword[`DATFMT`]).to.equal(`*JIS`); const time0Var = cache.find(`TIME0`); - assert.strictEqual(time0Var.name, `TIME0`); - assert.strictEqual(time0Var.position.line, 7); - assert.strictEqual(time0Var.keywords[0], `TIME`); - assert.strictEqual(time0Var.keyword[`TIME`], true); - assert.strictEqual(time0Var.keywords[1], `INZ(T'10.12.15')`); - assert.strictEqual(time0Var.keyword[`INZ`], `T'10.12.15'`); -}; - -exports.fixed7 = async () => { + expect(time0Var.name).to.equal(`TIME0`); + expect(time0Var.position.line).to.equal(7); + expect(time0Var.keywords[0]).to.equal(`TIME`); + expect(time0Var.keyword[`TIME`]).to.equal(true); + expect(time0Var.keywords[1]).to.equal(`INZ(T'10.12.15')`); + expect(time0Var.keyword[`INZ`]).to.equal(`T'10.12.15'`); +}); + +test('fixed7', async () => { const lines = [ ``, ` // -----------------------`, @@ -261,21 +259,21 @@ exports.fixed7 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); + expect(cache.procedures.length).to.equal(1); const Obj_Next = cache.find(`Obj_Next`); - assert.strictEqual(Obj_Next.name, `Obj_Next`); - assert.strictEqual(Obj_Next.position.line, 3); - assert.strictEqual(Obj_Next.keywords.includes(`EXPORT`), true); - assert.strictEqual(Obj_Next.keyword[`EXPORT`], true); - assert.strictEqual(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`), true); - assert.strictEqual(Obj_Next.keyword[`LIKEDS`], `OBJECTDS`); - assert.strictEqual(Obj_Next.subItems.length, 0); -}; - -exports.fixed8 = async () => { + expect(Obj_Next.name).to.equal(`Obj_Next`); + expect(Obj_Next.position.line).to.equal(3); + expect(Obj_Next.keywords.includes(`EXPORT`)).to.equal(true); + expect(Obj_Next.keyword[`EXPORT`]).to.equal(true); + expect(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`)).to.equal(true); + expect(Obj_Next.keyword[`LIKEDS`]).to.equal(`OBJECTDS`); + expect(Obj_Next.subItems.length).to.equal(0); +}); + +test('fixed8', async () => { const lines = [ ``, ` **========================================================================`, @@ -326,14 +324,14 @@ exports.fixed8 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.subroutines.length, 2); - assert.strictEqual(cache.subroutines[0].name, `$QUSCRTUS`); - assert.strictEqual(cache.subroutines[1].name, `$QUSLMBR`); -}; + expect(cache.subroutines.length).to.equal(2); + expect(cache.subroutines[0].name).to.equal(`$QUSCRTUS`); + expect(cache.subroutines[1].name).to.equal(`$QUSLMBR`); +}); -exports.fixed9 = async () => { +test('fixed9', async () => { const lines = [ ``, ` // -----------------------`, @@ -354,28 +352,28 @@ exports.fixed9 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.procedures.length, 2); + expect(cache.includes.length).to.equal(1); + expect(cache.procedures.length).to.equal(2); const Obj_Next = cache.find(`Obj_Next`); - assert.strictEqual(Obj_Next.name, `Obj_Next`); - assert.strictEqual(Obj_Next.position.line, 5); - assert.strictEqual(Obj_Next.keywords.includes(`EXPORT`), true); - assert.strictEqual(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`), true); - assert.strictEqual(Obj_Next.keyword[`EXPORT`], true); - assert.strictEqual(Obj_Next.keyword[`LIKEDS`], `OBJECTDS`); - assert.strictEqual(Obj_Next.subItems.length, 0); + expect(Obj_Next.name).to.equal(`Obj_Next`); + expect(Obj_Next.position.line).to.equal(5); + expect(Obj_Next.keywords.includes(`EXPORT`)).to.equal(true); + expect(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`)).to.equal(true); + expect(Obj_Next.keyword[`EXPORT`]).to.equal(true); + expect(Obj_Next.keyword[`LIKEDS`]).to.equal(`OBJECTDS`); + expect(Obj_Next.subItems.length).to.equal(0); const theExtProcedure = cache.find(`theExtProcedure`); - assert.strictEqual(theExtProcedure.name, `theExtProcedure`); - assert.strictEqual(theExtProcedure.position.line, 2); - assert.strictEqual(theExtProcedure.keywords.includes(`EXTPROC`), true); - assert.strictEqual(theExtProcedure.subItems.length, 1); -}; + expect(theExtProcedure.name).to.equal(`theExtProcedure`); + expect(theExtProcedure.position.line).to.equal(2); + expect(theExtProcedure.keywords.includes(`EXTPROC`)).to.equal(true); + expect(theExtProcedure.subItems.length).to.equal(1); +}); -exports.fixed9_2 = async () => { +test('fixed9_2', async () => { const lines = [ ``, ` // -----------------------`, @@ -396,30 +394,28 @@ exports.fixed9_2 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.procedures.length, 2); + expect(cache.includes.length).to.equal(1); + expect(cache.procedures.length).to.equal(2); const Obj_Next = cache.find(`Obj_Next`); - assert.strictEqual(Obj_Next.name, `Obj_Next`); - assert.strictEqual(Obj_Next.position.line, 5); - assert.strictEqual(Obj_Next.keywords.includes(`EXPORT`), true); - assert.strictEqual(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`), true); - assert.strictEqual(Obj_Next.keyword[`EXPORT`], true); - assert.strictEqual(Obj_Next.keyword[`LIKEDS`], `OBJECTDS`); - assert.strictEqual(Obj_Next.subItems.length, 0); + expect(Obj_Next.name).to.equal(`Obj_Next`); + expect(Obj_Next.position.line).to.equal(5); + expect(Obj_Next.keywords.includes(`EXPORT`)).to.equal(true); + expect(Obj_Next.keywords.includes(`LIKEDS(OBJECTDS)`)).to.equal(true); + expect(Obj_Next.keyword[`EXPORT`]).to.equal(true); + expect(Obj_Next.keyword[`LIKEDS`]).to.equal(`OBJECTDS`); + expect(Obj_Next.subItems.length).to.equal(0); const theExtProcedure = cache.find(`theExtProcedure`); - assert.strictEqual(theExtProcedure.name, `theExtProcedure`); - assert.strictEqual(theExtProcedure.position.line, 2); - assert.strictEqual(theExtProcedure.keywords.includes(`EXTPROC`), true); - assert.strictEqual(theExtProcedure.subItems.length, 1); -}; + expect(theExtProcedure.name).to.equal(`theExtProcedure`); + expect(theExtProcedure.position.line).to.equal(2); + expect(theExtProcedure.keywords.includes(`EXTPROC`)).to.equal(true); + expect(theExtProcedure.subItems.length).to.equal(1); +}); - - -exports.fixed9_3 = async () => { +test('fixed9_3', async () => { const lines = [ ``, ` Ctl-Opt DftActGrp(*No);`, @@ -435,23 +431,20 @@ exports.fixed9_3 = async () => { ` Return;` ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {withIncludes: true, ignoreCache: true}); + const cache = await parser.getDocs(uri, lines, { withIncludes: true, ignoreCache: true }); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); + expect(cache.includes.length).to.equal(1); + expect(cache.variables.length).to.equal(1, `Expect length of 1`); + expect(cache.constants.length).to.equal(1, `Expect length of 1`); + expect(cache.procedures.length).to.equal(1, `Expect length of 1`); const uppercase = cache.find(`UPPERCASE`); const baseNameInclude = path.basename(uppercase.position.path); - assert.strictEqual(baseNameInclude, `eof4.rpgle`); -} + expect(baseNameInclude).to.equal(`eof4.rpgle`); +}); -/** - * Issue with detecting correct type on subfield. - */ -exports.fixed10 = async () => { +test('fixed10', async () => { const lines = [ ` d data ds inz`, ` d arid 6`, @@ -464,27 +457,27 @@ exports.fixed10 = async () => { ` return;`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); const dataDs = cache.find(`data`); - assert.strictEqual(dataDs.name, `data`); - assert.strictEqual(dataDs.subItems.length, 4); + expect(dataDs.name).to.equal(`data`); + expect(dataDs.subItems.length).to.equal(4); - assert.strictEqual(dataDs.range.start, 0); - assert.strictEqual(dataDs.range.end, 4); + expect(dataDs.range.start).to.equal(0); + expect(dataDs.range.end).to.equal(4); const rrn02 = cache.find(`rrn02`); - assert.strictEqual(rrn02.name, `rrn02`); - assert.strictEqual(rrn02.keywords.includes(`PACKED(7:2)`), true); - assert.strictEqual(rrn02.keyword[`PACKED`], `7:2`); + expect(rrn02.name).to.equal(`rrn02`); + expect(rrn02.keywords.includes(`PACKED(7:2)`)).to.equal(true); + expect(rrn02.keyword[`PACKED`]).to.equal(`7:2`); const arsalePr = dataDs.subItems[3]; - assert.strictEqual(arsalePr.name, `arsalePr`); - assert.strictEqual(arsalePr.keywords.includes(`ZONED(7:2)`), true); - assert.strictEqual(arsalePr.keyword[`ZONED`], `7:2`); -}; + expect(arsalePr.name).to.equal(`arsalePr`); + expect(arsalePr.keywords.includes(`ZONED(7:2)`)).to.equal(true); + expect(arsalePr.keyword[`ZONED`]).to.equal(`7:2`); +}); -exports.fixedfree1 = async () => { +test('fixedfree1', async () => { const lines = [ ` * Field Definitions.`, ` * ~~~~~~~~~~~~~~~~~~~~~~~~`, @@ -540,33 +533,33 @@ exports.fixedfree1 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); + + expect(cache.variables.length).to.equal(3); + expect(cache.variables.find(i => !i.keywords.includes(`CHAR(10)`))).to.be.undefined; - assert.strictEqual(cache.variables.length, 3); - assert.strictEqual(cache.variables.find(i => !i.keywords.includes(`CHAR(10)`)), undefined); + expect(cache.subroutines.length).to.equal(0); - assert.strictEqual(cache.subroutines.length, 0); + expect(cache.procedures.length).to.equal(1); - assert.strictEqual(cache.procedures.length, 1); - const Obj_List = cache.find(`Obj_List`); - assert.strictEqual(Obj_List.name, `Obj_List`); - assert.strictEqual(Obj_List.range.start, 6); - assert.strictEqual(Obj_List.range.end, 50); - assert.strictEqual(Obj_List.position.line, 6); - assert.strictEqual(Obj_List.keywords.includes(`EXPORT`), true); - assert.strictEqual(Obj_List.keyword[`EXPORT`], true); - assert.strictEqual(Obj_List.subItems.length, 3); + expect(Obj_List.name).to.equal(`Obj_List`); + expect(Obj_List.range.start).to.equal(6); + expect(Obj_List.range.end).to.equal(50); + expect(Obj_List.position.line).to.equal(6); + expect(Obj_List.keywords.includes(`EXPORT`)).to.equal(true); + expect(Obj_List.keyword[`EXPORT`]).to.equal(true); + expect(Obj_List.subItems.length).to.equal(3); - assert.strictEqual(Obj_List.subItems.find(i => !i.keywords.includes(`CHAR(10)`)), undefined); - assert.strictEqual(Obj_List.subItems.find(i => !i.keywords.includes(`CONST`)), undefined); + expect(Obj_List.subItems.find(i => !i.keywords.includes(`CHAR(10)`))).to.be.undefined; + expect(Obj_List.subItems.find(i => !i.keywords.includes(`CONST`))).to.be.undefined; const scope = Obj_List.scope; - assert.strictEqual(scope.subroutines.length, 1); - assert.strictEqual(scope.variables.length, 1); -}; + expect(scope.subroutines.length).to.equal(1); + expect(scope.variables.length).to.equal(1); +}); -exports.fixed11 = async () => { +test('fixed11', async () => { const lines = [ ` D F4DATE PR`, ` D 1`, @@ -581,34 +574,34 @@ exports.fixed11 = async () => { ` D VIEW 1A`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); const F4DATE = cache.find(`F4DATE`); - assert.strictEqual(F4DATE.subItems.length, 4); - assert.strictEqual(F4DATE.range.start, 0); - assert.strictEqual(F4DATE.range.end, 4); + expect(F4DATE.subItems.length).to.equal(4); + expect(F4DATE.range.start).to.equal(0); + expect(F4DATE.range.end).to.equal(4); const parm1 = F4DATE.subItems[0]; - assert.strictEqual(parm1.keywords[0], `CHAR(1)`); + expect(parm1.keywords[0]).to.equal(`CHAR(1)`); const parm2 = F4DATE.subItems[1]; - assert.strictEqual(parm2.keywords[0], `CHAR(15)`); + expect(parm2.keywords[0]).to.equal(`CHAR(15)`); const parm3 = F4DATE.subItems[2]; - assert.strictEqual(parm3.keywords[0], `CHAR(6)`); - assert.strictEqual(parm3.keywords[1], `OPTIONS(*NOPASS)`); + expect(parm3.keywords[0]).to.equal(`CHAR(6)`); + expect(parm3.keywords[1]).to.equal(`OPTIONS(*NOPASS)`); const parm4 = F4DATE.subItems[3]; - assert.strictEqual(parm4.keywords[0], `CHAR(1)`); - assert.strictEqual(parm4.keywords[1], `OPTIONS(*NOPASS)`); + expect(parm4.keywords[0]).to.equal(`CHAR(1)`); + expect(parm4.keywords[1]).to.equal(`OPTIONS(*NOPASS)`); const F4DATEDS = cache.find(`F4DATEDS`); - assert.strictEqual(F4DATEDS.subItems.length, 4); - assert.strictEqual(F4DATEDS.range.start, 6); - assert.strictEqual(F4DATEDS.range.end, 10); -}; + expect(F4DATEDS.subItems.length).to.equal(4); + expect(F4DATEDS.range.start).to.equal(6); + expect(F4DATEDS.range.end).to.equal(10); +}); -exports.columnFix = async () => { +test('columnFix', async () => { const lines = [ ` Dcl-pr abcd1 Extpgm('ABC049');`, ` ParentProductSearch zoned(11);`, @@ -626,30 +619,30 @@ exports.columnFix = async () => { ` end-pr;`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.procedures.length, 3); + expect(cache.procedures.length).to.equal(3); const abcd1 = cache.find(`abcd1`); - assert.deepStrictEqual(abcd1.range, { + expect(abcd1.range).to.deep.equal({ start: 0, end: 4 }); const abcd2 = cache.find(`abcd2`); - assert.deepStrictEqual(abcd2.range, { + expect(abcd2.range).to.deep.equal({ start: 5, end: 10 }); const abcd3 = cache.find(`abcd3`); - assert.deepStrictEqual(abcd3.range, { + expect(abcd3.range).to.deep.equal({ start: 11, end: 13 }); -}; +}); -exports.comments1 = async () => { +test('comments1', async () => { const lines = [ ` //=== Prototypes for SRV_MSG routines ========================`, ` //============================================================`, @@ -686,54 +679,54 @@ exports.comments1 = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.procedures.length, 6); + expect(cache.procedures.length).to.equal(6); const SndMsgPgmQ = cache.find(`SndMsgPgmQ`); - assert.strictEqual(SndMsgPgmQ.subItems.length, 4); - assert.deepStrictEqual(SndMsgPgmQ.range, { + expect(SndMsgPgmQ.subItems.length).to.equal(4); + expect(SndMsgPgmQ.range).to.deep.equal({ start: 2, end: 7 }); const ClrMsgPgmQ = cache.find(`ClrMsgPgmQ`); - assert.strictEqual(ClrMsgPgmQ.subItems.length, 1); - assert.deepStrictEqual(ClrMsgPgmQ.range, { + expect(ClrMsgPgmQ.subItems.length).to.equal(1); + expect(ClrMsgPgmQ.range).to.deep.equal({ start: 9, end: 10 }); const SndEscMsg = cache.find(`SndEscMsg`); - assert.strictEqual(SndEscMsg.subItems.length, 1); - assert.deepStrictEqual(SndEscMsg.range, { + expect(SndEscMsg.subItems.length).to.equal(1); + expect(SndEscMsg.range).to.deep.equal({ start: 13, end: 14 }); const SndInfMsg = cache.find(`SndInfMsg`); - assert.strictEqual(SndInfMsg.subItems.length, 1); - assert.deepStrictEqual(SndInfMsg.range, { + expect(SndInfMsg.subItems.length).to.equal(1); + expect(SndInfMsg.range).to.deep.equal({ start: 17, end: 18 }); const JobLogMsg = cache.find(`JobLogMsg`); - assert.strictEqual(JobLogMsg.subItems.length, 1); - assert.deepStrictEqual(JobLogMsg.range, { + expect(JobLogMsg.subItems.length).to.equal(1); + expect(JobLogMsg.range).to.deep.equal({ start: 21, end: 22 }); const Show = cache.find(`Show`); - assert.strictEqual(Show.subItems.length, 3); - assert.deepStrictEqual(Show.range, { + expect(Show.subItems.length).to.equal(3); + expect(Show.range).to.deep.equal({ start: 25, end: 28 }); -}; +}); -exports.ranges = async () => { +test('ranges', async () => { const lines = [ ` D******************************************************************`, ` D*Record structure for QUSRJOBI JOBI1000 format`, @@ -786,19 +779,19 @@ exports.ranges = async () => { ` D* Page Fault Count`, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); const QUSLWT = cache.find(`QUSLWT`); - assert.strictEqual(QUSLWT.keyword[`UNS`], `20`); + expect(QUSLWT.keyword[`UNS`]).to.equal(`20`); const QUSUUDBP = cache.find(`QUSUUDBP`); - assert.strictEqual(QUSUUDBP.keyword[`INT`], `10`); + expect(QUSUUDBP.keyword[`INT`]).to.equal(`10`); const QUSUN19 = cache.find(`QUSUN19`); - assert.strictEqual(QUSUN19.keyword[`CHAR`], `10`); -} + expect(QUSUN19.keyword[`CHAR`]).to.equal(`10`); +}); -exports.def_ranges = async () => { +test('def_ranges', async () => { const lines = [ ` * ********************************************************************/€`, ` * *`, @@ -989,40 +982,40 @@ exports.def_ranges = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); const TYPEMST_T = cache.find(`TYPEMST_T`); - assert.deepStrictEqual(TYPEMST_T.range, { + expect(TYPEMST_T.range).to.deep.equal({ start: 16, end: 16 }); const TYPEMST_Ds = cache.find(`TYPEMST_Ds`); - assert.deepStrictEqual(TYPEMST_Ds.range, { + expect(TYPEMST_Ds.range).to.deep.equal({ start: 37, end: 39 }); const TYPEMST_F = cache.find(`TYPEMST_F`); - assert.deepStrictEqual(TYPEMST_F.range, { + expect(TYPEMST_F.range).to.deep.equal({ start: 41, end: 41 }); const $ErrorDS_TYPEMST = cache.find(`$ErrorDS_TYPEMST`); - assert.deepStrictEqual($ErrorDS_TYPEMST.range, { + expect($ErrorDS_TYPEMST.range).to.deep.equal({ start: 164, end: 167 }); const $Validate_TYPEMST = cache.find(`$Validate_TYPEMST`); - assert.deepStrictEqual($Validate_TYPEMST.range, { + expect($Validate_TYPEMST.range).to.deep.equal({ start: 45, end: 48 }); -}; +}); -exports.ctl_opt_fixed = async () => { +test('ctl_opt_fixed', async () => { const lines = [ ` H ALTSEQ(*EXT) CURSYM('$') DATEDIT(*MDY) DATFMT(*MDY/) DEBUG(*YES)`, ` H DECEDIT('.') FORMSALIGN(*YES) FTRANS(*SRC) DFTNAME(name)`, @@ -1046,18 +1039,18 @@ exports.ctl_opt_fixed = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 2, `Expect length of 2`); - assert.strictEqual(cache.structs.length, 1, `Expect length of 1`); + expect(cache.variables.length).to.equal(2); + expect(cache.structs.length).to.equal(1); - assert.strictEqual(Object.keys(cache.keyword).length, 11); - assert.strictEqual(cache.keyword[`FTRANS`], `*SRC`); - assert.strictEqual(cache.keyword[`DATFMT`], `*MDY/`); - assert.strictEqual(cache.keyword[`COPYRIGHT`], `'(C) Copyright ABC Programming - 1995'`); -}; + expect(Object.keys(cache.keyword).length).to.equal(11); + expect(cache.keyword[`FTRANS`]).to.equal(`*SRC`); + expect(cache.keyword[`DATFMT`]).to.equal(`*MDY/`); + expect(cache.keyword[`COPYRIGHT`]).to.equal(`'(C) Copyright ABC Programming - 1995'`); +}); -exports.call_opcode = async () => { +test('call_opcode', async () => { const lines = [ ` C CreateNewBoardBEGSR`, ` C EVAL wWinMode = 'T'`, @@ -1082,17 +1075,17 @@ exports.call_opcode = async () => { `` ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.subroutines.length, 1); - assert.strictEqual(cache.procedures.length, 1); + expect(cache.subroutines.length).to.equal(1); + expect(cache.procedures.length).to.equal(1); const fixedCall = cache.find(`BBSWINASKR`) - assert.strictEqual(fixedCall.name, `BBSWINASKR`); - assert.strictEqual(fixedCall.keyword[`EXTPGM`], true); -} + expect(fixedCall.name).to.equal(`BBSWINASKR`); + expect(fixedCall.keyword[`EXTPGM`]).to.equal(true); +}); -exports.file_keywords = async () => { +test('file_keywords', async () => { const lines = [ ``, ` forder o e disk`, @@ -1107,22 +1100,22 @@ exports.file_keywords = async () => { ``, ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.files.length, 4); + expect(cache.files.length).to.equal(4); const tmpdetord = cache.find(`Tmpdetord`); - assert.strictEqual(tmpdetord.keyword[`EXTDESC`], `'DETORD'`); - assert.strictEqual(tmpdetord.keyword[`EXTFILE`], `*EXTDESC`); - assert.strictEqual(tmpdetord.keyword[`RENAME`], `fdeto:tmprec`); + expect(tmpdetord.keyword[`EXTDESC`]).to.equal(`'DETORD'`); + expect(tmpdetord.keyword[`EXTFILE`]).to.equal(`*EXTDESC`); + expect(tmpdetord.keyword[`RENAME`]).to.equal(`fdeto:tmprec`); const ord100d = cache.find(`ord100d`); - assert.strictEqual(ord100d.keyword[`INDDS`], `indds`); - assert.strictEqual(ord100d.keyword[`SFILE`], `sfl01:rrn01`); - assert.strictEqual(ord100d.keyword[`INFDS`], `Info`); -} + expect(ord100d.keyword[`INDDS`]).to.equal(`indds`); + expect(ord100d.keyword[`SFILE`]).to.equal(`sfl01:rrn01`); + expect(ord100d.keyword[`INFDS`]).to.equal(`Info`); +}); -exports.plist_test = async () => { +test('plist_test', async () => { const lines = [ ``, ` ?* PLPVD`, @@ -1167,7 +1160,7 @@ exports.plist_test = async () => { `` ].join(`\n`); - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); + const cache = await parser.getDocs(uri, lines, { ignoreCache: true, withIncludes: true }); - assert.strictEqual(cache.variables.length, 0); -} \ No newline at end of file + expect(cache.variables.length).to.equal(0); +}); \ No newline at end of file diff --git a/tests/suite/index.js b/tests/suite/index.js deleted file mode 100644 index 8a20831a..00000000 --- a/tests/suite/index.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - ...require(`./basics`), - ...require(`./directives`), - ...require(`./fixed`), - ...require(`./keywords`), - ...require(`./linter`), - ...require(`./files`), - ...require(`./editing`), - ...require(`./docs`), - ...require(`./references`) -} \ No newline at end of file diff --git a/tests/suite/keywords.js b/tests/suite/keywords.test.ts similarity index 79% rename from tests/suite/keywords.js rename to tests/suite/keywords.test.ts index 145076bf..39d77e9c 100644 --- a/tests/suite/keywords.js +++ b/tests/suite/keywords.test.ts @@ -1,13 +1,12 @@ -const assert = require(`assert`); +import setupParser from "../parserSetup"; +import Linter from "../../language/linter"; +import { test, expect } from "vitest"; -const {default: parserSetup} = require(`../parserSetup`); -const {default: Linter} = require(`../../language/linter`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; -exports.qualified1 = async () => { +test("qualified1", async () => { const lines = [ `**FREE`, `Dcl-Ds Kx Likerec(TitXe :*Key);`, @@ -23,10 +22,10 @@ exports.qualified1 = async () => { QualifiedCheck: true, }, cache); - assert.strictEqual(errors.length, 0, `Expect length of 0`); -}, + expect(errors.length).toBe(0); +}); -exports.ctdata1 = async () => { +test("ctdata1", async () => { const lines = [ `**free`, `dcl-s myarray char(100) dim(10) ctdata;`, @@ -95,10 +94,10 @@ exports.ctdata1 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `Expect length of 0`); -}, + expect(indentErrors.length).toBe(0); +}); -exports.ctdata2 = async () => { +test("ctdata2", async () => { const lines = [ `**FREE`, `ctl-opt debug option(*nodebugio: *srcstmt);`, @@ -122,15 +121,15 @@ exports.ctdata2 = async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - assert.strictEqual(Object.keys(cache.keyword).length, 2); - assert.strictEqual(cache.keyword[`DEBUG`], true); - assert.strictEqual(cache.keyword[`OPTION`], `*NODEBUGIO:*SRCSTMT`); + expect(Object.keys(cache.keyword).length).toBe(2); + expect(cache.keyword[`DEBUG`]).toBe(true); + expect(cache.keyword[`OPTION`]).toBe(`*NODEBUGIO:*SRCSTMT`); - assert.strictEqual(cache.variables.length, 1); - assert.strictEqual(cache.structs.length, 1); -} + expect(cache.variables.length).toBe(1); + expect(cache.structs.length).toBe(1); +}); -exports.ctdata3 = async () => { +test("ctdata3", async () => { const lines = [ ` DCL-F QSYSPRT PRINTER(132) USAGE(*OUTPUT) OFLIND(*INOF);`, ` `, @@ -153,11 +152,11 @@ exports.ctdata3 = async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - assert.strictEqual(cache.files.length, 1); - assert.strictEqual(cache.variables.length, 3); -} + expect(cache.files.length).toBe(1); + expect(cache.variables.length).toBe(3); +}); -exports.likeds1 = async () => { +test("likeds1", async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 CHAR(20);`, @@ -172,16 +171,16 @@ exports.likeds1 = async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - assert.strictEqual(cache.variables.length, 2); - assert.strictEqual(cache.structs.length, 2); + expect(cache.variables.length).toBe(2); + expect(cache.structs.length).toBe(2); const MyOtherStruct = cache.find(`MyOtherStruct`); - assert.strictEqual(MyOtherStruct.name, `MyOtherStruct`); - assert.strictEqual(MyOtherStruct.position.line, 7); - assert.strictEqual(MyOtherStruct.subItems.length, 2); -}, + expect(MyOtherStruct.name).toBe(`MyOtherStruct`); + expect(MyOtherStruct.position.line).toBe(7); + expect(MyOtherStruct.subItems.length).toBe(2); +}); -exports.likeds2 = async () => { +test("likeds2", async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 CHAR(20);`, @@ -203,22 +202,22 @@ exports.likeds2 = async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - assert.strictEqual(cache.variables.length, 2); - assert.strictEqual(cache.structs.length, 1); - assert.strictEqual(cache.procedures.length, 1); + expect(cache.variables.length).toBe(2); + expect(cache.structs.length).toBe(1); + expect(cache.procedures.length).toBe(1); const myProc = cache.find(`myprocedure`); - assert.strictEqual(myProc.name, `myprocedure`); - assert.strictEqual(myProc.position.line, 9); - assert.strictEqual(myProc.subItems.length, 1); + expect(myProc.name).toBe(`myprocedure`); + expect(myProc.position.line).toBe(9); + expect(myProc.subItems.length).toBe(1); const parmInputDs = myProc.subItems[0]; - assert.strictEqual(parmInputDs.name, `inputDS`); - assert.strictEqual(parmInputDs.position.line, 11); - assert.strictEqual(parmInputDs.subItems.length, 2); -}, + expect(parmInputDs.name).toBe(`inputDS`); + expect(parmInputDs.position.line).toBe(11); + expect(parmInputDs.subItems.length).toBe(2); +}); -exports.overload1 = async () => { +test("overload1", async () => { const lines = [ `**FREE`, ``, @@ -251,6 +250,6 @@ exports.overload1 = async () => { PrettyComments: true }, cache); - assert.strictEqual(cache.procedures.length, 4); - assert.strictEqual(indentErrors.length, 0); -} \ No newline at end of file + expect(cache.procedures.length).toBe(4); + expect(indentErrors.length).toBe(0); +}); \ No newline at end of file diff --git a/tests/suite/linter.js b/tests/suite/linter.test.ts similarity index 68% rename from tests/suite/linter.js rename to tests/suite/linter.test.ts index 5f0ad9f4..804aa24b 100644 --- a/tests/suite/linter.js +++ b/tests/suite/linter.test.ts @@ -1,15 +1,13 @@ -const assert = require(`assert`); +import path from "path"; +import setupParser from "../parserSetup"; +import Linter from "../../language/linter"; +import { test, expect } from "vitest"; -const { default: parserSetup } = require(`../parserSetup`); -const { default: Linter } = require(`../../language/linter`); -const path = require(`path`); -const { Range, Position } = require(`../../language/models/DataPoints`); - -const parser = parserSetup(); +const parser = setupParser(); const uri = `source.rpgle`; -exports.linter_indent_multi_1 = async () => { +test("linter_indent_multi_1", async () => { const lines = [ `**FREE`, `Begsr shouldBeGood;`, @@ -40,10 +38,10 @@ exports.linter_indent_multi_1 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `There should be no errors`); -}; + expect(indentErrors.length).toBe(0); +}); -exports.linter_indent_multi_2 = async () => { +test("linter_indent_multi_2", async () => { const lines = [ `**FREE`, `Begsr shouldError;`, @@ -61,20 +59,13 @@ exports.linter_indent_multi_2 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 1, `There should be 1 error`); - - // TODO: we aren't count this yet - // assert.strictEqual(indentErrors[0].line, 3, `First error should be index 3`); - // assert.strictEqual(indentErrors[0].currentIndent, 1, `Actual indent should be 1`); - // assert.strictEqual(indentErrors[0].expectedIndent, 2, `Expected indent should be 2`); - - assert.strictEqual(indentErrors[0].line, 5, `Second error should be index 5`); - assert.strictEqual(indentErrors[0].currentIndent, 5, `Actual indent should be 5`); - - assert.strictEqual(indentErrors[0].expectedIndent, 4, `Expected indent should be 4`); -}; + expect(indentErrors.length).toBe(1); + expect(indentErrors[0].line).toBe(5); + expect(indentErrors[0].currentIndent).toBe(5); + expect(indentErrors[0].expectedIndent).toBe(4); +}); -exports.linter_invalid_statement = async () => { +test("linter_invalid_statement", async () => { const lines = [ `**FREE`, `Dcl-s abcd char(5); Dsply 'This is bad but shouldn't error';`, @@ -88,10 +79,10 @@ exports.linter_invalid_statement = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `There should be 1 error`); -}; + expect(indentErrors.length).toBe(0); +}); -exports.linter1_indent = async () => { +test("linter1_indent", async () => { const lines = [ `**FREE`, ``, @@ -114,87 +105,87 @@ exports.linter1_indent = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 1, `Expect length of 1`); - assert.strictEqual(indentErrors[0].line, 11, `Index of 9 expected`); - assert.strictEqual(indentErrors[0].currentIndent, 0, `Value of 0 expected`); - assert.strictEqual(indentErrors[0].expectedIndent, 2, `Value of 2 expected`); -}; + expect(indentErrors.length).toBe(1); + expect(indentErrors[0].line).toBe(11); + expect(indentErrors[0].currentIndent).toBe(0); + expect(indentErrors[0].expectedIndent).toBe(2); +}); /** - * Testing spaces before the EOL - */ -exports.linter1_1_indent = async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DFTACTGRP(*No);`, - ``, - `// Prototype`, - `Dcl-Pr printf Int(10) ExtProc('printf');`, - ` format Pointer Value Options(*String); `, //This space at the end was causing an indent error on the next line - `END-PR;`, - ``, - `Dcl-s MyVariable2 Char(20);`, - ``, - `myVariable2 = *blank;`, - ``, - `If myVariable2 = *blank;`, - ` // Inside if`, - ` MyVariable2 = 'Hello world';`, - `Endif;`, - `Return;` + * Testing spaces before the EOL + */ +test("linter1_1_indent", async () => { + const lines = [ + `**FREE`, + ``, + `Ctl-Opt DFTACTGRP(*No);`, + ``, + `// Prototype`, + `Dcl-Pr printf Int(10) ExtProc('printf');`, + ` format Pointer Value Options(*String); `, //This space at the end was causing an indent error on the next line + `END-PR;`, + ``, + `Dcl-s MyVariable2 Char(20);`, + ``, + `myVariable2 = *blank;`, + ``, + `If myVariable2 = *blank;`, + ` // Inside if`, + ` MyVariable2 = 'Hello world';`, + `Endif;`, + `Return;` ].join(`\n`); const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); const { indentErrors } = Linter.getErrors({ uri, content: lines }, { - indent: 2 - }, cache); - - assert.strictEqual(indentErrors.length, 0, `Expect length of 0`); -}; - -exports.linter2_indent = async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DFTACTGRP(*No);`, - ``, - `Dcl-s MyVariable2 Char(20);`, - ``, - `myVariable2 = *blank;`, - ``, - `If myVariable2 = *blank;`, - ` // Inside if`, - `MyVariable2 = 'Hello world';`, - ` Select;`, - ` When myVariable2 = *blank;`, - ` // First when`, - ` MyVariable2 = 'Still blank?';`, - ` When myVariable2 = 'YOYOYO';`, - ` // Second when`, - ` MyVariable2 = 'YOYOYO';`, - ` Endsl;`, - `Endif;`, - `Return;` + indent: 2 + }, cache); + + expect(indentErrors.length).toBe(0); +}); + +test("linter2_indent", async () => { + const lines = [ + `**FREE`, + ``, + `Ctl-Opt DFTACTGRP(*No);`, + ``, + `Dcl-s MyVariable2 Char(20);`, + ``, + `myVariable2 = *blank;`, + ``, + `If myVariable2 = *blank;`, + ` // Inside if`, + `MyVariable2 = 'Hello world';`, + ` Select;`, + ` When myVariable2 = *blank;`, + ` // First when`, + ` MyVariable2 = 'Still blank?';`, + ` When myVariable2 = 'YOYOYO';`, + ` // Second when`, + ` MyVariable2 = 'YOYOYO';`, + ` Endsl;`, + `Endif;`, + `Return;` ].join(`\n`); const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); const { indentErrors } = Linter.getErrors({ uri, content: lines }, { - indent: 2 + indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 2, `Expect length of 2`); + expect(indentErrors.length).toBe(2); - assert.strictEqual(indentErrors[0].line, 10, `Index of 9 expected`); - assert.strictEqual(indentErrors[0].currentIndent, 0, `Value of 0 expected`); - assert.strictEqual(indentErrors[0].expectedIndent, 2, `Value of 2 expected`); + expect(indentErrors[0].line).toBe(10); + expect(indentErrors[0].currentIndent).toBe(0); + expect(indentErrors[0].expectedIndent).toBe(2); - assert.strictEqual(indentErrors[1].line, 17, `Index of 17 expected`); - assert.strictEqual(indentErrors[1].currentIndent, 8, `Value of 8 expected`); - assert.strictEqual(indentErrors[1].expectedIndent, 6, `Value of 6 expected`); -}; + expect(indentErrors[1].line).toBe(17); + expect(indentErrors[1].currentIndent).toBe(8); + expect(indentErrors[1].expectedIndent).toBe(6); +}); -exports.linter2_indent_other = async () => { +test('linter2_indent_other', async () => { const lines = [ `**FREE`, ``, @@ -227,18 +218,16 @@ exports.linter2_indent_other = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 2, `Expect length of 2`); - - assert.strictEqual(indentErrors[0].line, 10, `Index of 9 expected`); - assert.strictEqual(indentErrors[0].currentIndent, 0, `Value of 0 expected`); - assert.strictEqual(indentErrors[0].expectedIndent, 2, `Value of 2 expected`); + expect(indentErrors.length).to.equal(2); + expect(indentErrors[0].line).to.equal(10); + expect(indentErrors[0].currentIndent).to.equal(0); + expect(indentErrors[0].expectedIndent).to.equal(2); + expect(indentErrors[1].line).to.equal(17); + expect(indentErrors[1].currentIndent).to.equal(8); + expect(indentErrors[1].expectedIndent).to.equal(6); +}); - assert.strictEqual(indentErrors[1].line, 17, `Index of 14 expected`); - assert.strictEqual(indentErrors[1].currentIndent, 8, `Value of 8 expected`); - assert.strictEqual(indentErrors[1].expectedIndent, 6, `Value of 6 expected`); -}; - -exports.linter3_indent = async () => { +test('linter3_indent', async () => { const lines = [ `**FREE`, ``, @@ -267,22 +256,19 @@ exports.linter3_indent = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 3, `Expect length of 3`); - - assert.strictEqual(indentErrors[0].line, 9, `Index of 9 expected`); - assert.strictEqual(indentErrors[0].currentIndent, 0, `Value of 0 expected`); - assert.strictEqual(indentErrors[0].expectedIndent, 2, `Value of 2 expected`); + expect(indentErrors.length).to.equal(3); + expect(indentErrors[0].line).to.equal(9); + expect(indentErrors[0].currentIndent).to.equal(0); + expect(indentErrors[0].expectedIndent).to.equal(2); + expect(indentErrors[1].line).to.equal(14); + expect(indentErrors[1].currentIndent).to.equal(8); + expect(indentErrors[1].expectedIndent).to.equal(6); + expect(indentErrors[2].line).to.equal(18); + expect(indentErrors[2].currentIndent).to.equal(2); + expect(indentErrors[2].expectedIndent).to.equal(0); +}); - assert.strictEqual(indentErrors[1].line, 14, `Index of 14 expected`); - assert.strictEqual(indentErrors[1].currentIndent, 8, `Value of 8 expected`); - assert.strictEqual(indentErrors[1].expectedIndent, 6, `Value of 6 expected`); - - assert.strictEqual(indentErrors[2].line, 18, `Index of 18 expected`); - assert.strictEqual(indentErrors[2].currentIndent, 2, `Value of 2 expected`); - assert.strictEqual(indentErrors[2].expectedIndent, 0, `Value of 0 expected`); -}; - -exports.linter4 = async () => { +test('linter4', async () => { const lines = [ `**FREE`, ``, @@ -303,20 +289,18 @@ exports.linter4 = async () => { RequireBlankSpecial: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.strictEqual(errors[0].type, `RequireBlankSpecial`, `Expect RequireBlankSpecial`); - assert.strictEqual(errors[0].offset.position, 76); - assert.strictEqual(errors[0].offset.end, 78); - assert.strictEqual(errors[0].newValue, `*BLANK`, `Value of *BLANK expected`); - - assert.strictEqual(errors[1].type, `RequireBlankSpecial`, `Expect RequireBlankSpecial`); - assert.strictEqual(errors[1].offset.position, 98, `Index of 17 expected`); - assert.strictEqual(errors[1].offset.end, 100, `Index of 19 expected`); - assert.strictEqual(errors[1].newValue, `*BLANK`, `Value of *BLANK expected`); -}; + expect(errors.length).to.equal(2); + expect(errors[0].type).to.equal('RequireBlankSpecial'); + expect(errors[0].offset.position).to.equal(76); + expect(errors[0].offset.end).to.equal(78); + expect(errors[0].newValue).to.equal('*BLANK'); + expect(errors[1].type).to.equal('RequireBlankSpecial'); + expect(errors[1].offset.position).to.equal(98); + expect(errors[1].offset.end).to.equal(100); + expect(errors[1].newValue).to.equal('*BLANK'); +}); -exports.linter5 = async () => { +test('linter5', async () => { const lines = [ `**FREE`, ``, @@ -339,20 +323,18 @@ exports.linter5 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); + expect(errors.length).to.equal(2); + expect(errors[0].type).to.equal('IncorrectVariableCase'); + expect(errors[0].offset.position).to.equal(62); + expect(errors[0].offset.end).to.equal(73); + expect(errors[0].newValue).to.equal('MyVariable2'); + expect(errors[1].type).to.equal('IncorrectVariableCase'); + expect(errors[1].offset.position).to.equal(122); + expect(errors[1].offset.end).to.equal(133); + expect(errors[1].newValue).to.equal('MyVariable2'); +}); - assert.strictEqual(errors[0].type, `IncorrectVariableCase`, `Expect IncorrectVariableCase`); - assert.strictEqual(errors[0].offset.position, 62); - assert.strictEqual(errors[0].offset.end, 73); - assert.strictEqual(errors[0].newValue, `MyVariable2`, `Value of MyVariable2 expected`); - - assert.strictEqual(errors[1].type, `IncorrectVariableCase`, `Expect IncorrectVariableCase`); - assert.strictEqual(errors[1].offset.position, 122); - assert.strictEqual(errors[1].offset.end, 133); - assert.strictEqual(errors[1].newValue, `MyVariable2`, `Value of MyVariable2 expected`); -}; - -exports.linter6 = async () => { +test('linter6', async () => { const lines = [ `**FREE`, ``, @@ -379,18 +361,16 @@ exports.linter6 = async () => { StringLiteralDupe: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.strictEqual(errors[0].type, `StringLiteralDupe`, `Expect StringLiteralDupe`); - assert.strictEqual(errors[0].offset.position, 239); - assert.strictEqual(errors[0].offset.end, 247); - - assert.strictEqual(errors[1].type, `StringLiteralDupe`, `Expect StringLiteralDupe`); - assert.strictEqual(errors[1].offset.position, 271); - assert.strictEqual(errors[1].offset.end, 279); -}; + expect(errors.length).to.equal(2); + expect(errors[0].type).to.equal('StringLiteralDupe'); + expect(errors[0].offset.position).to.equal(239); + expect(errors[0].offset.end).to.equal(247); + expect(errors[1].type).to.equal('StringLiteralDupe'); + expect(errors[1].offset.position).to.equal(271); + expect(errors[1].offset.end).to.equal(279); +}); -exports.linter6_lf = async () => { +test('linter6_lf', async () => { const lines = [ `**FREE`, ``, @@ -408,30 +388,28 @@ exports.linter6_lf = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 3, `Expect length of 3`); + expect(errors.length).to.equal(3); - const line = new Range(new Position(4, 0), new Position(6, 18)); - - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 95, end: 107 }, - type: `IncorrectVariableCase`, - newValue: `Myotherthing` + type: 'IncorrectVariableCase', + newValue: 'Myotherthing' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 44, end: 59 }, - type: `StringLiteralDupe`, + type: 'StringLiteralDupe', newValue: undefined }); - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ offset: { position: 68, end: 83 }, - type: `StringLiteralDupe`, + type: 'StringLiteralDupe', newValue: undefined }); -}; +}); -exports.linter6_crlf = async () => { +test('linter6_crlf', async () => { const lines = [ `**FREE`, ``, @@ -443,38 +421,34 @@ exports.linter6_crlf = async () => { ` ` ].join(`\r\n`); - //const lines = `**FREE\r\n\r\nDcl-S Myotherthing char(10);\r\n\r\ndsply 'hello friends'\r\n + 'hello friends' + ''\r\n + myotherthing;`; - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); const { errors } = Linter.getErrors({ uri, content: lines }, { StringLiteralDupe: true, IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 3, `Expect length of 3`); + expect(errors.length).to.equal(3); - const line = new Range(new Position(4, 0), new Position(6, 18)); - - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 101, end: 113 }, - type: `IncorrectVariableCase`, - newValue: `Myotherthing` + type: 'IncorrectVariableCase', + newValue: 'Myotherthing' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 48, end: 63 }, - type: `StringLiteralDupe`, + type: 'StringLiteralDupe', newValue: undefined }); - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ offset: { position: 73, end: 88 }, - type: `StringLiteralDupe`, + type: 'StringLiteralDupe', newValue: undefined }); -}; +}); -exports.linter7_casing1 = async () => { +test('linter7_casing1', async () => { const lines = [ `**FREE`, ``, @@ -499,22 +473,22 @@ exports.linter7_casing1 = async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); const { errors } = Linter.getErrors({ uri, content: lines }, { SpecificCasing: [ - { operation: `if`, expected: `If` }, - { operation: `endif`, expected: `Endif` }, - { operation: `select`, expected: `SELECT` }, + { operation: 'if', expected: 'If' }, + { operation: 'endif', expected: 'Endif' }, + { operation: 'select', expected: 'SELECT' }, ] }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); + expect(errors.length).to.equal(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 141, end: 147 }, - type: `SpecificCasing`, - newValue: `SELECT` + type: 'SpecificCasing', + newValue: 'SELECT' }); -}; +}); -exports.linter7_casing2 = async () => { +test("linter7_casing2", async () => { const lines = [ `**FREE`, ``, @@ -543,16 +517,15 @@ exports.linter7_casing2 = async () => { ] }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ offset: { position: 8, end: 15 }, type: `SpecificCasing`, newValue: `Ctl-OPT` }); -}; +}); -exports.linter7_casing3 = async () => { +test("linter7_casing3", async () => { const lines = [ `**FREE`, ``, @@ -581,16 +554,15 @@ exports.linter7_casing3 = async () => { ] }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ offset: { position: 33, end: 38 }, type: `SpecificCasing`, newValue: `DCL-S` }); -}; +}); -exports.linter7_casing4 = async () => { +test("linter7_casing4", async () => { const lines = [ `**FREE`, ``, @@ -614,16 +586,15 @@ exports.linter7_casing4 = async () => { ] }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ offset: { position: 164, end: 169 }, type: `SpecificCasing`, newValue: `%trim` }); -}; +}); -exports.linter7_casing5 = async () => { +test("linter7_casing5", async () => { const lines = [ `**FREE`, ``, @@ -653,10 +624,10 @@ exports.linter7_casing5 = async () => { ] }, cache); - assert.strictEqual(errors.length, 0, `Expect length of 0`); -}; + expect(errors.length).toBe(0); +}); -exports.linter7_casing6 = async () => { +test("linter7_casing6", async () => { const lines = [ `**FREE`, ``, @@ -680,13 +651,13 @@ exports.linter7_casing6 = async () => { ] }, cache); - assert.strictEqual(errors.length, 3, `Expect length of 3`); - assert.strictEqual(errors[0].newValue, `CTL-OPT`); - assert.strictEqual(errors[1].newValue, `DCL-S`); - assert.strictEqual(errors[2].newValue, `DCL-S`); -}; + expect(errors.length).toBe(3); + expect(errors[0].newValue).toBe(`CTL-OPT`); + expect(errors[1].newValue).toBe(`DCL-S`); + expect(errors[2].newValue).toBe(`DCL-S`); +}); -exports.linter7_casing7 = async () => { +test("linter7_casing7", async () => { const lines = [ `**FREE`, ``, @@ -711,12 +682,12 @@ exports.linter7_casing7 = async () => { ] }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - assert.strictEqual(errors[0].newValue, `DCL-S`); - assert.strictEqual(errors[1].newValue, `DCL-S`); -}; + expect(errors.length).toBe(2); + expect(errors[0].newValue).toBe(`DCL-S`); + expect(errors[1].newValue).toBe(`DCL-S`); +}); -exports.linter7_casing8 = async () => { +test("linter7_casing8", async () => { const lines = [ `**FREE`, ``, @@ -741,12 +712,12 @@ exports.linter7_casing8 = async () => { ] }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - assert.strictEqual(errors[0].newValue, `dcl-s`); - assert.strictEqual(errors[1].newValue, `dcl-s`); -}; + expect(errors.length).toBe(2); + expect(errors[0].newValue).toBe(`dcl-s`); + expect(errors[1].newValue).toBe(`dcl-s`); +}); -exports.linter7_casing9 = async () => { +test("linter7_casing9", async () => { const lines = [ `**FREE`, ``, @@ -770,11 +741,11 @@ exports.linter7_casing9 = async () => { ] }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - assert.strictEqual(errors[0].newValue, `%trim`); -}; + expect(errors.length).toBe(1); + expect(errors[0].newValue).toBe(`%trim`); +}); -exports.linter7_casing10 = async () => { +test('linter7_casing10', async () => { const lines = [ `**free`, ``, @@ -800,13 +771,13 @@ exports.linter7_casing10 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - assert.strictEqual(errors[0].offset.position, 178); - assert.strictEqual(errors[0].offset.end, 188); - assert.strictEqual(errors[0].newValue, `sFirstName`) -}; + expect(errors.length).to.equal(1); + expect(errors[0].offset.position).to.equal(178); + expect(errors[0].offset.end).to.equal(188); + expect(errors[0].newValue).to.equal('sFirstName'); +}); -exports.linter7_casing11 = async () => { +test('linter7_casing11', async () => { const lines = [ `**free`, ``, @@ -832,22 +803,22 @@ exports.linter7_casing11 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 2); + expect(errors.length).to.equal(2); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 121, end: 127 }, - type: `IncorrectVariableCase`, - newValue: `sEmpNo` + type: 'IncorrectVariableCase', + newValue: 'sEmpNo' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 179, end: 189 }, - type: `IncorrectVariableCase`, - newValue: `sFirstName` + type: 'IncorrectVariableCase', + newValue: 'sFirstName' }); -}; +}); -exports.linter7_casing12 = async () => { +test('linter7_casing12', async () => { const lines = [ `**free`, ``, @@ -881,10 +852,10 @@ exports.linter7_casing12 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).to.equal(0); +}); -exports.linter8 = async () => { +test('linter8', async () => { const lines = [ `**FREE`, `ctl-opt debug nomain option(*nodebugio: *srcstmt) ;`, @@ -906,13 +877,14 @@ exports.linter8 = async () => { RequiresParameter: true }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - assert.deepStrictEqual(errors[0], { - offset: { position: 236, end: 245 }, type: `RequiresParameter` + expect(errors.length).to.equal(1); + expect(errors[0]).to.deep.equal({ + offset: { position: 236, end: 245 }, + type: 'RequiresParameter' }); -}; +}); -exports.linter_Do_Not_Require_Parameters_For_Control_Options = async () => { +test('linter_Do_Not_Require_Parameters_For_Control_Options', async () => { const lines = [ `**FREE`, `ctl-opt main(main) ;`, @@ -926,10 +898,10 @@ exports.linter_Do_Not_Require_Parameters_For_Control_Options = async () => { RequiresParameter: true }, cache); - assert.strictEqual(errors.length, 0, `Unexpected RequiresParamters error`); -}; + expect(errors.length).to.equal(0); +}); -exports.linter_Do_Not_Require_Parameters_For_Compile_Directives = async () => { +test('linter_Do_Not_Require_Parameters_For_Compile_Directives', async () => { const lines = [ `**FREE`, `/if defined(MYPROCEDURE);`, @@ -945,13 +917,10 @@ exports.linter_Do_Not_Require_Parameters_For_Compile_Directives = async () => { RequiresParameter: true }, cache); - assert.strictEqual(errors.length, 0, `Unexpected RequiresParamters error`); -}; + expect(errors.length).to.equal(0); +}); -/** - * Check that local variables are not in global scope - */ -exports.linter9 = async () => { +test('linter9', async () => { const lines = [ `**FREE`, ``, @@ -976,33 +945,33 @@ exports.linter9 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); + expect(cache.variables.length).to.equal(1); + expect(cache.constants.length).to.equal(1); + expect(cache.procedures.length).to.equal(1); + expect(cache.procedures[0].subItems.length).to.equal(1); - assert.strictEqual(errors.length, 3, `Expect length of 3`); + expect(errors.length).to.equal(3); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 194, end: 202 }, - type: `IncorrectVariableCase`, - newValue: `localVar` + type: 'IncorrectVariableCase', + newValue: 'localVar' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 217, end: 228 }, - type: `IncorrectVariableCase`, - newValue: `MyVariable2` + type: 'IncorrectVariableCase', + newValue: 'MyVariable2' }); - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ offset: { position: 231, end: 239 }, - type: `IncorrectVariableCase`, - newValue: `localVar` + type: 'IncorrectVariableCase', + newValue: 'localVar' }); -}; +}); -exports.linter10 = async () => { +test('linter10', async () => { const lines = [ `**FREE`, `ctl-opt debug option(*nodebugio: *srcstmt);`, @@ -1029,18 +998,20 @@ exports.linter10 = async () => { NoCTDATA: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); + expect(errors.length).to.equal(2); - assert.deepStrictEqual(errors[0], { - type: `NoCTDATA`, offset: { position: 51, end: 89 } + expect(errors[0]).to.deep.equal({ + type: 'NoCTDATA', + offset: { position: 51, end: 89 } }); - assert.deepStrictEqual(errors[1], { - offset: { position: 222, end: 230 }, type: `NoCTDATA` + expect(errors[1]).to.deep.equal({ + offset: { position: 222, end: 230 }, + type: 'NoCTDATA' }); -}; +}); -exports.linter11 = async () => { +test('linter11', async () => { const lines = [ `**FREE`, ``, @@ -1058,24 +1029,22 @@ exports.linter11 = async () => { StringLiteralDupe: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - const line = new Range(new Position(5, 0), new Position(7, 12)); + expect(errors.length).to.equal(2); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 73, end: 88 }, - type: `StringLiteralDupe`, - newValue: `HELLO` + type: 'StringLiteralDupe', + newValue: 'HELLO' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 97, end: 112 }, - type: `StringLiteralDupe`, - newValue: `HELLO` + type: 'StringLiteralDupe', + newValue: 'HELLO' }); -}; +}); -exports.linter12 = async () => { +test('linter12', async () => { const lines = [ `**free`, `If 2 = 2;`, @@ -1092,10 +1061,10 @@ exports.linter12 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `Expect length of 0`); -}; + expect(indentErrors.length).to.equal(0); +}); -exports.linter13 = async () => { +test('linter13', async () => { const lines = [ `**FREE`, ``, @@ -1127,10 +1096,10 @@ exports.linter13 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `Expect length of 0`); -}; + expect(indentErrors.length).to.equal(0); +}); -exports.linter13_commentIndent = async () => { +test('linter13_commentIndent', async () => { const lines = [ `**FREE`, ``, @@ -1163,65 +1132,37 @@ exports.linter13_commentIndent = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 3, `Expect length of 3`); + expect(indentErrors.length).to.equal(3); - assert.deepStrictEqual(indentErrors[0], { + expect(indentErrors[0]).to.deep.equal({ currentIndent: 2, expectedIndent: 0, line: 9 }); - assert.deepStrictEqual(indentErrors[1], { + expect(indentErrors[1]).to.deep.equal({ currentIndent: 0, expectedIndent: 2, line: 15 }); - assert.deepStrictEqual(indentErrors[2], { + expect(indentErrors[2]).to.deep.equal({ currentIndent: 6, expectedIndent: 2, line: 20 }); -}; +}); -exports.linter14 = async () => { +test('linter14', async () => { const lines = [ - `**FREE`, - `//--------------------------------------------------------------------------------------------------`, - `// Append a single quote. This procedure exists to make other code more readable.`, - `//--------------------------------------------------------------------------------------------------`, - `DCL-PROC Q;`, - ` DCL-PI Q VARCHAR(2048);`, - ` in_str VARCHAR(2048) CONST OPTIONS(*TRIM);`, - ` END-PI;`, - ` `, - ` DCL-C C_QUOTE '''';`, - ` DCL-S is_abend IND INZ(*OFF);`, - ` DCL-S return_str LIKE(in_str);`, - ` `, - ` return_str = %TRIM(C_QUOTE + in_str + C_QUOTE);`, - ` RETURN return_str;`, - ` // End of procedure`, - ` `, - ` ON-EXIT is_abend;`, - ` // Exit handler`, - ` IF is_abend;`, - ` return_str = 'This is a string';`, - ` ENDIF;`, - `END-PROC Q;`, - ``, - `// New procedure`, - `Dcl-Proc theProcedure;`, - ` Dcl-Pi *N;`, - ` newValue Char(20);`, - ` End-Pi;`, - ` // comment with right indent`, - ` Dcl-S localVar Char(20);`, - ` localvar = newValue;`, - ` // but valid indent`, - ` // with another line`, - ` Myvariable2 = localvar;`, - `End-Proc;`, + `**free`, + `If 2 = 2;`, + ` localvar = 'Hello' + `, + ` 'World';`, + `Else;`, + ` buyralg_setbu_aprordr(buyralg_getbu_aprordr + `, + ` arrayapr(wkind)); // 10-26-2016`, + `Endif;`, ].join(`\n`); const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); @@ -1229,10 +1170,10 @@ exports.linter14 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0, `Expect length of 0`); -}; + expect(indentErrors.length).to.equal(0); +}); -exports.linter15 = async () => { +test('linter15', async () => { const lines = [ `**FREE`, ``, @@ -1265,25 +1206,25 @@ exports.linter15 = async () => { PrettyComments: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 5`); + expect(errors.length).to.equal(2); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).to.deep.equal({ offset: { position: 36, end: 38 }, - type: `PrettyComments`, - newValue: `// ` + type: 'PrettyComments', + newValue: '// ' }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 207, end: 209 }, - type: `PrettyComments`, - newValue: `// ` + type: 'PrettyComments', + newValue: '// ' }); -}; +}); /** - * Subroutine check test - * */ -exports.linter16 = async () => { + * Subroutine check test + */ +test('linter16', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 Char(20);`, @@ -1301,25 +1242,22 @@ exports.linter16 = async () => { NoGlobalSubroutines: true }, cache); - assert.strictEqual(errors.length, 3, `Expect length of 3`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(3); + expect(errors[0]).to.deep.equal({ type: `NoGlobalSubroutines`, offset: { position: 36, end: 54 } }); - - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 76, end: 81 }, type: `NoGlobalSubroutines` }); - - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ offset: { position: 128, end: 133 }, type: `NoGlobalSubroutines` }); -}; +}); -exports.linter16_with_leavesr = async () => { +test('linter16_with_leavesr', async () => { const lines = [ `**FREE`, `Dcl-s SomeNum int(5);`, @@ -1342,33 +1280,29 @@ exports.linter16_with_leavesr = async () => { NoGlobalSubroutines: true }, cache); - assert.strictEqual(errors.length, 4, `Expect length of 3`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(4); + expect(errors[0]).to.deep.equal({ type: `NoGlobalSubroutines`, offset: { position: 71, end: 89 } }); - - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 111, end: 116 }, type: `NoGlobalSubroutines` }); - - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ type: `NoGlobalSubroutines`, offset: { position: 156, end: 163 } }); - - assert.deepStrictEqual(errors[3], { + expect(errors[3]).to.deep.equal({ offset: { position: 205, end: 210 }, type: `NoGlobalSubroutines` }); -}; +}); /** - * Subroutine in procedure check test - * */ -exports.linter17 = async () => { + * Subroutine in procedure check test + */ +test('linter17', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 Char(20);`, @@ -1389,14 +1323,13 @@ exports.linter17 = async () => { NoLocalSubroutines: true }, cache); - assert.strictEqual(errors.length, 1, `Expect length of 1`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(1); + expect(errors[0]).to.deep.equal({ type: `NoLocalSubroutines`, offset: { position: 119, end: 138 } }); -}; +}); -exports.linter18 = async () => { +test('linter18', async () => { const lines = [ `**FREE`, `Dcl-s MyVariable2 Char(20);`, @@ -1416,20 +1349,18 @@ exports.linter18 = async () => { NoGlobalsInProcedures: true }, cache); - assert.strictEqual(errors.length, 2, `Expect length of 2`); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(2); + expect(errors[0]).to.deep.equal({ offset: { position: 123, end: 134 }, type: `NoGlobalsInProcedures` }); - - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ offset: { position: 164, end: 175 }, type: `NoGlobalsInProcedures` }); -} +}); -exports.linter19 = async () => { +test('linter19', async () => { const lines = [ `**free`, ``, @@ -1509,54 +1440,43 @@ exports.linter19 = async () => { NoUnreferenced: true }, cache); - assert.strictEqual(errors.length, 11); - - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(11); + expect(errors[0]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 66, end: 86 } }); - - assert.deepStrictEqual(errors[1], { + expect(errors[1]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 1089, end: 1104 } }); - - assert.deepStrictEqual(errors[2], { + expect(errors[2]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 160, end: 176 } }); - - assert.deepStrictEqual(errors[3], { + expect(errors[3]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 139, end: 154 } }); - - assert.deepStrictEqual(errors[4], { + expect(errors[4]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 337, end: 354 } }); - - assert.deepStrictEqual(errors[5], { + expect(errors[5]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 302, end: 331 } }); - - assert.deepStrictEqual(errors[6], { + expect(errors[6]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 539, end: 566 } }); - - assert.deepStrictEqual(errors[7], { + expect(errors[7]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 735, end: 749 } }); - - assert.deepStrictEqual(errors[8], { + expect(errors[8]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 705, end: 725 } }); - - assert.deepStrictEqual(errors[9], { + expect(errors[9]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 893, end: 910 } }); - - assert.deepStrictEqual(errors[10], { + expect(errors[10]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 849, end: 883 } }); -} +}); -exports.linter20 = async () => { +test('linter20', async () => { const lines = [ `**FREE`, ``, @@ -1572,15 +1492,14 @@ exports.linter20 = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 1); - - assert.strictEqual(errors[0].type, `IncorrectVariableCase`, `Expect IncorrectVariableCase`); - assert.strictEqual(errors[0].offset.position, 92); - assert.strictEqual(errors[0].offset.end, 103); - assert.strictEqual(errors[0].newValue, `MyVariable2`, `Value of MyVariable2 expected`); -}; + expect(errors.length).to.equal(1); + expect(errors[0].type).to.equal(`IncorrectVariableCase`); + expect(errors[0].offset.position).to.equal(92); + expect(errors[0].offset.end).to.equal(103); + expect(errors[0].newValue).to.equal(`MyVariable2`); +}); -exports.linter21 = async () => { +test('linter21', async () => { const lines = [ `**FREE`, ``, @@ -1614,13 +1533,13 @@ exports.linter21 = async () => { NoUnreferenced: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(1); + expect(errors[0]).to.deep.equal({ type: `NoUnreferenced`, offset: { position: 257, end: 270 } }); -} +}); -exports.linter22 = async () => { +test('linter22', async () => { const lines = [ `**FREE`, ``, @@ -1643,13 +1562,13 @@ exports.linter22 = async () => { PrototypeCheck: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).to.equal(1); + expect(errors[0]).to.deep.equal({ type: `PrototypeCheck`, offset: { position: 8, end: 27 } }); -} +}); -exports.linter22_b = async () => { +test('linter22_b', async () => { const lines = [ `**FREE`, ``, @@ -1665,10 +1584,10 @@ exports.linter22_b = async () => { PrototypeCheck: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).to.equal(0); +}); -exports.linter23 = async () => { +test("linter23", async () => { const lines = [ `**free`, ``, @@ -1694,10 +1613,10 @@ exports.linter23 = async () => { NoUnreferenced: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter24 = async () => { +test("linter24", async () => { const lines = [ `**FREE`, ``, @@ -1752,15 +1671,15 @@ exports.linter24 = async () => { ] }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ type: `NoExternalTo`, offset: { position: 95, end: 132 } }); - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `Dcl-PR GetProfile ExtPgm('QSYGETPH')`); -} + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`Dcl-PR GetProfile ExtPgm('QSYGETPH')`); +}); -exports.linter25 = async () => { +test("linter25", async () => { const lines = [ `**FREE`, ``, @@ -1820,22 +1739,22 @@ exports.linter25 = async () => { ] }, cache); - assert.strictEqual(errors.length, 2); + expect(errors.length).toBe(2); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ type: `NoExternalTo`, offset: { position: 163, end: 200 } }); - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `Dcl-PR GetProfile ExtPgm('QSYGETPH')`); + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`Dcl-PR GetProfile ExtPgm('QSYGETPH')`); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).toEqual({ type: `NoExternalTo`, offset: { position: 506, end: 544 } }); - assert.strictEqual(lines.substring(errors[1].offset.position, errors[1].offset.end), `Dcl-Pr CloseProfile ExtPgm('QSYRLSPH')`); -} + expect(lines.substring(errors[1].offset.position, errors[1].offset.end)).toBe(`Dcl-Pr CloseProfile ExtPgm('QSYRLSPH')`); +}); -exports.linter26 = async () => { +test("linter26", async () => { const lines = [ `**FREE`, ``, @@ -1856,10 +1775,10 @@ exports.linter26 = async () => { NoUnreferenced: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter27 = async () => { +test("linter27", async () => { const lines = [ `**FREE`, ``, @@ -1879,13 +1798,13 @@ exports.linter27 = async () => { NoExecuteImmediate: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ type: `NoExecuteImmediate`, offset: { position: 105, end: 148 } }); -} +}); -exports.linter28 = async () => { +test("linter28", async () => { const lines = [ `**free`, `Dcl-Pr APGM extpgm(myvarNotused);`, @@ -1901,18 +1820,18 @@ exports.linter28 = async () => { NoExtProgramVariable: true }, cache); - assert.strictEqual(errors.length, 2); + expect(errors.length).toBe(2); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 26, end: 38 }, type: `NoExtProgramVariable` }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).toEqual({ offset: { position: 81, end: 93 }, type: `NoExtProgramVariable` }); -} +}); -exports.linter29 = async () => { +test("linter29", async () => { const lines = [ `**FREE`, ``, @@ -1934,22 +1853,22 @@ exports.linter29 = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(cache.variables.length, 1, `Expect length of 1`); - assert.strictEqual(cache.constants.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures.length, 1, `Expect length of 1`); - assert.strictEqual(cache.procedures[0].subItems.length, 1, `Expect length of 1`); + expect(cache.variables.length).toBe(1); + expect(cache.constants.length).toBe(1); + expect(cache.procedures.length).toBe(1); + expect(cache.procedures[0].subItems.length).toBe(1); const baseNameInclude = path.basename(cache.procedures[0].position.path); - assert.strictEqual(baseNameInclude, `copy1.rpgle`, `Path is incorrect`); - assert.strictEqual(cache.procedures[0].position.line, 2, `Index of 3 expected`); + expect(baseNameInclude).toBe("copy1.rpgle"); + expect(cache.procedures[0].position.line).toBe(2); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter30 = async () => { +test("linter30", async () => { const lines = [ `**FREE`, ``, @@ -1971,16 +1890,16 @@ exports.linter30 = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 39, end: 49 }, type: `IncludeMustBeRelative`, newValue: undefined }); -} +}); -exports.linter31_a = async () => { +test("linter31_a", async () => { const lines = [ `**FREE`, ``, @@ -2002,13 +1921,13 @@ exports.linter31_a = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter31_b = async () => { +test("linter31_b", async () => { const lines = [ `**FREE`, ``, @@ -2026,27 +1945,27 @@ exports.linter31_b = async () => { ].join(`\n`); const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - const { errors } = Linter.getErrors({ - uri, + const { errors } = Linter.getErrors({ + uri, content: lines, availableIncludes: [`tests/rpgle/copy1.rpgle`] }, { IncludeMustBeRelative: true, }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 39, end: 50 }, type: `IncludeMustBeRelative`, newValue: `'tests/rpgle/copy1.rpgle'` }); -} +}); -exports.linter32 = async () => { +test("linter32", async () => { const lines = [ `**FREE`, ``, @@ -2068,13 +1987,13 @@ exports.linter32 = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter32_b = async () => { +test("linter32_b", async () => { const lines = [ `**FREE`, ``, @@ -2100,19 +2019,19 @@ exports.linter32_b = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 39, end: 52 }, type: `IncludeMustBeRelative`, newValue: `'tests/rpgle/copy1.rpgle'` }); -} +}); -exports.linter33 = async () => { +test("linter33", async () => { const lines = [ `**FREE`, ``, @@ -2134,17 +2053,17 @@ exports.linter33 = async () => { IncludeMustBeRelative: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 39, end: 65 }, type: `IncludeMustBeRelative` }); -} +}); -exports.linter34 = async () => { +test("linter34", async () => { const lines = [ `**free`, `Dcl-s DeptNum Char(3);`, @@ -2170,16 +2089,16 @@ exports.linter34 = async () => { SQLHostVarCheck: true }, cache); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 183, end: 190 }, type: `SQLHostVarCheck`, newValue: `:Deptnum` }); -} +}); -exports.linter35 = async () => { +test("linter35", async () => { const lines = [ `**FREE`, ``, @@ -2204,10 +2123,10 @@ exports.linter35 = async () => { ForceOptionalParens: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter36 = async () => { +test("linter36", async () => { const lines = [ `**FREE`, ``, @@ -2232,10 +2151,10 @@ exports.linter36 = async () => { ForceOptionalParens: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.linter37 = async () => { +test("linter37", async () => { const lines = [ `**FREE`, ``, @@ -2258,18 +2177,18 @@ exports.linter37 = async () => { UselessOperationCheck: true }, cache); - assert.strictEqual(cache.includes.length, 1); - assert.strictEqual(cache.includes[0].line, 4); + expect(cache.includes.length).toBe(1); + expect(cache.includes[0].line).toBe(4); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 129, end: 135 }, type: `UselessOperationCheck` }); -} +}); -exports.linter38_subrefs = async () => { +test("linter38_subrefs", async () => { const lines = [ `**free`, ``, @@ -2358,36 +2277,36 @@ exports.linter38_subrefs = async () => { }, cache); const subfa = cache.find(`subfa`); - assert.strictEqual(subfa.references.length, 2); - assert.deepStrictEqual(subfa.references[1], { + expect(subfa.references.length).toBe(2); + expect(subfa.references[1]).toEqual({ offset: { position: 469, end: 474 } }); const structYesAlso = cache.find(`structYesAlso`); - assert.strictEqual(structYesAlso.references.length, 2); - assert.deepStrictEqual(structYesAlso.references[1], { + expect(structYesAlso.references.length).toBe(2); + expect(structYesAlso.references[1]).toEqual({ offset: { position: 485, end: 498 } }); const subfc = structYesAlso.subItems[0]; - assert.strictEqual(subfc.name, `subfc`); - assert.strictEqual(subfc.references.length, 1); + expect(subfc.name).toBe(`subfc`); + expect(subfc.references.length).toBe(1); const qualStructYes = cache.find(`qualStructYes`); - assert.strictEqual(qualStructYes.references.length, 2); - assert.deepStrictEqual(qualStructYes.references[1], { + expect(qualStructYes.references.length).toBe(2); + expect(qualStructYes.references[1]).toEqual({ offset: { position: 516, end: 529 } }); const qualsubA = qualStructYes.subItems[0]; - assert.strictEqual(qualsubA.name, `qualsubA`); - assert.strictEqual(qualsubA.references.length, 2); + expect(qualsubA.name).toBe(`qualsubA`); + expect(qualsubA.references.length).toBe(2); - assert.deepStrictEqual(qualsubA.references[0], { + expect(qualsubA.references[0]).toEqual({ offset: { position: 274, end: 282 } }); - assert.deepStrictEqual(qualsubA.references[1], { + expect(qualsubA.references[1]).toEqual({ offset: { position: 530, end: 538 } }); @@ -2395,58 +2314,58 @@ exports.linter38_subrefs = async () => { const subProc = procYes.scope; const localStructYes = subProc.find(`localStructYes`); - assert.strictEqual(localStructYes.references.length, 2); - assert.deepStrictEqual(localStructYes.references[1], { + expect(localStructYes.references.length).toBe(2); + expect(localStructYes.references[1]).toEqual({ offset: { position: 1158, end: 1172 } }); const localStructAlsoYes = subProc.find(`localStructAlsoYes`); - assert.strictEqual(localStructAlsoYes.references.length, 1); + expect(localStructAlsoYes.references.length).toBe(1); const subfe = localStructAlsoYes.subItems[0]; - assert.strictEqual(subfe.name, `subfe`); - assert.strictEqual(subfe.references.length, 2); - assert.deepStrictEqual(subfe.references[1], { + expect(subfe.name).toBe(`subfe`); + expect(subfe.references.length).toBe(2); + expect(subfe.references[1]).toEqual({ offset: { position: 1193, end: 1198 } }); const qualDimStructYup = cache.find(`qualDimStructYup`); - assert.strictEqual(qualDimStructYup.references.length, 4) + expect(qualDimStructYup.references.length).toBe(4) - assert.deepStrictEqual(qualDimStructYup.references[1], { + expect(qualDimStructYup.references[1]).toEqual({ offset: { position: 545, end: 561 } }); - assert.deepStrictEqual(qualDimStructYup.references[2], { + expect(qualDimStructYup.references[2]).toEqual({ offset: { position: 578, end: 594 } }); - assert.deepStrictEqual(qualDimStructYup.references[3], { + expect(qualDimStructYup.references[3]).toEqual({ offset: { position: 625, end: 641 } }); const boopABC = qualDimStructYup.subItems[0]; - assert.strictEqual(boopABC.name, `boopABC`); - assert.strictEqual(boopABC.references.length, 4); + expect(boopABC.name).toBe(`boopABC`); + expect(boopABC.references.length).toBe(4); - assert.deepStrictEqual(boopABC.references[0], { + expect(boopABC.references[0]).toEqual({ offset: { position: 411, end: 418 } }); - assert.deepStrictEqual(boopABC.references[1], { + expect(boopABC.references[1]).toEqual({ offset: { position: 565, end: 572 } }); - assert.deepStrictEqual(boopABC.references[2], { + expect(boopABC.references[2]).toEqual({ offset: { position: 612, end: 619 } }); - assert.deepStrictEqual(boopABC.references[3], { + expect(boopABC.references[3]).toEqual({ offset: { position: 663, end: 670 } }); -} +}); -exports.linter39 = async () => { +test("linter39", async () => { const lines = [ `**FREE`, `ctl-opt debug nomain option(*nodebugio: *srcstmt) ;`, @@ -2468,14 +2387,14 @@ exports.linter39 = async () => { RequiresProcedureDescription: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ type: `RequiresProcedureDescription`, offset: { position: 59, end: 84 } }); -}; +}); -exports.linter40 = async () => { +test("linter40", async () => { const lines = [ `**FREE`, `ctl-opt debug nomain option(*nodebugio: *srcstmt) ;`, @@ -2501,10 +2420,10 @@ exports.linter40 = async () => { RequiresProcedureDescription: true }, cache); - assert.strictEqual(errors.length, 0); -}; + expect(errors.length).toEqual(0); +}); -exports.linter40_return = async () => { +test("linter40_return", async () => { const lines = [ `**free`, `Dcl-Proc InputIsValid;`, @@ -2546,10 +2465,10 @@ exports.linter40_return = async () => { const procedure = cache.find(`InputIsValid`); const validationResult = procedure.scope.find(`validationResult`); - assert.strictEqual(validationResult.references.length, 7); -} + expect(validationResult.references.length).toEqual(7); +}); -exports.linter41 = async () => { +test("linter41", async () => { const lines = [ `**FREE`, ``, @@ -2570,28 +2489,28 @@ exports.linter41 = async () => { StringLiteralDupe: true }, cache); - assert.strictEqual(errors.length, 3); + expect(errors.length).toEqual(3); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ offset: { position: 52, end: 54 }, type: `RequireBlankSpecial`, newValue: `*BLANK` }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).toEqual({ offset: { position: 39, end: 44 }, type: `StringLiteralDupe`, newValue: undefined }); - assert.deepStrictEqual(errors[2], { + expect(errors[2]).toEqual({ offset: { position: 62, end: 67 }, type: `StringLiteralDupe`, newValue: undefined }); -} +}); -exports.linter42 = async () => { +test("linter42", async () => { const lines = [ `**FREE`, ``, @@ -2621,13 +2540,13 @@ exports.linter42 = async () => { RequireOtherBlock: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toEqual(1); + expect(errors[0]).toEqual({ type: `RequireOtherBlock`, offset: { position: 339, end: 344 } }); -}; +}); -exports.linter43 = async () => { +test("linter43", async () => { const lines = [ `**FREE`, ``, @@ -2660,10 +2579,10 @@ exports.linter43 = async () => { RequireOtherBlock: true }, cache); - assert.strictEqual(errors.length, 0); -}; + expect(errors.length).toEqual(0); +}); -exports.linter44 = async () => { +test("linter44", async () => { const lines = [ `**FREE`, ``, @@ -2701,16 +2620,16 @@ exports.linter44 = async () => { RequireOtherBlock: true }, cache); - assert.strictEqual(errors.length, 2); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(2); + expect(errors[0]).toEqual({ type: `RequireOtherBlock`, offset: { position: 552, end: 557 } }); - assert.deepStrictEqual(errors[1], { + expect(errors[1]).toEqual({ type: `RequireOtherBlock`, offset: { position: 561, end: 566 } }); -}; +}); -exports.issue_170 = async () => { +test("issue_170", async () => { const lines = [ `**FREE`, ``, @@ -2744,10 +2663,10 @@ exports.issue_170 = async () => { NoUnreferenced: true }, cache); - assert.deepStrictEqual(errors.length, 0); -}; + expect(errors.length).toBe(0); +}); -exports.issue_170a = async () => { +test("issue_170a", async () => { const lines = [ `**FREE`, ``, @@ -2767,24 +2686,24 @@ exports.issue_170a = async () => { NoUnreferenced: true }, cache); - assert.strictEqual(cache.structs.length, 1); + expect(cache.structs.length).toBe(1); const SBM_DS = cache.find(`SBM_DS`); - assert.strictEqual(SBM_DS.name, `SBM_DS`); - assert.strictEqual(SBM_DS.subItems.length, 1); - assert.strictEqual(SBM_DS.position.line, 2); - assert.strictEqual(SBM_DS.references.length, 1); + expect(SBM_DS.name).toBe(`SBM_DS`); + expect(SBM_DS.subItems.length).toBe(1); + expect(SBM_DS.position.line).toBe(2); + expect(SBM_DS.references.length).toBe(1); const Move1 = SBM_DS.subItems[0]; - assert.strictEqual(Move1.name, `Move1`); - assert.strictEqual(Object.keys(Move1.keyword).length, 2); - assert.strictEqual(Move1.position.line, 3); - assert.strictEqual(Move1.references.length, 1); + expect(Move1.name).toBe(`Move1`); + expect(Object.keys(Move1.keyword).length).toBe(2); + expect(Move1.position.line).toBe(3); + expect(Move1.references.length).toBe(1); - assert.deepStrictEqual(errors.length, 2); -} + expect(errors.length).toBe(2); +}); -exports.linter40_keywordrefs = async () => { +test("linter40_keywordrefs", async () => { const lines = [ `**free`, `Dcl-C RANDOMLEN 286;`, @@ -2799,20 +2718,20 @@ exports.linter40_keywordrefs = async () => { const RANDOMLEN = cache.find(`RANDOMLEN`); - assert.strictEqual(RANDOMLEN.references.length, 2); - assert.deepStrictEqual(RANDOMLEN.references[1], { + expect(RANDOMLEN.references.length).toBe(2); + expect(RANDOMLEN.references[1]).toEqual({ offset: { position: 64, end: 73 } }); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ offset: { position: 64, end: 73 }, type: `IncorrectVariableCase`, newValue: `RANDOMLEN` }); -} +}); -exports.linter_casing_on_error_not_a_variable = async () => { +test("linter_casing_on_error_not_a_variable", async () => { const lines = [ `**free`, `dcl-c ERROR -1;`, @@ -2829,10 +2748,10 @@ exports.linter_casing_on_error_not_a_variable = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 0, `on-error should not throw a variable casing error`); -} + expect(errors.length).toBe(0); +}); -exports.issue_175 = async () => { +test("issue_175", async () => { const lines = [ `**FREE`, ``, @@ -2871,10 +2790,10 @@ exports.issue_175 = async () => { NoUnreferenced: true }, cache); - assert.deepStrictEqual(errors.length, 0); -}; + expect(errors.length).toBe(0); +}); -exports.issue180 = async () => { +test("issue180", async () => { const lines = [ `**free`, `Begsr Checkemp;`, @@ -2906,224 +2825,14 @@ exports.issue180 = async () => { `Endsr;`, ].join(`\n`); - const parser = await parserSetup(); const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); Linter.getErrors({ uri, content: lines }, { CollectReferences: true, }, cache); -} - -exports.dcl_subf_issue184 = async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DftActGrp(*No);`, - ``, - `DCL-DS *N;`, - ` DCL-SUBF select CHAR(10);`, - ` name CHAR(10);`, - ` DCL-SUBF address CHAR(25);`, - `END-DS;`, - ``, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - UselessOperationCheck: true - }, cache); - - assert.strictEqual(errors.length, 1); - - assert.deepStrictEqual(errors[0], { - offset: { position: 94, end: 103 }, type: `UselessOperationCheck` - }); - - const selectVar = cache.find(`select`); - assert.strictEqual(selectVar.name, `select`); - - const nameVar = cache.find(`name`); - assert.strictEqual(nameVar.name, `name`); - - const addressVar = cache.find(`address`); - assert.strictEqual(addressVar.name, `address`); -} - -exports.dcl_parm_issue184 = async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DftActGrp(*No);`, - ``, - `DCL-PR myProc;`, - ` DCL-PARM select CHAR(10);`, - ` name CHAR(10);`, - ` DCL-PARM address CHAR(25);`, - `END-PR;`, - ``, - `Return;` - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - UselessOperationCheck: true - }, cache); - - assert.strictEqual(errors.length, 1); - - assert.deepStrictEqual(errors[0], { - offset: { position: 98, end: 107 }, type: `UselessOperationCheck` - }); - - const myProc = cache.find(`myProc`); - assert.strictEqual(myProc.name, `myProc`); - - const parms = myProc.subItems; - assert.strictEqual(parms[0].name, `select`); - assert.strictEqual(parms[1].name, `name`); - assert.strictEqual(parms[2].name, `address`); -} - -exports.prettyCommentsChange = async () => { - const lines = [ - `**FREE`, - ``, - `Ctl-Opt DFTACTGRP(*No);`, - ``, - `Dcl-s MyVariable2 Char(20);`, - ``, - `// my constant`, - `//`, - `// second line`, - `Dcl-C theConstant 'Hello world';`, - `//comment with bad indent`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - const { errors } = Linter.getErrors({ uri, content: lines }, { - PrettyComments: true - }, cache); - - assert.strictEqual(errors.length, 1); - - assert.deepStrictEqual(errors[0], { - offset: { position: 128, end: 130 }, - type: `PrettyComments`, - newValue: `// ` - }); -}; - -exports.issue_204 = async () => { - const lines = [ - `**free`, - ``, - `ctl-opt dftactgrp(*no);`, - ``, - `///`, - `// printf`, - `// Print to standard out`, - `// @param String value pointer`, - `///`, - `dcl-pr printf int(10) extproc('printf');`, - ` format pointer value options(*string);`, - `end-pr;`, - ``, - `dcl-ds person_t qualified template;`, - ` name int(10);`, - ` age char(50);`, - `end-ds;`, - ``, - `dcl-ds myperson likeds(person_t);`, - ``, - `myperson = PERSON_New();`, - `myperson.name = 'Liam Barry';`, - `myperson.age = 25;`, - `PERSON_printNice(myperson);`, - ``, - `return;`, - ``, - `dcl-proc PERSON_New;`, - ` dcl-pi *n LikeDS(person_t) end-pi;`, - ` // This is the constructor`, - ` // Maybe parameters to set the defaults?`, - ``, - ` dcl-ds person likeds(person_t);`, - ``, - ` // Set defaults`, - ` person.name = '';`, - ` person.age = 0;`, - ``, - ` return person;`, - `end-proc;`, - ``, - `dcl-proc PERSON_printNice;`, - ` dcl-pi *n;`, - ` person likeds(person_t);`, - ` end-pi;`, - ``, - ` printf(%trim(person.name) + ' ' + %char(person.age));`, - `end-proc;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - Linter.getErrors({ uri, content: lines }, { - CollectReferences: true, - }, cache); - - // Global checks - - const printf = cache.find(`printf`); - assert.strictEqual(printf.references.length, 2); - - const person_t = cache.find(`person_t`); - assert.strictEqual(person_t.references.length, 5); - - const myperson = cache.find(`myperson`); - assert.strictEqual(myperson.references.length, 5); - - const global_person = cache.find(`person`); - assert.strictEqual(global_person, null); - - // Proc A checks - - const PERSON_New = cache.find(`PERSON_New`); - assert.strictEqual(PERSON_New.references.length, 2); - const PERSON_New_person = PERSON_New.scope.find(`person`); - assert.strictEqual(PERSON_New_person.references.length, 4); - assert.strictEqual(PERSON_New_person.subItems.length, 2); - - // Proc B checks - - const PERSON_printNice = cache.find(`PERSON_printNice`); - assert.strictEqual(PERSON_printNice.references.length, 2); - const printNice_person = PERSON_printNice.scope.find(`person`); - assert.strictEqual(printNice_person.references.length, 3); - assert.strictEqual(printNice_person.subItems.length, 2); -} - -exports.issue_237 = async () => { - const lines = [ - `**FREE`, - `If MyVar <> ThatValue //This is fine`, - `;`, - ` DoThisCode();`, - `Else;`, - ` CoThatCOde();`, - `Endif;`, - `*INLR = *ON;`, - `Return;`, - ].join(`\n`); - - const cache = await parser.getDocs(uri, lines, {ignoreCache: true, withIncludes: true}); - const { indentErrors } = Linter.getErrors({ uri, content: lines }, { - indent: 2 - }, cache); - - assert.strictEqual(indentErrors.length, 0); -} +}); -exports.issue_234_a = async () => { +test("issue_234_a", async () => { const lines = [ `**free`, `DCL-DS MagicDS QUALIFIED;`, @@ -3138,11 +2847,11 @@ exports.issue_234_a = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.issue_234_b = async () => { +test("issue_234_b", async () => { const lines = [ `**free`, `ctl-opt debug option(*nodebugio: *srcstmt) dftactgrp(*no) actgrp(*caller)`, @@ -3161,10 +2870,10 @@ exports.issue_234_b = async () => { IncorrectVariableCase: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.issue_238 = async () => { +test("issue_238", async () => { const lines = [ `**FREE`, `/Copy Qcpysrc,Hspecle`, @@ -3183,10 +2892,10 @@ exports.issue_238 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0); -} + expect(indentErrors.length).toBe(0); +}); -exports.issue_240 = async () => { +test("issue_240", async () => { const lines = [ `**FREE`, ``, @@ -3224,9 +2933,9 @@ exports.issue_240 = async () => { "NoExternalTo": [`QCMD`, `QP2TERM`, `QSH`, `SYSTEM`, `QCMDEXC`] }, cache); - assert.strictEqual(errors.length, 1); + expect(errors.length).toBe(1); - assert.deepStrictEqual(errors[0], { + expect(errors[0]).toEqual({ type: `NoExternalTo`, offset: { position: 344, @@ -3234,10 +2943,10 @@ exports.issue_240 = async () => { } }); - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `dcl-pr QCMDEXC extpgm('QCMDEXC')`); -} + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`dcl-pr QCMDEXC extpgm('QCMDEXC')`); +}); -exports.issue_239 = async () => { +test("issue_239", async () => { const lines = [ `**FREE`, `ctl-opt dftactgrp(*NO);`, @@ -3264,10 +2973,10 @@ exports.issue_239 = async () => { RequiresParameter: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.issue_251 = async () => { +test("issue_251", async () => { const lines = [ `**free`, `ctl-opt debug option(*nodebugio: *srcstmt) dftactgrp(*no) actgrp(*caller)`, @@ -3300,12 +3009,12 @@ exports.issue_251 = async () => { ForceOptionalParens: true }, cache); - assert.strictEqual(errors.length, 1); - assert.strictEqual(errors[0].type, `ForceOptionalParens`); - assert.strictEqual(lines.substring(errors[0].offset.position, errors[0].offset.end), `iCost >= 10000`); -} + expect(errors.length).toBe(1); + expect(errors[0].type).toBe(`ForceOptionalParens`); + expect(lines.substring(errors[0].offset.position, errors[0].offset.end)).toBe(`iCost >= 10000`); +}); -exports.paddr_issue_250 = async () => { +test('paddr_issue_250', async () => { const lines = [ `**FREE`, `ctl-opt dftactgrp(*NO);`, @@ -3353,10 +3062,10 @@ exports.paddr_issue_250 = async () => { RequiresParameter: true }, cache); - assert.strictEqual(errors.length, 0); -} + expect(errors.length).toBe(0); +}); -exports.new_select_1 = async () => { +test('new_select_1', async () => { const lines = [ `**free`, `SELECT a.b(i).c(j);`, @@ -3378,13 +3087,13 @@ exports.new_select_1 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 5); + expect(indentErrors.length).toBe(5); // Expect all expected indent to be 2 - assert.strictEqual(indentErrors.some(e => e.expectedIndent !== 2), false) -} + expect(indentErrors.some(e => e.expectedIndent !== 2)).toBe(false); +}); -exports.new_select_2 = async () => { +test('new_select_2', async () => { const lines = [ `**free`, `SELECT a.b(i).c(j);`, @@ -3406,10 +3115,10 @@ exports.new_select_2 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0); -} + expect(indentErrors.length).toBe(0); +}); -exports.on_excp_1 = async () => { +test('on_excp_1', async () => { const lines = [ `**free`, `DCL-F badfile DISK(10) USROPN;`, @@ -3432,10 +3141,10 @@ exports.on_excp_1 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 0); -} + expect(indentErrors.length).toBe(0); +}); -exports.on_excp_2 = async () => { +test('on_excp_2', async () => { const lines = [ `**FREE`, `monitor; `, @@ -3450,15 +3159,15 @@ exports.on_excp_2 = async () => { indent: 2 }, cache); - assert.strictEqual(indentErrors.length, 1); - assert.deepStrictEqual(indentErrors[0], { + expect(indentErrors.length).toBe(1); + expect(indentErrors[0]).toEqual({ line: 3, expectedIndent: 2, currentIndent: 0 }); -} +}); -exports.range_1 = async () => { +test('range_1', async () => { const lines = [ `**free`, `ctl-opt debug option(*nodebugio: *srcstmt) dftactgrp(*no) actgrp(*caller)`, @@ -3480,22 +3189,22 @@ exports.range_1 = async () => { }, cache); const rangeRefs = cache.referencesInRange({position: 220, end: 260}); - assert.strictEqual(rangeRefs.length, 2); - assert.ok(rangeRefs[0].dec.name === `x`); - assert.ok(rangeRefs[1].dec.name === `y`); + expect(rangeRefs.length).toBe(2); + expect(rangeRefs[0].dec.name).toBe(`x`); + expect(rangeRefs[1].dec.name).toBe(`y`); - assert.deepStrictEqual(rangeRefs[0].refs, [ + expect(rangeRefs[0].refs).toEqual([ { position: 220, end: 221 }, { position: 256, end: 257 } ]); - assert.deepStrictEqual(rangeRefs[1].refs, [ + expect(rangeRefs[1].refs).toEqual([ { position: 235, end: 236 }, { position: 241, end: 242 } ]); -} +}); -exports.sqlRunner1_1 = async () => { +test('sqlRunner1_1', async () => { const lines = [ `**free`, `EXEC SQL`, @@ -3518,15 +3227,15 @@ exports.sqlRunner1_1 = async () => { SQLRunner: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ type: 'SQLRunner', offset: { position: 7, end: 74 }, newValue: 'EXEC SQL\n DECLARE CUSCUR CURSOR FOR\n SELECT CUSNO FROM CUSTOMER' }); -}; +}); -exports.sqlRunner1_b = async () => { +test('sqlRunner1_b', async () => { const lines = [ `**free`, `EXEC SQL DECLARE CUSCUR CURSOR FOR`, @@ -3548,10 +3257,10 @@ exports.sqlRunner1_b = async () => { SQLRunner: true }, cache); - assert.strictEqual(errors.length, 1); - assert.deepStrictEqual(errors[0], { + expect(errors.length).toBe(1); + expect(errors[0]).toEqual({ type: 'SQLRunner', offset: { position: 7, end: 72 }, newValue: 'EXEC SQL DECLARE CUSCUR CURSOR FOR\n SELECT CUSNO FROM CUSTOMER' }); -}; \ No newline at end of file +}); \ No newline at end of file diff --git a/tests/suite/references.ts b/tests/suite/references.test.ts similarity index 71% rename from tests/suite/references.ts rename to tests/suite/references.test.ts index b2feca8f..6c452c65 100644 --- a/tests/suite/references.ts +++ b/tests/suite/references.test.ts @@ -1,8 +1,8 @@ - import setupParser from "../parserSetup"; import Linter from "../../language/linter"; import Cache from "../../language/models/cache"; -import assert from "assert"; +import { test, expect } from "vitest"; + const parser = setupParser(); const uri = `source.rpgle`; @@ -56,7 +56,7 @@ const lines = [ `end-proc;`, ].join(`\n`); -export async function references_1_const() { +test("references_1_const", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -66,11 +66,11 @@ export async function references_1_const() { const falseConstIndex = lines.indexOf(`dcl-c FALSE`) + 7; const falseConst = Cache.referenceByOffset(cache, falseConstIndex); - assert.strictEqual(falseConst.name, `FALSE`); - assert.notStrictEqual(falseConst.references.length, 0); -} + expect(falseConst.name).toBe(`FALSE`); + expect(falseConst.references.length).not.toBe(0); +}); -export async function references_2_const() { +test("references_2_const", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -80,11 +80,11 @@ export async function references_2_const() { const trueConstIndex = lines.indexOf(`var1 = TRUE`) + 7; const trueConst = Cache.referenceByOffset(cache, trueConstIndex); - assert.strictEqual(trueConst.name, `TRUE`); - assert.strictEqual(trueConst.references.length, 2); -} + expect(trueConst.name).toBe(`TRUE`); + expect(trueConst.references.length).toBe(2); +}); -export async function references_3_enum() { +test("references_3_enum", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -94,11 +94,11 @@ export async function references_3_enum() { const colorsConstIndex = lines.indexOf(`var1 = COLORS`) + 7; const colorsConst = Cache.referenceByOffset(cache, colorsConstIndex); - assert.strictEqual(colorsConst.name, `COLORS`); - assert.strictEqual(colorsConst.references.length, 2); -} + expect(colorsConst.name).toBe(`COLORS`); + expect(colorsConst.references.length).toBe(2); +}); -export async function references_4_subfield_a() { +test("references_4_subfield_a", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -108,11 +108,11 @@ export async function references_4_subfield_a() { const greenSubfieldIndex = lines.indexOf(`var1 = COLORS.GREEN`) + 17; const greenConst = Cache.referenceByOffset(cache, greenSubfieldIndex); - assert.strictEqual(greenConst.name, `GREEN`); - assert.strictEqual(greenConst.references.length, 2); -} + expect(greenConst.name).toBe(`GREEN`); + expect(greenConst.references.length).toBe(2); +}); -export async function references_4_subfield_b() { +test("references_4_subfield_b", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -122,17 +122,17 @@ export async function references_4_subfield_b() { const greenSubfieldIndex = lines.indexOf(` GREEN 1`) + 3; const greenConst = Cache.referenceByOffset(cache, greenSubfieldIndex); - assert.strictEqual(greenConst.name, `GREEN`); - assert.strictEqual(greenConst.references.length, 2); + expect(greenConst.name).toBe(`GREEN`); + expect(greenConst.references.length).toBe(2); const refSubfieldIndex = lines.indexOf(` RED 2`) + 3; const redConst = Cache.referenceByOffset(cache, refSubfieldIndex); - assert.strictEqual(redConst.name, `RED`); - assert.strictEqual(redConst.references.length, 1); -} + expect(redConst.name).toBe(`RED`); + expect(redConst.references.length).toBe(1); +}); -export async function references_5() { +test("references_5", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -142,11 +142,11 @@ export async function references_5() { const var1Index = lines.indexOf(`var1 = TRUE`); const var1Var = Cache.referenceByOffset(cache, var1Index); - assert.strictEqual(var1Var.name, `var1`); - assert.strictEqual(var1Var.references.length, 5); -} + expect(var1Var.name).toBe(`var1`); + expect(var1Var.references.length).toBe(5); +}); -export async function references_6_subfield_dim() { +test("references_6_subfield_dim", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -158,15 +158,15 @@ export async function references_6_subfield_dim() { const redSubfieldIndex = baseIndex + 22; const varColors = Cache.referenceByOffset(cache, varColorsIndex); - assert.strictEqual(varColors.name, `varColors`); - assert.strictEqual(varColors.references.length, 2); + expect(varColors.name).toBe(`varColors`); + expect(varColors.references.length).toBe(2); const redSubfield = Cache.referenceByOffset(cache, redSubfieldIndex); - assert.strictEqual(redSubfield.name, `red`); - assert.strictEqual(redSubfield.references.length, 2); -} + expect(redSubfield.name).toBe(`red`); + expect(redSubfield.references.length).toBe(2); +}); -export async function references_7() { +test("references_7", async () => { const cache = await parser.getDocs(uri, lines, {ignoreCache: true}); Linter.getErrors({ uri, content: lines }, { @@ -176,6 +176,6 @@ export async function references_7() { const declareAbcIndex = lines.indexOf(`dcl-proc abc`) + 10; const varColors = Cache.referenceByOffset(cache, declareAbcIndex); - assert.strictEqual(varColors.name, `abc`); - assert.strictEqual(varColors.references.length, 1); -} \ No newline at end of file + expect(varColors.name).toEqual(`abc`); + expect(varColors.references.length).toEqual(1); +}); diff --git a/tests/tsconfig.json b/tests/tsconfig.json deleted file mode 100644 index 0de8648d..00000000 --- a/tests/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "ES2019", - "noImplicitAny": false, - "noUnusedParameters": false, - "strict": false, - "allowJs": true, - "outDir": "../out/tests", - "esModuleInterop": true, - "sourceMap": true - } -} \ No newline at end of file