diff --git a/Spell Checker.code-workspace b/Spell Checker.code-workspace index f129d84769..e81ac82bd5 100644 --- a/Spell Checker.code-workspace +++ b/Spell Checker.code-workspace @@ -61,6 +61,7 @@ "program": "${workspaceFolder:Client}/../../node_modules/jest/bin/jest", "cwd": "${fileDirname}", "args": ["--runInBand", "${fileBasename}"], + "env": { "NODE_OPTIONS": "--experimental-vm-modules" }, "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" }, @@ -71,6 +72,7 @@ "program": "${workspaceFolder:Client}/../../node_modules/jest/bin/jest", "cwd": "${fileWorkspaceFolder}", "args": ["--runInBand"], + "env": { "NODE_OPTIONS": "--experimental-vm-modules" }, "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" }, diff --git a/package-lock.json b/package-lock.json index ec49d1338f..046f9439ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "packages/_integrationTests" ], "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.0.0", - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-bundled-dicts": "^8.1.0", + "@cspell/cspell-types": "^8.1.0", "@types/react": "^17.0.70", - "cspell": "^8.0.0", + "cspell": "^8.1.0", "regexp-worker": "^2.0.2" }, "devDependencies": { @@ -106,6 +106,7 @@ }, "node_modules/@babel/code-frame": { "version": "7.22.13", + "dev": true, "license": "MIT", "dependencies": { "@babel/highlight": "^7.22.13", @@ -117,6 +118,7 @@ }, "node_modules/@babel/code-frame/node_modules/ansi-styles": { "version": "3.2.1", + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -127,6 +129,7 @@ }, "node_modules/@babel/code-frame/node_modules/chalk": { "version": "2.4.2", + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -139,6 +142,7 @@ }, "node_modules/@babel/code-frame/node_modules/color-convert": { "version": "1.9.3", + "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -146,10 +150,12 @@ }, "node_modules/@babel/code-frame/node_modules/color-name": { "version": "1.1.3", + "dev": true, "license": "MIT" }, "node_modules/@babel/code-frame/node_modules/has-flag": { "version": "3.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -157,6 +163,7 @@ }, "node_modules/@babel/code-frame/node_modules/supports-color": { "version": "5.5.0", + "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -376,6 +383,7 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -403,6 +411,7 @@ }, "node_modules/@babel/highlight": { "version": "7.22.13", + "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", @@ -415,6 +424,7 @@ }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -425,6 +435,7 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -437,6 +448,7 @@ }, "node_modules/@babel/highlight/node_modules/color-convert": { "version": "1.9.3", + "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -444,10 +456,12 @@ }, "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", + "dev": true, "license": "MIT" }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -455,6 +469,7 @@ }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", + "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -711,15 +726,15 @@ "license": "MIT" }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.0.0.tgz", - "integrity": "sha512-Phbb1ij1TQQuqxuuvxf5P6fvV9U+EVoATNLmDqFHvRZfUyuhgbJuCMzIPeBx4GfTTDWlPs51FYRvZ/Q8xBHsyA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.1.0.tgz", + "integrity": "sha512-o/R/kR1QO9SQV2hUroaguTlHD6MDDtrVY6Xj5eG0loM7T0Pm3TEdlGYQ0LP6O9/CfUiHTntIFUM+PJ999+LuHQ==", "dependencies": { "@cspell/dict-ada": "^4.0.2", "@cspell/dict-aws": "^4.0.0", "@cspell/dict-bash": "^4.1.2", - "@cspell/dict-companies": "^3.0.27", - "@cspell/dict-cpp": "^5.0.9", + "@cspell/dict-companies": "^3.0.28", + "@cspell/dict-cpp": "^5.0.10", "@cspell/dict-cryptocurrencies": "^4.0.0", "@cspell/dict-csharp": "^4.0.2", "@cspell/dict-css": "^4.0.12", @@ -728,16 +743,16 @@ "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.0", "@cspell/dict-elixir": "^4.0.3", - "@cspell/dict-en_us": "^4.3.11", + "@cspell/dict-en_us": "^4.3.12", "@cspell/dict-en-common-misspellings": "^1.0.2", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-filetypes": "^3.0.2", + "@cspell/dict-filetypes": "^3.0.3", "@cspell/dict-fonts": "^4.0.0", "@cspell/dict-fsharp": "^1.0.1", "@cspell/dict-fullstack": "^3.1.5", "@cspell/dict-gaming-terms": "^1.0.4", "@cspell/dict-git": "^2.0.0", - "@cspell/dict-golang": "^6.0.4", + "@cspell/dict-golang": "^6.0.5", "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.5", "@cspell/dict-html-symbol-entities": "^4.0.0", @@ -748,7 +763,7 @@ "@cspell/dict-lua": "^4.0.2", "@cspell/dict-makefile": "^1.0.0", "@cspell/dict-node": "^4.0.3", - "@cspell/dict-npm": "^5.0.12", + "@cspell/dict-npm": "^5.0.13", "@cspell/dict-php": "^4.0.4", "@cspell/dict-powershell": "^5.0.2", "@cspell/dict-public-licenses": "^2.0.5", @@ -757,7 +772,7 @@ "@cspell/dict-ruby": "^5.0.1", "@cspell/dict-rust": "^4.0.1", "@cspell/dict-scala": "^5.0.0", - "@cspell/dict-software-terms": "^3.3.9", + "@cspell/dict-software-terms": "^3.3.11", "@cspell/dict-sql": "^2.1.2", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", @@ -769,47 +784,47 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.0.0.tgz", - "integrity": "sha512-1ltK5N4xMGWjDSIkU+GJd3rXV8buXgO/lAgnpM1RhKWqAmG+u0k6pnhk2vIo/4qZQpgfK0l3J3h/Ky2FcE95vA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.1.0.tgz", + "integrity": "sha512-Iss9dq5XBc5wYADv/Z59W4DgRQYs8BSHNVD6+LbQctuqmeJAte426/oi4x0Y76AJtEe0N6BZouj8HXykovwP5w==", "dependencies": { - "@cspell/cspell-types": "8.0.0" + "@cspell/cspell-types": "8.1.0" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.0.0.tgz", - "integrity": "sha512-1MH+9q3AmbzwK1BYhSGla8e4MAAYzzPApGvv8eyv0rWDmgmDTkGqJPTTvYj1wFvll5ximQ5OolpPQGv3JoWvtQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.1.0.tgz", + "integrity": "sha512-HDNX7MFAPAJ9acyYBa1bG+P4WiHHMFNYeywYBf3h6ScVhHobAqnhqS6b8R7MVhVRivwnKIQPG3zK7UpcwfyRcw==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.0.0.tgz", - "integrity": "sha512-gtALHFLT2vSZ7BZlIg26AY3W9gkiqxPGE75iypWz06JHJs05ngnAR+h6VOu0+rmgx98hNfzPPEh4g+Tjm8Ma0A==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.1.0.tgz", + "integrity": "sha512-nlppKh2o6g0zz+oIQ/dZB+oFQFf8lvn3mJKBpDwoeQY7/o9ZORPibXjtqXM83OhhdpoUVuk+3RFMsnFBBffa2Q==", "dependencies": { - "global-dirs": "^3.0.1" + "global-directory": "^4.0.1" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.0.0.tgz", - "integrity": "sha512-1EYhIHoZnhxpfEp6Bno6yVWYBuYfaQrwIfeDMntnezUcSmi7RyroQEcp5U7sLv69vhRD2c81o7r8iUaAbPSmIg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.1.0.tgz", + "integrity": "sha512-9Enayhkef732f15kHgiUe4QKyJgKk1dcZ4EFq4eyzUUDFF/eBv6qTQo5k2juUhPIjaKosqqMBHg4ffXcpkhr+Q==", "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-types": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.0.0.tgz", - "integrity": "sha512-dPdxQI8dLJoJEjylaPYfCJNnm2XNMYPuowHE2FMcsnFR9hEchQAhnKVc/aD63IUYnUtUrPxPlUJdoAoj569e+g==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.1.0.tgz", + "integrity": "sha512-1SxBjQdZtVjrTs3Ftw5I3nNpuDjdpsFMvfbbt6EnxqMpmZiUwkqxLCKla0pEy5R9CZcFFlntlOTMTmNsIkgmWg==", "engines": { "node": ">=18" } @@ -828,14 +843,14 @@ "integrity": "sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q==" }, "node_modules/@cspell/dict-companies": { - "version": "3.0.27", - "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.27.tgz", - "integrity": "sha512-gaPR/luf+4oKGyxvW4GbxGGPdHiC5kj/QefnmQqrLFrLiCSXMZg5/NL+Lr4E5lcHsd35meX61svITQAvsT7lyQ==" + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.28.tgz", + "integrity": "sha512-UinHkMYB/1pUkLKm1PGIm9PBFYxeAa6YvbB1Rq/RAAlrs0WDwiDBr3BAYdxydukG1IqqwT5z9WtU+8D/yV/5lw==" }, "node_modules/@cspell/dict-cpp": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.0.9.tgz", - "integrity": "sha512-ql9WPNp8c+fhdpVpjpZEUWmxBHJXs9CJuiVVfW/iwv5AX7VuMHyEwid+9/6nA8qnCxkUQ5pW83Ums1lLjn8ScA==" + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.0.10.tgz", + "integrity": "sha512-WCRuDrkFdpmeIR6uXQYKU9loMQKNFS4bUhtHdv5fu4qVyJSh3k/kgmtTm1h1BDTj8EwPRc/RGxS+9Z3b2mnabA==" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "4.0.0", @@ -876,9 +891,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-en_us": { - "version": "4.3.11", - "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.11.tgz", - "integrity": "sha512-GhdavZFlS2YbUNcRtPbgJ9j6aUyq116LmDQ2/Q5SpQxJ5/6vVs8Yj5WxV1JD+Zh/Zim1NJDcneTOuLsUGi+Czw==" + "version": "4.3.12", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.12.tgz", + "integrity": "sha512-1bsUxFjgxF30FTzcU5uvmCvH3lyqVKR9dbwsJhomBlUM97f0edrd6590SiYBXDm7ruE68m3lJd4vs0Ev2D6FtQ==" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "1.0.2", @@ -889,9 +904,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.2.tgz", - "integrity": "sha512-StoC0wPmFNav6F6P8/FYFN1BpZfPgOmktb8gQ9wTauelWofPeBW+A0t5ncZt9hXHtnbGDA98v4ukacV+ucbnUg==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.3.tgz", + "integrity": "sha512-J9UP+qwwBLfOQ8Qg9tAsKtSY/WWmjj21uj6zXTI9hRLD1eG1uUOLcfVovAmtmVqUWziPSKMr87F6SXI3xmJXgw==" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.0", @@ -915,9 +930,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-golang": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.4.tgz", - "integrity": "sha512-jOfewPEyN6U9Q80okE3b1PTYBfqZgHh7w4o271GSuAX+VKJ1lUDhdR4bPKRxSDdO5jHArw2u5C8nH2CWGuygbQ==" + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.5.tgz", + "integrity": "sha512-w4mEqGz4/wV+BBljLxduFNkMrd3rstBNDXmoX5kD4UTzIb4Sy0QybWCtg2iVT+R0KWiRRA56QKOvBsgXiddksA==" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.1", @@ -965,9 +980,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-npm": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.12.tgz", - "integrity": "sha512-T/+WeQmtbxo7ad6hrdI8URptYstKJP+kXyWJZfuVJJGWJQ7yubxrI5Z5AfM+Dh/ff4xHmdzapxD9adaEQ727uw==" + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.13.tgz", + "integrity": "sha512-uPb3DlQA/FvlmzT5RjZoy7fy91mxMRZW1B+K3atVM5A/cmP1QlDaSW/iCtde5kHET1MOV7uxz+vy0Yha2OI5pQ==" }, "node_modules/@cspell/dict-php": { "version": "4.0.4", @@ -1009,9 +1024,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.9.tgz", - "integrity": "sha512-/O3EWe0SIznx18S7J3GAXPDe7sexn3uTsf4IlnGYK9WY6ZRuEywkXCB+5/USLTGf4+QC05pkHofphdvVSifDyA==" + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.11.tgz", + "integrity": "sha512-a2Zml4G47dbQ6GDdN7+YlIWs3nFnIcJkZOLT88m/LzxjApiF7AOZLqQiKwow03hyvGSuZy8itgQZmQHoPlw2vQ==" }, "node_modules/@cspell/dict-sql": { "version": "2.1.2", @@ -1036,20 +1051,20 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.0.0.tgz", - "integrity": "sha512-HNkCepopgiEGuI1QGA6ob4+ayvoSMxvAqetLxP0u1sZzc50LH2DEWwotcNrpVdzZOtERHvIBcGaQKIBEx8pPRQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.1.0.tgz", + "integrity": "sha512-TJ1OnP0ubdVr5YTMU15rVs8R6ROuPvP/Z5lY2gtHscEsf9tZxvIt3924uMc9fTJXgNsITNWSoCzgwJYcDvGM6A==", "dependencies": { - "import-meta-resolve": "^3.1.1" + "import-meta-resolve": "^4.0.0" }, "engines": { "node": ">=18.0" } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.0.0.tgz", - "integrity": "sha512-fRlqPSdpdub52vFtulDgLPzGPGe75I04ScId1zOO9ABP7/ro8VmaG//m1k7hsPkm6h7FG4jWympoA3aXDAcXaA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.1.0.tgz", + "integrity": "sha512-yBc3ejGpx3QLbfS+Sec8ycS+lKuou5rnnpfz3aVBCnNHUPozosFuNYPFB6Iah2CBY6v6rkDCkIp5vnp1IwQzdA==", "engines": { "node": ">=18" } @@ -5803,20 +5818,6 @@ "version": "1.0.3", "license": "MIT" }, - "node_modules/cosmiconfig": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz", - "integrity": "sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==", - "dependencies": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/create-jest": { "version": "29.7.0", "dev": true, @@ -5897,24 +5898,24 @@ } }, "node_modules/cspell": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.0.0.tgz", - "integrity": "sha512-Nayy25Dh+GAlDFDpVZaQhmidP947rpj1Pn9lmZ3nUFjD9W/yj0h0vrjMLMN4dbonddkmKh4t51C+7NuMP405hg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.1.0.tgz", + "integrity": "sha512-oxQLyhW3yIAfvDdtoobvriWqfWVqOBo1o+WWRxlDyJdKDBH6my++p6KU3ZjxcJb7VG+CRLGfU7zASWwTPxMXRA==", "dependencies": { - "@cspell/cspell-json-reporter": "8.0.0", - "@cspell/cspell-pipe": "8.0.0", - "@cspell/cspell-types": "8.0.0", - "@cspell/dynamic-import": "8.0.0", + "@cspell/cspell-json-reporter": "8.1.0", + "@cspell/cspell-pipe": "8.1.0", + "@cspell/cspell-types": "8.1.0", + "@cspell/dynamic-import": "8.1.0", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^11.1.0", - "cspell-gitignore": "8.0.0", - "cspell-glob": "8.0.0", - "cspell-io": "8.0.0", - "cspell-lib": "8.0.0", + "cspell-gitignore": "8.1.0", + "cspell-glob": "8.1.0", + "cspell-io": "8.1.0", + "cspell-lib": "8.1.0", "fast-glob": "^3.3.2", "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^7.0.1", + "file-entry-cache": "^7.0.2", "get-stdin": "^9.0.0", "semver": "^7.5.4", "strip-ansi": "^7.1.0", @@ -5931,88 +5932,53 @@ "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" } }, - "node_modules/cspell-dictionary": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.0.0.tgz", - "integrity": "sha512-R/AzUj7W7F4O4fAOL8jvIiUqPYGy6jIBlDkxO9SZe/A6D2kOICZZzGSXMZ0M7OKYqxc6cioQUMKOJsLkDXfDXw==", + "node_modules/cspell-config-lib": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.1.0.tgz", + "integrity": "sha512-mIv8etMAp05OapdxJQt0nkfzclMti8AfACPryWnVePrwB89A2KjErHYBa7hX6gn20B4K+KgD7ckPcOi6L8vLYA==", "dependencies": { - "@cspell/cspell-pipe": "8.0.0", - "@cspell/cspell-types": "8.0.0", - "cspell-trie-lib": "8.0.0", - "fast-equals": "^4.0.3", - "gensequence": "^6.0.0" + "@cspell/cspell-types": "8.1.0", + "comment-json": "^4.2.3", + "yaml": "^2.3.4" }, "engines": { "node": ">=18" } }, - "node_modules/cspell-dictionary/node_modules/fast-equals": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", - "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==" - }, - "node_modules/cspell-gitignore": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.0.0.tgz", - "integrity": "sha512-Uv+ENdUm+EXwQuG9187lKmE1t8b2KW+6VaQHP7r01WiuhkwhfzmWA7C30iXVcwRcsMw07wKiWvMEtG6Zlzi6lQ==", + "node_modules/cspell-dictionary": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.1.0.tgz", + "integrity": "sha512-nwvlPiM7jsZThZ2bUS2CYzqwAbxWC4OL5GozQfbGEwW/8unNhifBpJzlOZuzLyX4Vu94ETExeIc625wBqPWjVA==", "dependencies": { - "cspell-glob": "8.0.0", - "find-up": "^5.0.0" - }, - "bin": { - "cspell-gitignore": "bin.mjs" + "@cspell/cspell-pipe": "8.1.0", + "@cspell/cspell-types": "8.1.0", + "cspell-trie-lib": "8.1.0", + "fast-equals": "^5.0.1", + "gensequence": "^6.0.0" }, "engines": { "node": ">=18" } }, - "node_modules/cspell-gitignore/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-gitignore/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/cspell-gitignore": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.1.0.tgz", + "integrity": "sha512-upMIEjbBz1g92Vt80h2hMMRZ9057iAmCWxi05l0WrwGrtc3CGsA8gQQIFIbVZ0x86Sbmv1cBZms1Y/hKWPWuvg==", "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" + "cspell-glob": "8.1.0", + "find-up-simple": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-gitignore/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": { - "p-limit": "^3.0.2" + "bin": { + "cspell-gitignore": "bin.mjs" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=18" } }, "node_modules/cspell-glob": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.0.0.tgz", - "integrity": "sha512-wOkRA1OTIPhyN7a+k9Qq45yFXM+tBFi9DS5ObiLv6t6VTBIeMQpwRK0KLViHmjTgiA6eWx53Dnr+DZfxcAkcZA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.1.0.tgz", + "integrity": "sha512-onPRqJqPZaaUQ1CKeuh2fJJ9UjIBicRq6Ffd6bqWCu7IdwfEBPtjWa/nlEjCVp1CMRwhS3Y0zG3jHkKLydsR4Q==", "dependencies": { "micromatch": "^4.0.5" }, @@ -6021,12 +5987,12 @@ } }, "node_modules/cspell-grammar": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.0.0.tgz", - "integrity": "sha512-uxpRvbBxOih6SjFQvKTBPTA+YyqYM5UFTNTFuRnA6g6WZeg+NJaTkbQrTgXja4B2r8MJ6XU22YrKTtHNNcP7bQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.1.0.tgz", + "integrity": "sha512-E28SDJYOOuHk8eBtMSIGyCu8qiKb/H4LX1J/kw8+eV0RLvnllmq2FAYFBk8jtu4uW49TW5n/eLg7J2TvPONYAA==", "dependencies": { - "@cspell/cspell-pipe": "8.0.0", - "@cspell/cspell-types": "8.0.0" + "@cspell/cspell-pipe": "8.1.0", + "@cspell/cspell-types": "8.1.0" }, "bin": { "cspell-grammar": "bin.mjs" @@ -6036,38 +6002,37 @@ } }, "node_modules/cspell-io": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.0.0.tgz", - "integrity": "sha512-NVdVmQd7SU/nxYwWtO/6gzux/kp1Dt36zKds0+QHZhQ18JJjXduF5e+WUttqKi2oj/vvmjiG4HGFKQVDBcBz3w==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.1.0.tgz", + "integrity": "sha512-oPRMS/XUWcdZXMj6Zhs65mgOVyRZajAhHLm18o6cPLOGUD0770oMqi8ZNKj7LuvubkyP/NL0m4AEcWwvmz/Cbw==", "dependencies": { - "@cspell/cspell-service-bus": "8.0.0" + "@cspell/cspell-service-bus": "8.1.0" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.0.0.tgz", - "integrity": "sha512-X/BzUjrzHOx7YlhvSph/OlMu1RmCTnybeZvIE67d1Pd7wT1TmZhFTnmvruUhoHxWEudOEe4HjzuNL9ph6Aw+aA==", - "dependencies": { - "@cspell/cspell-bundled-dicts": "8.0.0", - "@cspell/cspell-pipe": "8.0.0", - "@cspell/cspell-resolver": "8.0.0", - "@cspell/cspell-types": "8.0.0", - "@cspell/dynamic-import": "8.0.0", - "@cspell/strong-weak-map": "8.0.0", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.1.0.tgz", + "integrity": "sha512-tatdY9teElqqPtKHAY1osOhV68h/f3x+4Niw7rV12OXmJ9El1lPka59bVTV401fODWRoF3WWJXUpTg012zhdrQ==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "8.1.0", + "@cspell/cspell-pipe": "8.1.0", + "@cspell/cspell-resolver": "8.1.0", + "@cspell/cspell-types": "8.1.0", + "@cspell/dynamic-import": "8.1.0", + "@cspell/strong-weak-map": "8.1.0", "clear-module": "^4.1.2", "comment-json": "^4.2.3", "configstore": "^6.0.0", - "cosmiconfig": "8.0.0", - "cspell-dictionary": "8.0.0", - "cspell-glob": "8.0.0", - "cspell-grammar": "8.0.0", - "cspell-io": "8.0.0", - "cspell-trie-lib": "8.0.0", + "cspell-config-lib": "8.1.0", + "cspell-dictionary": "8.1.0", + "cspell-glob": "8.1.0", + "cspell-grammar": "8.1.0", + "cspell-io": "8.1.0", + "cspell-trie-lib": "8.1.0", "fast-equals": "^5.0.1", - "find-up": "^6.3.0", "gensequence": "^6.0.0", "import-fresh": "^3.3.0", "resolve-from": "^5.0.0", @@ -6078,89 +6043,13 @@ "node": ">=18" } }, - "node_modules/cspell-lib/node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-lib/node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-lib/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-lib/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cspell-lib/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/cspell-lib/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==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cspell-trie-lib": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.0.0.tgz", - "integrity": "sha512-0rC5e1C0uM78uuS+lC1T18EojWZyNvq4bPOPCisnwuhuWrAfCqrFrX/qDNslWk3VTOPbsEMlFj6OnIGQnfwSKg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.1.0.tgz", + "integrity": "sha512-OF5ZNuGPIGg2CCMdMeAgd1I2iVDjoelpMjVDyqpuNu+RVpAkmNRqMFDBlsnJPWCCeOLn7blWPMBZW2KXctsm3Q==", "dependencies": { - "@cspell/cspell-pipe": "8.0.0", - "@cspell/cspell-types": "8.0.0", + "@cspell/cspell-pipe": "8.1.0", + "@cspell/cspell-types": "8.1.0", "gensequence": "^6.0.0" }, "engines": { @@ -6188,11 +6077,11 @@ } }, "node_modules/cspell/node_modules/file-entry-cache": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.1.tgz", - "integrity": "sha512-uLfFktPmRetVCbHe5UPuekWrQ6hENufnA46qEGbfACkK5drjTTdQYUragRgMjHldcbYG+nslUerqMPjbBSHXjQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.2.tgz", + "integrity": "sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==", "dependencies": { - "flat-cache": "^3.1.1" + "flat-cache": "^3.2.0" }, "engines": { "node": ">=12.0.0" @@ -7051,6 +6940,7 @@ }, "node_modules/error-ex": { "version": "1.3.2", + "dev": true, "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" @@ -7228,6 +7118,7 @@ }, "node_modules/escape-string-regexp": { "version": "1.0.5", + "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -8165,17 +8056,28 @@ "node": ">=8" } }, + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/flat-cache": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", - "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": ">=12.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -8444,15 +8346,15 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", "dependencies": { - "ini": "2.0.0" + "ini": "4.1.1" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -8987,9 +8889,9 @@ } }, "node_modules/import-meta-resolve": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", - "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9023,11 +8925,11 @@ "license": "ISC" }, "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/inject-markdown": { @@ -9181,6 +9083,7 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", + "dev": true, "license": "MIT" }, "node_modules/is-async-function": { @@ -10347,6 +10250,7 @@ }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "dev": true, "license": "MIT" }, "node_modules/json-rpc-api": { @@ -10598,6 +10502,7 @@ }, "node_modules/lines-and-columns": { "version": "1.2.4", + "dev": true, "license": "MIT" }, "node_modules/linkify-it": { @@ -16387,6 +16292,7 @@ }, "node_modules/parse-json": { "version": "5.2.0", + "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", @@ -16495,6 +16401,7 @@ }, "node_modules/path-type": { "version": "4.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -21267,6 +21174,21 @@ } } }, + "node_modules/vitest-when": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/vitest-when/-/vitest-when-0.2.0.tgz", + "integrity": "sha512-BS1+L6HPwV3cMQB+pGa1Zr7gFkKX1TG8GbdgzpTlyW19nvWBmqDZW5GucS79K/lEu0ULWOUceHM56dnr8P/ajg==", + "dev": true, + "peerDependencies": { + "@vitest/expect": ">=0.31.0 <1.0.0", + "vitest": ">=0.31.0 <1.0.0" + }, + "peerDependenciesMeta": { + "@vitest/expect": { + "optional": true + } + } + }, "node_modules/vitest/node_modules/@types/node": { "version": "20.6.0", "dev": true, @@ -22053,8 +21975,8 @@ "name": "@internal/cspell-helper", "version": "1.0.0", "dependencies": { - "@cspell/cspell-types": "^8.0.0", - "cspell-lib": "^8.0.0" + "@cspell/cspell-types": "^8.1.0", + "cspell-lib": "^8.1.0" }, "bin": { "build": "build.mjs" @@ -22105,7 +22027,7 @@ "mocha": "^10.2.0" }, "devDependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@types/chai": "^4.3.10", "@types/decompress": "^4.2.7", "@types/glob": "^8.1.0", @@ -22542,13 +22464,13 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.0.0", - "@cspell/cspell-pipe": "^8.0.0", - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-bundled-dicts": "^8.1.0", + "@cspell/cspell-pipe": "^8.1.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", - "cspell-gitignore": "^8.0.0", - "cspell-glob": "^8.0.0", - "cspell-lib": "^8.0.0", + "cspell-gitignore": "^8.1.0", + "cspell-glob": "^8.1.0", + "cspell-lib": "^8.1.0", "gensequence": "^6.0.0", "json-rpc-api": "file:../json-rpc-api", "node-watch": "^0.7.4", @@ -22581,9 +22503,9 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", - "cspell-lib": "^8.0.0", + "cspell-lib": "^8.1.0", "regexp-worker": "^2.0.2", "vscode-languageserver": "^9.0.1", "vscode-languageserver-textdocument": "^1.0.11", @@ -22654,7 +22576,7 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", "@internal/settings-webview": "file:../_settingsViewer", "code-spell-checker-server": "file:../_server", @@ -22676,19 +22598,15 @@ "devDependencies": { "@internal/cspell-helper": "file:../__cspell-helper", "@internal/locale-resolver": "file:../__locale-resolver", - "@types/jest": "^29.5.8", - "@types/jest-when": "^3.5.5", "@types/kefir": "^3.8.10", "@types/source-map-support": "^0.5.10", "cross-env": "^7.0.3", - "cspell-lib": "^8.0.0", - "jest": "^29.7.0", - "jest-when": "^3.6.0", + "cspell-lib": "^8.1.0", "lorem-ipsum": "^2.0.8", "rfdc": "^1.3.0", "source-map-support": "^0.5.21", - "ts-jest": "^29.1.1", "ts-loader": "^9.5.1", + "vitest-when": "^0.2.0", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" }, diff --git a/package.json b/package.json index 14fa7b1003..2c78fbbc9e 100644 --- a/package.json +++ b/package.json @@ -3351,10 +3351,10 @@ "vitest": "^0.34.6" }, "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.0.0", - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-bundled-dicts": "^8.1.0", + "@cspell/cspell-types": "^8.1.0", "@types/react": "^17.0.70", - "cspell": "^8.0.0", + "cspell": "^8.1.0", "regexp-worker": "^2.0.2" }, "comment-resolutions": { diff --git a/packages/__cspell-helper/package.json b/packages/__cspell-helper/package.json index 4db7ba237d..614599e216 100644 --- a/packages/__cspell-helper/package.json +++ b/packages/__cspell-helper/package.json @@ -22,8 +22,8 @@ "yargs": "^17.7.2" }, "dependencies": { - "@cspell/cspell-types": "^8.0.0", - "cspell-lib": "^8.0.0" + "@cspell/cspell-types": "^8.1.0", + "cspell-lib": "^8.1.0" }, "engines": { "node": ">18.0.0" diff --git a/packages/__cspell-helper/src/index.ts b/packages/__cspell-helper/src/index.ts index 7df9f86821..1ccebb31b8 100644 --- a/packages/__cspell-helper/src/index.ts +++ b/packages/__cspell-helper/src/index.ts @@ -1,9 +1,9 @@ import type { CSpellSettings } from '@cspell/cspell-types'; -import { getDefaultSettings, getGlobalSettings, mergeSettings, searchForConfig } from 'cspell-lib'; +import { getDefaultSettings, getGlobalSettingsAsync, mergeSettings, searchForConfig } from 'cspell-lib'; export interface CSpellExports { - getDefaultSettings(useDefaultDicts?: boolean): CSpellSettings; - getGlobalSettings(): CSpellSettings; + getDefaultSettings(useDefaultDicts?: boolean): Promise; + getGlobalSettings(): Promise; mergeSettings(left: CSpellSettings, ...rest: CSpellSettings[]): CSpellSettings; searchForConfig(fromFile?: string): Promise; } @@ -11,7 +11,7 @@ export interface CSpellExports { export async function importCSpellLib(): Promise { return { getDefaultSettings, - getGlobalSettings, + getGlobalSettings: getGlobalSettingsAsync, mergeSettings, searchForConfig, }; diff --git a/packages/_integrationTests/package.json b/packages/_integrationTests/package.json index ab5e2b7c9b..c63a4c5970 100644 --- a/packages/_integrationTests/package.json +++ b/packages/_integrationTests/package.json @@ -23,7 +23,7 @@ "author": "", "license": "MIT", "devDependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@types/chai": "^4.3.10", "@types/decompress": "^4.2.7", "@types/glob": "^8.1.0", diff --git a/packages/_server/package.json b/packages/_server/package.json index af9aa22d9c..834c55bb61 100644 --- a/packages/_server/package.json +++ b/packages/_server/package.json @@ -35,13 +35,13 @@ "yargs": "^17.7.2" }, "dependencies": { - "@cspell/cspell-bundled-dicts": "^8.0.0", - "@cspell/cspell-pipe": "^8.0.0", - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-bundled-dicts": "^8.1.0", + "@cspell/cspell-pipe": "^8.1.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", - "cspell-gitignore": "^8.0.0", - "cspell-glob": "^8.0.0", - "cspell-lib": "^8.0.0", + "cspell-gitignore": "^8.1.0", + "cspell-glob": "^8.1.0", + "cspell-lib": "^8.1.0", "gensequence": "^6.0.0", "json-rpc-api": "file:../json-rpc-api", "node-watch": "^0.7.4", diff --git a/packages/_server/src/SuggestionsGenerator.test.mts b/packages/_server/src/SuggestionsGenerator.test.mts index ad042c10ec..6f855954be 100644 --- a/packages/_server/src/SuggestionsGenerator.test.mts +++ b/packages/_server/src/SuggestionsGenerator.test.mts @@ -38,7 +38,7 @@ describe('Validate Suggestions', () => { ); async function getSettings(doc: DocInfo) { - const settings = await cspell.constructSettingsForText(cspell.getDefaultSettings(), doc.text || '', doc.languageId); + const settings = await cspell.constructSettingsForText(await cspell.getDefaultSettings(), doc.text || '', doc.languageId); const dictionary = await cspell.getDictionary(settings); return { settings, dictionary }; } diff --git a/packages/_server/src/config/documentSettings.mts b/packages/_server/src/config/documentSettings.mts index 5230494e37..e0c7b44f78 100644 --- a/packages/_server/src/config/documentSettings.mts +++ b/packages/_server/src/config/documentSettings.mts @@ -122,7 +122,7 @@ export class DocumentSettings { constructor( readonly connection: Connection, readonly api: ServerSideApi, - readonly defaultSettings: CSpellUserSettings = _defaultSettings, + readonly defaultSettings: CSpellUserSettings | Promise = _defaultSettings, ) {} async getSettings(document: TextDocumentUri): Promise { @@ -210,10 +210,10 @@ export class DocumentSettings { return this._folders(); } - private _importSettings() { + private async _importSettings() { log('importSettings'); const importPaths = [...this.configsToImport].sort(); - return mergeSettings({}, ...readSettingsFiles(importPaths)); + return readAndMergeSettingsFiles(importPaths); } private async _fetchWorkspaceConfiguration(uri: DocumentUri): Promise { @@ -338,12 +338,12 @@ export class DocumentSettings { const settings = vscodeCSpellConfigSettingsForDocument.noConfigSearch ? undefined : await searchForConfig(searchForFsPath); const rootFolder = this.rootSchemaAndDomainFolderForUri(docUri); const folder = await this.findMatchingFolder(docUri, folders[0] || rootFolder); - const vscodeCSpellSettings = resolveConfigImports(vscodeCSpellConfigSettingsForDocument, folder.uri); + const vscodeCSpellSettings = await resolveConfigImports(vscodeCSpellConfigSettingsForDocument, folder.uri); const globRootFolder = folder !== rootFolder ? folder : folders[0] || folder; - const mergedSettingsFromVSCode = mergeSettings(this.importedSettings(), vscodeCSpellSettings); + const mergedSettingsFromVSCode = mergeSettings(await this.importedSettings(), vscodeCSpellSettings); const mergedSettings = mergeSettings( - this.defaultSettings, + await Promise.resolve(this.defaultSettings), filterMergeFields( mergedSettingsFromVSCode, vscodeCSpellSettings['mergeCSpellSettings'] || !settings, @@ -407,7 +407,7 @@ export class DocumentSettings { } } -function resolveConfigImports(config: CSpellUserSettings, folderUri: string): CSpellUserSettings { +async function resolveConfigImports(config: CSpellUserSettings, folderUri: string): Promise { log('resolveConfigImports:', folderUri); const uriFsPath = path.normalize(Uri.parse(folderUri).fsPath); const imports = typeof config.import === 'string' ? [config.import] : config.import || []; @@ -415,11 +415,15 @@ function resolveConfigImports(config: CSpellUserSettings, folderUri: string): CS log(`resolvingConfigImports: [\n${imports.join('\n')}]`); log(`resolvingConfigImports ABS: [\n${importAbsPath.join('\n')}]`); const { import: _import, ...result } = importAbsPath.length - ? mergeSettings({}, ...readSettingsFiles([...importAbsPath]), config) + ? mergeSettings(await readAndMergeSettingsFiles(importAbsPath), config) : config; return result; } +async function readAndMergeSettingsFiles(importAbsPaths: string[]): Promise { + return mergeSettings({}, ...(await Promise.all(readSettingsFiles([...importAbsPaths])))); +} + function readSettingsFiles(paths: string[]) { // log('readSettingsFiles:', paths); const existingPaths = paths.filter((filename) => exists(filename)); diff --git a/packages/_server/src/config/documentSettings.test.mts b/packages/_server/src/config/documentSettings.test.mts index 32dfeb921c..faa799face 100644 --- a/packages/_server/src/config/documentSettings.test.mts +++ b/packages/_server/src/config/documentSettings.test.mts @@ -402,7 +402,7 @@ describe('Validate DocumentSettings', () => { const mockFolders: WorkspaceFolder[] = [workspaceFolderRoot, workspaceFolderClient, workspaceFolderServer]; mockGetWorkspaceFolders.mockReturnValue(Promise.resolve(mockFolders)); mockGetConfiguration.mockReturnValue(Promise.resolve([{}, {}])); - const docSettings = newDocumentSettings(getDefaultSettings()); + const docSettings = newDocumentSettings(await getDefaultSettings()); const uri = Uri.file(Path.resolve(pathWorkspaceRoot, filename)).toString(); const result = await docSettings.findCSpellConfigurationFilesForUri(uri); // Note: toLowerCase is needed because on MacOS and Windows cSpell.json and cspell.json will be considered the same file. @@ -420,7 +420,7 @@ describe('Validate DocumentSettings', () => { const mockFolders: WorkspaceFolder[] = []; mockGetWorkspaceFolders.mockReturnValue(Promise.resolve(mockFolders)); mockGetConfiguration.mockReturnValue(Promise.resolve([{}, {}])); - const docSettings = newDocumentSettings(getDefaultSettings()); + const docSettings = newDocumentSettings(await getDefaultSettings()); const uri = Uri.file(Path.resolve(pathWorkspaceRoot, filename)).toString(); const result = await docSettings.findCSpellConfigurationFilesForUri(uri); // Note: toLowerCase is needed because on MacOS and Windows cSpell.json and cspell.json will be considered the same file. @@ -438,25 +438,25 @@ describe('Validate DocumentSettings', () => { }); describe('Validate RegExp corrections', () => { - test('fixRegEx', () => { - const defaultSettings = cspell.getDefaultSettings(); + test('fixRegEx', async () => { + const defaultSettings = await cspell.getDefaultSettings(); + const patterns = defaultSettings.patterns; + // Make sure it doesn't change the defaults. - expect(defaultSettings.patterns?.map((p) => p.pattern).map(debugExports.fixRegEx)).toEqual( - defaultSettings.patterns?.map((p) => p.pattern), - ); + expect(patterns?.map((p) => p.pattern).map(debugExports.fixRegEx)).toEqual(patterns?.map((p) => p.pattern)); const sampleRegEx: Pattern[] = ['/#.*/', '/"""(.*?\\n?)+?"""/g', "/'''(.*?\\n?)+?'''/g", 'strings']; const expectedRegEx: Pattern[] = ['/#.*/', '/(""")[^\\1]*?\\1/g', "/(''')[^\\1]*?\\1/g", 'strings']; expect(sampleRegEx.map(debugExports.fixRegEx)).toEqual(expectedRegEx); }); - test('fixPattern', () => { - const defaultSettings = cspell.getDefaultSettings(); + test('fixPattern', async () => { + const defaultSettings = await cspell.getDefaultSettings(); // Make sure it doesn't change the defaults. expect(defaultSettings.patterns?.map(debugExports.fixPattern)).toEqual(defaultSettings.patterns); }); - test('fixPattern', () => { - const defaultSettings = cspell.getDefaultSettings(); + test('fixPattern', async () => { + const defaultSettings = await cspell.getDefaultSettings(); // Make sure it doesn't change the defaults. expect(correctBadSettings(defaultSettings)).toEqual(defaultSettings); diff --git a/packages/_server/src/server.mts b/packages/_server/src/server.mts index 68aef9305a..a4efb70c10 100644 --- a/packages/_server/src/server.mts +++ b/packages/_server/src/server.mts @@ -69,15 +69,18 @@ const overRideDefaults: CSpellUserSettings = { // Turn off the spell checker by default. The setting files should have it set. // This prevents the spell checker from running too soon. -const defaultSettings: CSpellUserSettings = { - ...CSpell.mergeSettings(getDefaultSettings(), CSpell.getGlobalSettings(), overRideDefaults), - checkLimit: defaultCheckLimit, - // enabled: false, -}; +const defaultSettings = calcDefaultSettings(); const defaultDebounceMs = 50; // Refresh the dictionary cache every 1000ms. const dictionaryRefreshRateMs = 1000; +async function calcDefaultSettings(): Promise { + return { + ...CSpell.mergeSettings(await getDefaultSettings(), await CSpell.getGlobalSettingsAsync(), overRideDefaults), + checkLimit: defaultCheckLimit, + }; +} + export function run(): void { // debounce buffer const disposables = createDisposableList(); @@ -508,7 +511,7 @@ export function run(): void { async function getBaseSettings(doc: TextDocumentUri | undefined) { const settings = await getActiveSettings(doc); - return { ...CSpell.mergeSettings(defaultSettings, settings), enabledLanguageIds: settings.enabledLanguageIds }; + return { ...CSpell.mergeSettings(await defaultSettings, settings), enabledLanguageIds: settings.enabledLanguageIds }; } async function getSettingsToUseForDocument(doc: TextDocument) { diff --git a/packages/_server/src/validator.test.mts b/packages/_server/src/validator.test.mts index cd100bdff7..dd01a3a7be 100644 --- a/packages/_server/src/validator.test.mts +++ b/packages/_server/src/validator.test.mts @@ -10,7 +10,7 @@ import * as Validator from './validator.mjs'; // cSpell:ignore brouwn jumpped lazzy wrongg mispelled ctrip nmove mischecked -const defaultSettings: CSpellSettings = { ...getDefaultSettings(), enabledLanguageIds: ['plaintext', 'javascript'] }; +const defaultSettings: CSpellSettings = { ...(await getDefaultSettings()), enabledLanguageIds: ['plaintext', 'javascript'] }; const timeout = 30000; // 30 seconds diff --git a/packages/_serverPatternMatcher/package.json b/packages/_serverPatternMatcher/package.json index 9186f61873..6d5d5943c0 100644 --- a/packages/_serverPatternMatcher/package.json +++ b/packages/_serverPatternMatcher/package.json @@ -47,9 +47,9 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", - "cspell-lib": "^8.0.0", + "cspell-lib": "^8.1.0", "regexp-worker": "^2.0.2", "vscode-languageserver-textdocument": "^1.0.11", "vscode-languageserver": "^9.0.1", diff --git a/packages/_serverPatternMatcher/src/PatternMatcher.test.mts b/packages/_serverPatternMatcher/src/PatternMatcher.test.mts index ad6238f27f..5cbd8ff472 100644 --- a/packages/_serverPatternMatcher/src/PatternMatcher.test.mts +++ b/packages/_serverPatternMatcher/src/PatternMatcher.test.mts @@ -7,7 +7,7 @@ import { isRegExpMatch, isRegExpMatchTimeout, PatternMatcher } from './PatternMa const settings = { patterns: [], - ...getDefaultSettings(), + ...(await getDefaultSettings()), }; const defaultTimeout = 5000; diff --git a/packages/client/__mocks__/vscode-languageclient/node.js b/packages/client/__mocks__/vscode-languageclient/node.js new file mode 100644 index 0000000000..f67a589414 --- /dev/null +++ b/packages/client/__mocks__/vscode-languageclient/node.js @@ -0,0 +1,10 @@ +const DiagnosticSeverity = { + Error: 1, + Warning: 2, + Information: 3, + Hint: 4, +}; + +module.exports = { + DiagnosticSeverity, +}; diff --git a/packages/client/__mocks__/vscode.cts b/packages/client/__mocks__/vscode.cts new file mode 100644 index 0000000000..a7cd66b80c --- /dev/null +++ b/packages/client/__mocks__/vscode.cts @@ -0,0 +1,6 @@ +import { createVSCodeMock } from 'jest-mock-vscode'; +import { vi } from 'vitest'; + +const vscode = createVSCodeMock(vi); + +module.exports = vscode; diff --git a/packages/client/package.json b/packages/client/package.json index e4150b2ae3..0ce26132f6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -27,12 +27,13 @@ "build:esbuild": "node ./build.mjs", "build:api": "tsc -p tsconfig.api.json", "build:tsc": "tsc -p tsconfig.test.json", + "build:src": "tsc -p tsconfig.json", "clean-build-production": "npm run clean && npm run build:production", "clean-build": "npm run clean && npm run build", "clean": "shx rm -rf dist temp out coverage", "version": "npm run package-extension", - "test": "jest", - "test-watch": "jest --watch", + "test": "vitest run", + "test-watch": "vitest", "watch": "concurrently npm:watch:esbuild npm:watch:api npm:watch:tsc", "watch:esbuild": "npm run build:esbuild -- --watch", "watch:api": "npm run build:api.d.ts -- --watch", @@ -41,24 +42,20 @@ "devDependencies": { "@internal/cspell-helper": "file:../__cspell-helper", "@internal/locale-resolver": "file:../__locale-resolver", - "@types/jest": "^29.5.8", - "@types/jest-when": "^3.5.5", "@types/kefir": "^3.8.10", "@types/source-map-support": "^0.5.10", "cross-env": "^7.0.3", - "cspell-lib": "^8.0.0", - "jest": "^29.7.0", - "jest-when": "^3.6.0", + "cspell-lib": "^8.1.0", "lorem-ipsum": "^2.0.8", "rfdc": "^1.3.0", "source-map-support": "^0.5.21", - "ts-jest": "^29.1.1", "ts-loader": "^9.5.1", + "vitest-when": "^0.2.0", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" }, "dependencies": { - "@cspell/cspell-types": "^8.0.0", + "@cspell/cspell-types": "^8.1.0", "@internal/common-utils": "file:../__utils", "@internal/settings-webview": "file:../_settingsViewer", "code-spell-checker-server": "file:../_server", diff --git a/packages/client/src/Subscribables/StoreValue.test.ts b/packages/client/src/Subscribables/StoreValue.test.ts index 648f600191..e76dd28b53 100644 --- a/packages/client/src/Subscribables/StoreValue.test.ts +++ b/packages/client/src/Subscribables/StoreValue.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test, vi } from 'vitest'; + import { createEmitter, createSubscribable } from './createFunctions'; import { awaitSubscribable } from './helpers/awaitSubscribable'; import { createStoreValue } from './StoreValue'; @@ -8,7 +10,7 @@ describe('StoreValue', () => { expect(store.value).toBe(5); store.set(7); expect(store.value).toBe(7); - const cb = jest.fn(); + const cb = vi.fn(); store.subscribe(cb); expect(cb).toHaveBeenLastCalledWith(7); store.dispose(); diff --git a/packages/client/src/Subscribables/SubscribableView.test.ts b/packages/client/src/Subscribables/SubscribableView.test.ts index e232aa5b47..4ad48b14bd 100644 --- a/packages/client/src/Subscribables/SubscribableView.test.ts +++ b/packages/client/src/Subscribables/SubscribableView.test.ts @@ -1,4 +1,5 @@ import { disposeOf } from 'utils-disposables'; +import { describe, expect, test } from 'vitest'; import { map, rx } from '.'; import { createEmitter } from './createFunctions'; diff --git a/packages/client/src/Subscribables/Subscribables.test.ts b/packages/client/src/Subscribables/Subscribables.test.ts index 68151bb63d..c7cf3191bc 100644 --- a/packages/client/src/Subscribables/Subscribables.test.ts +++ b/packages/client/src/Subscribables/Subscribables.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test, vi } from 'vitest'; + import { createEmitter, createSubscribable } from './createFunctions'; import { awaitSubscribable } from './helpers/awaitSubscribable'; import { delayUnsubscribe } from './operators/delayUnsubscribe'; @@ -5,12 +7,12 @@ import { delayUnsubscribe } from './operators/delayUnsubscribe'; describe('Subscribables', () => { test('createEmitter', () => { const emitter = createEmitter(); - const sub = jest.fn(); + const sub = vi.fn(); emitter.subscribe(sub); expect(sub).not.toHaveBeenCalled(); emitter.notify(7); expect(sub).toHaveBeenLastCalledWith(7); - const sub2 = jest.fn(); + const sub2 = vi.fn(); const d2 = emitter.subscribe(sub2); expect(sub2).not.toHaveBeenCalled(); emitter.notify(49); diff --git a/packages/client/src/Subscribables/helpers/fromIterable.test.ts b/packages/client/src/Subscribables/helpers/fromIterable.test.ts index aece4c4d44..b71314c754 100644 --- a/packages/client/src/Subscribables/helpers/fromIterable.test.ts +++ b/packages/client/src/Subscribables/helpers/fromIterable.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { awaitSubscribableAll } from './awaitSubscribable'; import { fromIterable } from './fromIterable'; diff --git a/packages/client/src/Subscribables/helpers/toAsyncIterable.test.ts b/packages/client/src/Subscribables/helpers/toAsyncIterable.test.ts index 231e7ff8c5..547f205fc9 100644 --- a/packages/client/src/Subscribables/helpers/toAsyncIterable.test.ts +++ b/packages/client/src/Subscribables/helpers/toAsyncIterable.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { awaitAsyncIterable } from './awaitAsyncIterable'; import { fromIterable } from './fromIterable'; import { toAsyncIterable } from './toAsyncIterable'; diff --git a/packages/client/src/Subscribables/operators/awaitPromise.test.ts b/packages/client/src/Subscribables/operators/awaitPromise.test.ts index 0a26c5f57b..4a4fef4010 100644 --- a/packages/client/src/Subscribables/operators/awaitPromise.test.ts +++ b/packages/client/src/Subscribables/operators/awaitPromise.test.ts @@ -1,4 +1,5 @@ import { disposeOf } from 'utils-disposables'; +import { describe, expect, test, vi } from 'vitest'; import { createEmitter } from '../createFunctions'; import { rx } from '../rx'; @@ -8,10 +9,10 @@ describe('awaitPromise', () => { test('awaitPromise', async () => { const emitter = createEmitter>(); - const onReject = jest.fn(); + const onReject = vi.fn(); const stream = rx(emitter, awaitPromise(onReject)); - const notify = jest.fn(); + const notify = vi.fn(); const dispose = stream.subscribe(notify); const p0 = Promise.resolve('p0'); @@ -26,10 +27,10 @@ describe('awaitPromise', () => { test('awaitPromise rejected', async () => { const emitter = createEmitter>(); - const onReject = jest.fn(); + const onReject = vi.fn(); const stream = rx(emitter, awaitPromise(onReject)); - const notify = jest.fn(); + const notify = vi.fn(); const dispose = stream.subscribe(notify); const p0 = rejectIn(1, 'error'); @@ -47,12 +48,12 @@ describe('awaitPromise', () => { const promiseExpected = new WeakMap(); - const onReject = jest.fn>>((err, emitter, pValue) => + const onReject = vi.fn>>((err, emitter, pValue) => emitter(promiseExpected.get(pValue) || toStr(err)), ); const stream = rx(emitter, awaitPromise(onReject)); - const notify = jest.fn(); + const notify = vi.fn(); const dispose = stream.subscribe(notify); const p0 = rejectIn(1, 'error 0'); diff --git a/packages/client/src/Subscribables/operators/delayUnsubscribe.test.ts b/packages/client/src/Subscribables/operators/delayUnsubscribe.test.ts index 195880021c..6155a28c9f 100644 --- a/packages/client/src/Subscribables/operators/delayUnsubscribe.test.ts +++ b/packages/client/src/Subscribables/operators/delayUnsubscribe.test.ts @@ -1,4 +1,5 @@ import { createDisposable, disposeOf } from 'utils-disposables'; +import { describe, expect, test, vi } from 'vitest'; import { createSubscribable } from '../createFunctions'; import { toSubscriberFn } from '../helpers/toSubscriber'; @@ -8,10 +9,10 @@ import { delayUnsubscribe } from './delayUnsubscribe'; describe('delayUnsubscribe', () => { test('delayUnsubscribe', () => { - const receiver = jest.fn(); + const receiver = vi.fn(); const defaultEmitter = () => undefined; let emitter: SubscriberFn = defaultEmitter; - const resetEmitter = jest.fn(() => (emitter = defaultEmitter)); + const resetEmitter = vi.fn(() => (emitter = defaultEmitter)); expect(emitter).toBe(defaultEmitter); const source: SubscribeFn = (subscriber: SubscriberLike) => { emitter = toSubscriberFn(subscriber); @@ -52,10 +53,10 @@ describe('delayUnsubscribe', () => { }); test('delayUnsubscribe rx', () => { - const receiver = jest.fn(); + const receiver = vi.fn(); const defaultEmitter = () => undefined; let emitter: SubscriberFn = defaultEmitter; - const resetEmitter = jest.fn(() => (emitter = defaultEmitter)); + const resetEmitter = vi.fn(() => (emitter = defaultEmitter)); expect(emitter).toBe(defaultEmitter); const source: SubscribeFn = (subscriber: SubscriberLike) => { emitter = toSubscriberFn(subscriber); diff --git a/packages/client/src/Subscribables/operators/map.test.ts b/packages/client/src/Subscribables/operators/map.test.ts index 8ca354b816..f2363b99e0 100644 --- a/packages/client/src/Subscribables/operators/map.test.ts +++ b/packages/client/src/Subscribables/operators/map.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { awaitSubscribableAll } from '../helpers/awaitSubscribable'; import { rx } from '../rx'; import { map } from './map'; diff --git a/packages/client/src/Subscribables/operators/throttle.test.ts b/packages/client/src/Subscribables/operators/throttle.test.ts index 53d8093aef..fcc7a1102e 100644 --- a/packages/client/src/Subscribables/operators/throttle.test.ts +++ b/packages/client/src/Subscribables/operators/throttle.test.ts @@ -1,4 +1,5 @@ import { disposeOf } from 'utils-disposables'; +import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; import { createEmitter } from '../createFunctions'; import { rx } from '../rx'; @@ -6,26 +7,26 @@ import { throttle } from './throttle'; describe('throttle', () => { beforeEach(() => { - jest.useFakeTimers(); + vi.useFakeTimers(); }); afterEach(() => { - jest.resetAllMocks(); - jest.useRealTimers(); + vi.resetAllMocks(); + vi.useRealTimers(); }); test('throttle', () => { const emitter = createEmitter(); const stream = rx(emitter, throttle(1000)); - const notify = jest.fn(); - const done = jest.fn(); + const notify = vi.fn(); + const done = vi.fn(); let counter = 55; let leading = counter; let trailing = counter; emitter.notify(++counter); const disposable = stream.subscribe({ notify, done }); - jest.runOnlyPendingTimers(); + vi.runOnlyPendingTimers(); expect(notify).not.toHaveBeenCalled(); expect(done).not.toHaveBeenCalled(); @@ -36,9 +37,9 @@ describe('throttle', () => { expect(notify).toHaveBeenLastCalledWith(leading); - jest.runOnlyPendingTimers(); + vi.runOnlyPendingTimers(); expect(notify).toHaveBeenLastCalledWith(trailing); - jest.runOnlyPendingTimers(); + vi.runOnlyPendingTimers(); emitter.notify((leading = ++counter)); expect(notify).toHaveBeenLastCalledWith(leading); diff --git a/packages/client/src/Subscribables/pipe.test.ts b/packages/client/src/Subscribables/pipe.test.ts index bdb146f81a..c51521f18a 100644 --- a/packages/client/src/Subscribables/pipe.test.ts +++ b/packages/client/src/Subscribables/pipe.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { awaitSubscribableAll } from './helpers/awaitSubscribable'; import { map } from './operators'; import { pipe } from './pipe'; diff --git a/packages/client/src/autocomplete.test.ts b/packages/client/src/autocomplete.test.ts index 7f7e24765f..8369b69dea 100644 --- a/packages/client/src/autocomplete.test.ts +++ b/packages/client/src/autocomplete.test.ts @@ -1,8 +1,12 @@ +import { describe, expect, test, vi } from 'vitest'; import { languages } from 'vscode'; import { registerCspellInlineCompletionProviders } from './autocomplete'; -const mockedRegisterCompletionItemProvider = jest.mocked(languages.registerCompletionItemProvider); +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + +const mockedRegisterCompletionItemProvider = vi.mocked(languages.registerCompletionItemProvider); describe('autocomplete', () => { test('registerCspellInlineCompletionProviders', async () => { diff --git a/packages/client/src/client/Resolvable.test.ts b/packages/client/src/client/Resolvable.test.ts index fe91ead616..efcf2cf2d9 100644 --- a/packages/client/src/client/Resolvable.test.ts +++ b/packages/client/src/client/Resolvable.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { Resolvable } from './Resolvable'; describe('ResolvablePromise', () => { diff --git a/packages/client/src/client/server/serverSettings.test.ts b/packages/client/src/client/server/serverSettings.test.ts index e66bc61ef6..ed9c408a7f 100644 --- a/packages/client/src/client/server/serverSettings.test.ts +++ b/packages/client/src/client/server/serverSettings.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import type * as server from './server'; import * as serverSettings from './serverSettings'; diff --git a/packages/client/src/client/vscode-languageclient.test.ts b/packages/client/src/client/vscode-languageclient.test.ts index 261bf1e7cb..351ec1b9d5 100644 --- a/packages/client/src/client/vscode-languageclient.test.ts +++ b/packages/client/src/client/vscode-languageclient.test.ts @@ -1,5 +1,10 @@ +import { describe, expect, test, vi } from 'vitest'; + import * as client from './index'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('vscode-languageclient', () => { test('client', () => { expect(client).toBeDefined(); diff --git a/packages/client/src/commands.test.ts b/packages/client/src/commands.test.ts index f6c00c5982..d61449d734 100644 --- a/packages/client/src/commands.test.ts +++ b/packages/client/src/commands.test.ts @@ -1,4 +1,5 @@ import { readTextDocument } from 'jest-mock-vscode'; +import { describe, expect, test, vi } from 'vitest'; import * as vscode from 'vscode'; import { __testing__ } from './commands'; @@ -7,6 +8,9 @@ import { commandDisplayCSpellInfo } from './infoViewer'; import { mustBeDefined, readExtensionPackage } from './test/helpers'; import { registeredCommands as webviewCommands } from './webview'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const { commandHandlers } = __testing__; describe('Validate Commands', () => { diff --git a/packages/client/src/di.test.ts b/packages/client/src/di.test.ts index f6cf0bd2e2..a3b78e5d5c 100644 --- a/packages/client/src/di.test.ts +++ b/packages/client/src/di.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + import * as di from './di'; describe('Validate di', () => { diff --git a/packages/client/src/diags.test.ts b/packages/client/src/diags.test.ts index 2077c8000a..32ec0f25cb 100644 --- a/packages/client/src/diags.test.ts +++ b/packages/client/src/diags.test.ts @@ -1,4 +1,5 @@ import { createTextDocument } from 'jest-mock-vscode'; +import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; import * as vscode from 'vscode'; import { Diagnostic, DiagnosticSeverity, Position, Range, Uri } from 'vscode'; @@ -8,41 +9,43 @@ import { isDefined, mustBeDefined } from './util'; const { determineWordRangeToAddToDictionaryFromSelection, extractMatchingDiagTexts } = __testing__; -jest.mock('./di'); +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); +vi.mock('./di'); -const mockGetDependencies = jest.mocked(getDependencies); +const mockGetDependencies = vi.mocked(getDependencies); describe('Validate diags', () => { beforeEach(() => { mockGetDependencies.mockImplementation( () => ({ - issueTracker: { getDiagnostics: jest.fn(implGetDiagnostics) }, + issueTracker: { getDiagnostics: vi.fn(implGetDiagnostics) }, }) as any, ); }); afterEach(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); test('getCSpellDiags empty', () => { - const mockGetDependencies = jest.mocked(getDependencies); + const mockGetDependencies = vi.mocked(getDependencies); mockGetDependencies.mockImplementation( () => ({ - issueTracker: { getDiagnostics: jest.fn(() => []) }, + issueTracker: { getDiagnostics: vi.fn(() => []) }, }) as any, ); const uri = Uri.file(__filename); const r = getCSpellDiags(uri); expect(r).toEqual([]); - expect(jest.mocked(getDependencies)).toHaveBeenCalledTimes(1); + expect(vi.mocked(getDependencies)).toHaveBeenCalledTimes(1); }); test('getCSpellDiags', () => { const uri = Uri.file(__filename); const r = getCSpellDiags(uri); - expect(jest.mocked(getDependencies)).toHaveBeenCalledTimes(1); + expect(vi.mocked(getDependencies)).toHaveBeenCalledTimes(1); expect(r).toHaveLength(2); }); @@ -113,7 +116,7 @@ describe('Validate text extractors', () => { function implGetDiagnostics(): [Uri, Diagnostic[]][]; function implGetDiagnostics(uri: Uri): Diagnostic[]; function implGetDiagnostics(uri?: Uri): [Uri, Diagnostic[]][] | Diagnostic[] { - console.error('implGetDiagnostics %s', uri); + // console.error('implGetDiagnostics %s', uri); if (!uri) return sampleDiags(); return sampleDiags()[0][1]; } diff --git a/packages/client/src/extensionRegEx/evaluateRegExp.test.ts b/packages/client/src/extensionRegEx/evaluateRegExp.test.ts index 89f5888c4d..1db775731e 100644 --- a/packages/client/src/extensionRegEx/evaluateRegExp.test.ts +++ b/packages/client/src/extensionRegEx/evaluateRegExp.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { isRegExp, toRegExp } from './evaluateRegExp'; describe('EvaluateRegExp', () => { diff --git a/packages/client/src/infoViewer/infoHelper.test.ts b/packages/client/src/infoViewer/infoHelper.test.ts index f973a4b1dc..03ca7ce310 100644 --- a/packages/client/src/infoViewer/infoHelper.test.ts +++ b/packages/client/src/infoViewer/infoHelper.test.ts @@ -1,10 +1,15 @@ import type { CSpellSettings } from '@cspell/cspell-types'; import { importCSpellLib } from '@internal/cspell-helper'; import assert from 'assert'; +import { describe, expect, test, vi } from 'vitest'; +import {} from 'vscode'; import { isDefined } from '../util'; import { __testing__ } from './infoHelper'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const { applyEnableFiletypesToEnabledLanguageIds, calcEnableLang, extractDictionariesFromConfig, normalizeLocales, splitBangPrefix } = __testing__; @@ -92,6 +97,7 @@ async function sampleCSpellSettings() { const cspell = await importCSpellLib(); assert(isDefined(cspell)); const localCfg = await cspell.searchForConfig(__filename); - sampleSettings = cspell.mergeSettings(cspell.getDefaultSettings(), /*cspell.getGlobalSettings(),*/ ...[localCfg].filter(isDefined)); + const defaultSettings = await cspell.getDefaultSettings(); + sampleSettings = cspell.mergeSettings(defaultSettings, /*cspell.getGlobalSettings(),*/ ...[localCfg].filter(isDefined)); return sampleSettings; } diff --git a/packages/client/src/infoViewer/infoView.test.ts b/packages/client/src/infoViewer/infoView.test.ts index eb40b262bb..4890853c0c 100644 --- a/packages/client/src/infoViewer/infoView.test.ts +++ b/packages/client/src/infoViewer/infoView.test.ts @@ -1,5 +1,9 @@ +import { describe, expect, test, vi } from 'vitest'; import { Uri } from 'vscode'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + import {} from './infoView'; // const { execCommandUri } = __testing__; diff --git a/packages/client/src/settings/CSpellSettings.test.ts b/packages/client/src/settings/CSpellSettings.test.ts index ca84f78227..e0eacc8c22 100644 --- a/packages/client/src/settings/CSpellSettings.test.ts +++ b/packages/client/src/settings/CSpellSettings.test.ts @@ -1,3 +1,4 @@ +import { beforeAll, describe, expect, test, vi } from 'vitest'; import { Uri } from 'vscode'; import type { CSpellUserSettings } from '../client'; @@ -9,9 +10,11 @@ import { createDictionaryTargetForFile } from './DictionaryTarget'; import { vscodeFs } from './fs'; import { replaceDocText } from './replaceDocText'; -jest.mock('./replaceDocText'); +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); +vi.mock('./replaceDocText'); -const mock_replaceDocText = jest.mocked(replaceDocText); +const mock_replaceDocText = vi.mocked(replaceDocText); mock_replaceDocText.mockImplementation(async (doc, text) => { await vscodeFs.writeFile(doc.uri, text); diff --git a/packages/client/src/settings/DictionaryHelper.test.ts b/packages/client/src/settings/DictionaryHelper.test.ts index 0d27dbad50..5588fd4133 100644 --- a/packages/client/src/settings/DictionaryHelper.test.ts +++ b/packages/client/src/settings/DictionaryHelper.test.ts @@ -1,5 +1,6 @@ // import { homedir } from 'os'; +import { beforeEach, describe, expect, test, vi } from 'vitest'; import type { ExtensionContext, WorkspaceFolder } from 'vscode'; import { ConfigurationTarget, Uri, workspace } from 'vscode'; import { Utils as UriUtils } from 'vscode-uri'; @@ -14,6 +15,9 @@ import { __testing__, DictionaryHelper } from './DictionaryHelper'; import { createDictionaryTargetForConfigRep } from './DictionaryTarget'; import { MemoryConfigFileReaderWriter, MemoryConfigVSReaderWriter } from './test/memoryReaderWriter'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const { addCustomDictionaryToConfig, calcDictInfoForConfigRep, @@ -22,11 +26,11 @@ const { isTextDocument, } = __testing__; -jest.mock('../client/client', () => { +vi.mock('../client/client', () => { return { - CSpellClient: jest.fn().mockImplementation(() => { + CSpellClient: vi.fn().mockImplementation(() => { return { - getConfigurationForDocument: jest.fn(), + getConfigurationForDocument: vi.fn(), notifySettingsChanged: () => Promise.resolve(), }; }), @@ -162,7 +166,7 @@ describe('Validate DictionaryHelper methods', () => { test('calcDictInfoForConfigRep vscode workspace', () => { const info = mockWorkspace(['packages/pkg-a', 'packages/pkg-b', 'packages/pkg-c']); const scope = info.workspaceFolders[0]; - jest.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); + vi.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); const rw = new MemoryConfigVSReaderWriter(ConfigurationTarget.Workspace, undefined, {}); const rep = createVSCodeConfigRepository(rw); expect(calcDictInfoForConfigRep(rep)).toEqual({ @@ -176,7 +180,7 @@ describe('Validate DictionaryHelper methods', () => { test('calcDictInfoForConfigRep vscode folder', () => { const info = mockWorkspace(['packages/pkg-a', 'packages/pkg-b', 'packages/pkg-c']); const scope = info.workspaceFolders[1]; - jest.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); + vi.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); const rw = new MemoryConfigVSReaderWriter(ConfigurationTarget.WorkspaceFolder, scope, {}); const rep = createVSCodeConfigRepository(rw); const folderName = 'pkg-b'; @@ -192,7 +196,7 @@ describe('Validate DictionaryHelper methods', () => { test('calcDictInfoForConfigRep vscode folder uri', () => { const info = mockWorkspace(['packages/pkg-a', 'packages/pkg-b', 'packages/pkg-c']); const scope = info.workspaceFolders[2]; - jest.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); + vi.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); const uri = Uri.joinPath(scope.uri, 'package.json'); const rw = new MemoryConfigVSReaderWriter(ConfigurationTarget.WorkspaceFolder, uri, {}); const rep = createVSCodeConfigRepository(rw); @@ -209,7 +213,7 @@ describe('Validate DictionaryHelper methods', () => { test('calcDictInfoForConfigRep vscode user', () => { const info = mockWorkspace(['packages/pkg-a', 'packages/pkg-b', 'packages/pkg-c']); const scope = info.workspaceFolders[0]; - jest.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); + vi.mocked(workspace.getWorkspaceFolder).mockReturnValue(scope); const rw = new MemoryConfigVSReaderWriter(ConfigurationTarget.Global, scope, {}); const rep = createVSCodeConfigRepository(rw); expect(calcDictInfoForConfigRep(rep)).toEqual({ @@ -297,8 +301,8 @@ function ocUri(uri: Uri): Uri { function mockWorkspace(workspaceFolders: string[]) { const workspaceFolderUris = workspaceFolders.map((s) => getPathToTemp(s)); const info = workspaceInfo(workspaceFolderUris); - jest.spyOn(workspace, 'workspaceFile', 'get').mockReturnValue(info.workspaceFile); - jest.spyOn(workspace, 'workspaceFolders', 'get').mockReturnValue(info.workspaceFolders); + vi.spyOn(workspace, 'workspaceFile', 'get').mockReturnValue(info.workspaceFile); + vi.spyOn(workspace, 'workspaceFolders', 'get').mockReturnValue(info.workspaceFolders); return info; } diff --git a/packages/client/src/settings/DictionaryTarget.test.ts b/packages/client/src/settings/DictionaryTarget.test.ts index 9f9048d939..a9c08f8618 100644 --- a/packages/client/src/settings/DictionaryTarget.test.ts +++ b/packages/client/src/settings/DictionaryTarget.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test, vi } from 'vitest'; +import {} from 'vscode'; import type { URI as Uri } from 'vscode-uri'; import { Utils as UriUtils } from 'vscode-uri'; @@ -11,9 +13,11 @@ import { vscodeFs } from './fs'; import { replaceDocText } from './replaceDocText'; import { createConfigFile } from './settings'; -jest.mock('./replaceDocText'); +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); +vi.mock('./replaceDocText'); -const mock_replaceDocText = jest.mocked(replaceDocText); +const mock_replaceDocText = vi.mocked(replaceDocText); mock_replaceDocText.mockImplementation(async (doc, text) => { await vscodeFs.writeFile(doc.uri, text); diff --git a/packages/client/src/settings/DictionaryTargetHelper.test.ts b/packages/client/src/settings/DictionaryTargetHelper.test.ts index 7cec1f10be..14f6d95dce 100644 --- a/packages/client/src/settings/DictionaryTargetHelper.test.ts +++ b/packages/client/src/settings/DictionaryTargetHelper.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, vi } from 'vitest'; import { URI as Uri, Utils as UriUtils } from 'vscode-uri'; import type { ConfigTargetCSpell, ConfigTargetDictionary, ConfigTargetVSCode } from '../client'; @@ -5,6 +6,9 @@ import type { ClientConfigTarget } from './clientConfigTarget'; import type { DictionaryTarget } from './DictionaryTarget'; import { configTargetToDictionaryTarget } from './DictionaryTargetHelper'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const fileUri = Uri.file(__filename); const dirUri = Uri.file(__dirname); diff --git a/packages/client/src/settings/__snapshots__/configFileReadWrite.test.ts.snap b/packages/client/src/settings/__snapshots__/configFileReadWrite.test.ts.snap index dfa459ac44..142e0bd7cd 100644 --- a/packages/client/src/settings/__snapshots__/configFileReadWrite.test.ts.snap +++ b/packages/client/src/settings/__snapshots__/configFileReadWrite.test.ts.snap @@ -1,7 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Validate configFileReadWrite update cspell.config.yaml 1`] = ` -"version: "0.2" +exports[`Validate configFileReadWrite > update 'cspell.config.yaml' 1`] = ` +"version: \\"0.2\\" ignorePaths: [] dictionaryDefinitions: [] dictionaries: [] @@ -14,117 +14,117 @@ import: [] " `; -exports[`Validate configFileReadWrite update cspell.json 1`] = ` +exports[`Validate configFileReadWrite > update 'cspell.json' 1`] = ` "{ - "version": "0.2", - "ignorePaths": [], - "dictionaryDefinitions": [], - "dictionaries": [], - "words": [ - "sample", - "one", - "two" + \\"version\\": \\"0.2\\", + \\"ignorePaths\\": [], + \\"dictionaryDefinitions\\": [], + \\"dictionaries\\": [], + \\"words\\": [ + \\"sample\\", + \\"one\\", + \\"two\\" ], - "ignoreWords": [], - "import": [] + \\"ignoreWords\\": [], + \\"import\\": [] } " `; -exports[`Validate configFileReadWrite update cspell.jsonc 1`] = ` +exports[`Validate configFileReadWrite > update 'cspell.jsonc' 1`] = ` "{ - "version": "0.2", - "ignorePaths": [], - "dictionaryDefinitions": [], - "dictionaries": [], - "words": [ - "sample", - "one", - "two" + \\"version\\": \\"0.2\\", + \\"ignorePaths\\": [], + \\"dictionaryDefinitions\\": [], + \\"dictionaries\\": [], + \\"words\\": [ + \\"sample\\", + \\"one\\", + \\"two\\" ], - "ignoreWords": [], - "import": [] + \\"ignoreWords\\": [], + \\"import\\": [] } " `; -exports[`Validate configFileReadWrite update package.json 1`] = ` +exports[`Validate configFileReadWrite > update 'package.json' 1`] = ` "{ - "name": "sample-package", - "scripts": {}, - "dependencies": {}, - "cspell": { - "version": "0.2", - "ignorePaths": [], - "dictionaryDefinitions": [], - "dictionaries": [], - "words": [ - "sample", - "one", - "two" + \\"name\\": \\"sample-package\\", + \\"scripts\\": {}, + \\"dependencies\\": {}, + \\"cspell\\": { + \\"version\\": \\"0.2\\", + \\"ignorePaths\\": [], + \\"dictionaryDefinitions\\": [], + \\"dictionaries\\": [], + \\"words\\": [ + \\"sample\\", + \\"one\\", + \\"two\\" ], - "ignoreWords": [], - "import": [] + \\"ignoreWords\\": [], + \\"import\\": [] } } " `; -exports[`Validate configFileReadWrite write cspell.config.json 1`] = ` +exports[`Validate configFileReadWrite > write 'cspell.config.json' 1`] = ` "// This is a Json file with comments. { // Version should be 0.2 - "version": "0.2", + \\"version\\": \\"0.2\\", // Custom terms should be here. - "words": [], + \\"words\\": [], // Words to be ignored - "ignoreWords": [] + \\"ignoreWords\\": [] } " `; -exports[`Validate configFileReadWrite write cspell.config.yaml 1`] = ` -"version: "0.2" +exports[`Validate configFileReadWrite > write 'cspell.config.yaml' 1`] = ` +"version: \\"0.2\\" words: [] ignoreWords: [] " `; -exports[`Validate configFileReadWrite write cspell.json 1`] = ` +exports[`Validate configFileReadWrite > write 'cspell.json' 1`] = ` "// This is a Json file with comments. { // Version should be 0.2 - "version": "0.2", + \\"version\\": \\"0.2\\", // Custom terms should be here. - "words": [], + \\"words\\": [], // Words to be ignored - "ignoreWords": [] + \\"ignoreWords\\": [] } " `; -exports[`Validate configFileReadWrite write cspell.jsonc 1`] = ` +exports[`Validate configFileReadWrite > write 'cspell.jsonc' 1`] = ` "// This is a Json file with comments. { // Version should be 0.2 - "version": "0.2", + \\"version\\": \\"0.2\\", // Custom terms should be here. - "words": [], + \\"words\\": [], // Words to be ignored - "ignoreWords": [] + \\"ignoreWords\\": [] } " `; -exports[`Validate configFileReadWrite write package.json 1`] = ` +exports[`Validate configFileReadWrite > write 'package.json' 1`] = ` "{ - "name": "sample-package", - "scripts": {}, - "dependencies": {}, - "cspell": { - "version": "0.2", - "words": [], - "ignoreWords": [] + \\"name\\": \\"sample-package\\", + \\"scripts\\": {}, + \\"dependencies\\": {}, + \\"cspell\\": { + \\"version\\": \\"0.2\\", + \\"words\\": [], + \\"ignoreWords\\": [] } } " diff --git a/packages/client/src/settings/clientConfigTarget.test.ts b/packages/client/src/settings/clientConfigTarget.test.ts index 897deca586..32d2c185c8 100644 --- a/packages/client/src/settings/clientConfigTarget.test.ts +++ b/packages/client/src/settings/clientConfigTarget.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, vi } from 'vitest'; import { Uri } from 'vscode'; import type { ClientConfigTargetCSpell, ClientConfigTargetDictionary, ClientConfigTargetVSCode } from './clientConfigTarget'; @@ -8,6 +9,9 @@ import { isClientConfigTargetVSCode, } from './clientConfigTarget'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('clientConfigTarget', () => { const tCSpell: ClientConfigTargetCSpell = { name: 'cspell.json', diff --git a/packages/client/src/settings/configFields.test.ts b/packages/client/src/settings/configFields.test.ts index 6294d7fb0c..c817be0e87 100644 --- a/packages/client/src/settings/configFields.test.ts +++ b/packages/client/src/settings/configFields.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { ConfigFields } from './configFields'; describe('Validate configFields', () => { diff --git a/packages/client/src/settings/configFileReadWrite.test.ts b/packages/client/src/settings/configFileReadWrite.test.ts index 7ee8b64301..92c6e6deb0 100644 --- a/packages/client/src/settings/configFileReadWrite.test.ts +++ b/packages/client/src/settings/configFileReadWrite.test.ts @@ -1,9 +1,13 @@ import { assign, parse as parseJsonc, stringify as stringifyJsonc } from 'comment-json'; +import { describe, expect, test, vi } from 'vitest'; import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'; import { fsRemove, getPathToTemp, readFile, writeFile } from '../test/helpers'; import { __testing__, readConfigFile, updateConfigFile, writeConfigFile } from './configFileReadWrite'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const samplePackageJson = { name: 'sample-package', scripts: {}, diff --git a/packages/client/src/settings/configRepository.test.ts b/packages/client/src/settings/configRepository.test.mts similarity index 87% rename from packages/client/src/settings/configRepository.test.ts rename to packages/client/src/settings/configRepository.test.mts index 7ecfd93181..ebad3df31e 100644 --- a/packages/client/src/settings/configRepository.test.ts +++ b/packages/client/src/settings/configRepository.test.mts @@ -1,11 +1,16 @@ -import { when } from 'jest-when'; +import { createMockWorkspaceConfiguration } from 'jest-mock-vscode'; +import { afterEach, describe, expect, test, vi } from 'vitest'; +import { when } from 'vitest-when'; import type { WorkspaceFolder } from 'vscode'; import { ConfigurationTarget, Uri, workspace } from 'vscode'; -import { getPathToTemp } from '../test/helpers'; -import { __testing__, createCSpellConfigRepository, createVSCodeConfigRepository } from './configRepository'; -import { addWordsFn } from './configUpdaters'; -import { MemoryConfigFileReaderWriter, MemoryConfigVSReaderWriter } from './test/memoryReaderWriter'; +import { getPathToTemp } from '../test/helpers.js'; +import { __testing__, createCSpellConfigRepository, createVSCodeConfigRepository } from './configRepository.js'; +import { addWordsFn } from './configUpdaters.js'; +import { MemoryConfigFileReaderWriter, MemoryConfigVSReaderWriter } from './test/memoryReaderWriter.js'; + +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); const { isUri, hasUri, isWorkspaceFolder } = __testing__; @@ -22,9 +27,13 @@ const workspaceFolderWorkspace: WorkspaceFolder = { name: 'Workspace', index: 0, }; -const mockedWorkspace = jest.mocked(workspace); +const mockedWorkspace = vi.mocked(workspace); describe('configRepository', () => { + afterEach(() => { + vi.resetAllMocks(); + }); + test('CSpellConfigRepository', async () => { const uri = getPathToTemp('cspell.json'); const rep = createCSpellConfigRepository(uri); @@ -41,6 +50,9 @@ describe('configRepository', () => { test('CSpellConfigRepository Memory', async () => { const uri = getPathToTemp('cspell.json'); const rw = new MemoryConfigFileReaderWriter(uri, {}); + const __mockConfig = createMockWorkspaceConfiguration(vi); + const mockedGetConfig = vi.mocked(workspace.getConfiguration); + mockedGetConfig.mockImplementation(__mockConfig.__getConfiguration.bind(__mockConfig)); const rep = createCSpellConfigRepository(rw); await rep.setValue('words', ['one', 'two', 'three']); @@ -103,8 +115,8 @@ describe('configRepository', () => { const rw = new MemoryConfigVSReaderWriter(target, scope, {}); const rep = createVSCodeConfigRepository(rw); - when(mockedWorkspace.getWorkspaceFolder).calledWith(expect.objectContaining(uri)).mockReturnValue(workspaceFolder); - const spy = jest.spyOn(workspace, 'workspaceFolders', 'get'); + when(mockedWorkspace.getWorkspaceFolder).calledWith(expect.objectContaining(uri)).thenReturn(workspaceFolder); + const spy = vi.spyOn(workspace, 'workspaceFolders', 'get'); spy.mockReturnValue([workspaceFolderWorkspace, workspaceFolder]); expect(rep.getWorkspaceFolder()).toEqual(expected); diff --git a/packages/client/src/settings/configRepositoryHelper.test.ts b/packages/client/src/settings/configRepositoryHelper.test.ts index d3f7b9a411..4dc2c9ec83 100644 --- a/packages/client/src/settings/configRepositoryHelper.test.ts +++ b/packages/client/src/settings/configRepositoryHelper.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, vi } from 'vitest'; import { URI as Uri, Utils as UriUtils } from 'vscode-uri'; import type { @@ -9,6 +10,9 @@ import type { import type { ConfigRepository } from './configRepository'; import { configTargetToConfigRepo } from './configRepositoryHelper'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const fileUri = Uri.file(__filename); const dirUri = Uri.file(__dirname); diff --git a/packages/client/src/settings/configTargetHelper.test.ts b/packages/client/src/settings/configTargetHelper.test.ts index 9ba5b658cc..fbb2a03fdd 100644 --- a/packages/client/src/settings/configTargetHelper.test.ts +++ b/packages/client/src/settings/configTargetHelper.test.ts @@ -1,3 +1,4 @@ +import { beforeEach, describe, expect, test, vi } from 'vitest'; import type { CancellationToken, QuickPickItem, QuickPickOptions } from 'vscode'; import { ConfigurationTarget, Uri, window } from 'vscode'; @@ -29,10 +30,13 @@ import { quickPickBestMatchTarget, } from './configTargetHelper'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const dirUri = Uri.file(__dirname); const fileUri = Uri.file(__filename); -const mockedShowQuickPick = jest.mocked(window.showQuickPick); +const mockedShowQuickPick = vi.mocked(window.showQuickPick); type MockedShowQuickPick = typeof mockedShowQuickPick; const ctDictA = createClientConfigTargetDictionary(Uri.joinPath(dirUri, 'a/words1.txt'), 'unknown'); @@ -165,7 +169,8 @@ describe('configTargetHelper', () => { function setQuickPickSelection(mock: MockedShowQuickPick, selected: undefined | number | number[]) { const qp = new QuickPickImpl(selected); - mock.mockImplementation((...p) => qp.showQuickPick(...p)); + const impl = qp.showQuickPick.bind(qp); + mock.mockImplementation(impl); } class QuickPickImpl { @@ -183,22 +188,22 @@ class QuickPickImpl { items: readonly string[] | Thenable, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken, - ): Thenable; + ): Promise; showQuickPick( items: readonly string[] | Thenable, options?: QuickPickOptions, token?: CancellationToken, - ): Thenable; + ): Promise; showQuickPick( items: readonly T[] | Thenable, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken, - ): Thenable; + ): Promise; showQuickPick( items: readonly T[] | Thenable, options?: QuickPickOptions, token?: CancellationToken, - ): Thenable; + ): Promise; async showQuickPick( items: readonly T[] | Thenable, options?: QuickPickOptions, diff --git a/packages/client/src/settings/configUpdater.test.ts b/packages/client/src/settings/configUpdater.test.ts index b33bea9fa9..70d230d6b8 100644 --- a/packages/client/src/settings/configUpdater.test.ts +++ b/packages/client/src/settings/configUpdater.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import type { CSpellUserSettings } from '../client'; import type { ConfigKeys, UpdateConfigFieldFn } from './configUpdater'; import { configUpdaterForKey } from './configUpdater'; diff --git a/packages/client/src/settings/configUpdaters.test.ts b/packages/client/src/settings/configUpdaters.test.ts index 8db58a24aa..6fefb679c1 100644 --- a/packages/client/src/settings/configUpdaters.test.ts +++ b/packages/client/src/settings/configUpdaters.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { addWordsFn, removeWordsFn } from './configUpdaters'; describe('Validate configUpdaters', () => { diff --git a/packages/client/src/settings/fs.test.ts b/packages/client/src/settings/fs.test.ts index 9fa926ac03..008e52b9c2 100644 --- a/packages/client/src/settings/fs.test.ts +++ b/packages/client/src/settings/fs.test.ts @@ -1,9 +1,13 @@ +import { describe, expect, test, vi } from 'vitest'; import { FileSystemError, Uri } from 'vscode'; import { URI, Utils as UriUtils } from 'vscode-uri'; import { fsRemove, getPathToTemp } from '../test/helpers'; import { vscodeFs } from './fs'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const sc = expect.stringContaining; const uriPackageRoot = Uri.joinPath(Uri.file(__dirname), '../..'); diff --git a/packages/client/src/settings/index.test.ts b/packages/client/src/settings/index.test.ts index f9a9af3d17..dede3705a7 100644 --- a/packages/client/src/settings/index.test.ts +++ b/packages/client/src/settings/index.test.ts @@ -1,5 +1,10 @@ +import { describe, expect, test, vi } from 'vitest'; + import * as index from './index'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('settings/index', () => { test('index', () => { expect(typeof index.enableLocaleForTarget).toBe('function'); diff --git a/packages/client/src/settings/languageIds.test.ts b/packages/client/src/settings/languageIds.test.ts index b9e65009c1..725401ca0a 100644 --- a/packages/client/src/settings/languageIds.test.ts +++ b/packages/client/src/settings/languageIds.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { readDefaults } from '../test/schema'; import { languageIds } from './languageIds'; diff --git a/packages/client/src/settings/mappers/configTarget.test.ts b/packages/client/src/settings/mappers/configTarget.test.ts index 1da6e7fcf1..4c014f895d 100644 --- a/packages/client/src/settings/mappers/configTarget.test.ts +++ b/packages/client/src/settings/mappers/configTarget.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, vi } from 'vitest'; import { Uri } from 'vscode'; import type { ConfigKind, ConfigScope, ConfigTarget, ConfigTargetCSpell, ConfigTargetDictionary, ConfigTargetVSCode } from '../../client'; @@ -5,6 +6,9 @@ import { oc } from '../../test/helpers'; import type { ClientConfigTargetCSpell, ClientConfigTargetDictionary, ClientConfigTargetVSCode } from '../clientConfigTarget'; import { mapConfigTargetToClientConfigTarget } from './configTarget'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const cspellUri = Uri.joinPath(Uri.file(__dirname), 'cspell.json'); const dictUri = Uri.joinPath(Uri.file(__dirname), 'words.txt'); const docUri = Uri.file(__filename); diff --git a/packages/client/src/settings/mappers/configTargetLegacy.test.ts b/packages/client/src/settings/mappers/configTargetLegacy.test.ts index aa32e5102d..9c0d980fd9 100644 --- a/packages/client/src/settings/mappers/configTargetLegacy.test.ts +++ b/packages/client/src/settings/mappers/configTargetLegacy.test.ts @@ -1,5 +1,9 @@ +import { describe, expect, test, vi } from 'vitest'; import { ConfigurationTarget } from 'vscode'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + import { mapConfigTargetLegacyToClientConfigTarget } from './configTargetLegacy'; describe('configTargetLegacy', () => { diff --git a/packages/client/src/settings/settings.enable.test.ts b/packages/client/src/settings/settings.enable.test.ts index 363c788db0..7b82d526ec 100644 --- a/packages/client/src/settings/settings.enable.test.ts +++ b/packages/client/src/settings/settings.enable.test.ts @@ -1,5 +1,10 @@ +import { describe, expect, test, vi } from 'vitest'; + import { setEnableSpellChecking, toggleEnableSpellChecker } from './settings.enable'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('settings.enable', () => { test('toggleEnableSpellChecker empty', async () => { await expect(toggleEnableSpellChecker({ targets: [], scopes: [] })).resolves.toBe(undefined); diff --git a/packages/client/src/settings/settings.locale.test.ts b/packages/client/src/settings/settings.locale.test.ts index 2f8af9a6fa..a2dfcc4696 100644 --- a/packages/client/src/settings/settings.locale.test.ts +++ b/packages/client/src/settings/settings.locale.test.ts @@ -1,5 +1,10 @@ +import { describe, expect, test, vi } from 'vitest'; + import { __testing__ } from './settings.locale'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const { addLocaleToCurrentLocale, removeLocaleFromCurrentLocale, doLocalesIntersect, isLocaleSubsetOf } = __testing__; describe('Validate settings.ts', () => { diff --git a/packages/client/src/settings/settings.test.ts b/packages/client/src/settings/settings.test.ts index 63b097a5a5..c5a79abc92 100644 --- a/packages/client/src/settings/settings.test.ts +++ b/packages/client/src/settings/settings.test.ts @@ -1,3 +1,8 @@ +import { describe, expect, test, vi } from 'vitest'; + +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + import { hasWorkspaceLocation } from './settings'; describe('Validate settings.ts', () => { diff --git a/packages/client/src/settings/targetAndScope.test.ts b/packages/client/src/settings/targetAndScope.test.ts index e86f2e764d..b7e2102736 100644 --- a/packages/client/src/settings/targetAndScope.test.ts +++ b/packages/client/src/settings/targetAndScope.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, vi } from 'vitest'; import { ConfigurationTarget } from 'vscode'; import { @@ -6,6 +7,9 @@ import { dictionaryScopeToConfigurationTarget, } from './targetAndScope'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('targetAndScope', () => { test.each` scope | configTarget diff --git a/packages/client/src/settings/vsConfig.test.ts b/packages/client/src/settings/vsConfig.test.ts index ee1786ffe5..4896903cc1 100644 --- a/packages/client/src/settings/vsConfig.test.ts +++ b/packages/client/src/settings/vsConfig.test.ts @@ -1,6 +1,7 @@ import type { MockWorkspaceConfigurationData } from 'jest-mock-vscode'; import { createMockWorkspaceConfiguration, readTextDocument } from 'jest-mock-vscode'; import rfdc from 'rfdc'; +import { beforeEach, describe, expect, test, vi } from 'vitest'; import type { ConfigurationScope, WorkspaceConfiguration } from 'vscode'; import { Uri, workspace } from 'vscode'; @@ -23,12 +24,15 @@ import { toScope, } from './vsConfig'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + const clone = rfdc(); const { mergeInspect } = __testing__; const uri = Uri.file(__filename); -const mockedWorkspace = jest.mocked(workspace); +const mockedWorkspace = vi.mocked(workspace); const baseConfig: MockWorkspaceConfigurationData<{ cSpell: CSpellUserSettings }> = { '[*]': { @@ -213,6 +217,6 @@ async function applySampleConfig(config: WorkspaceConfiguration) { } function sampleConfig(key?: string, scope?: ConfigurationScope | null) { - const config = createMockWorkspaceConfiguration(jest, clone(baseConfig), key, scope); + const config = createMockWorkspaceConfiguration(vi, clone(baseConfig), key, scope); return config; } diff --git a/packages/client/src/settings/vsConfigReaderWriter.test.ts b/packages/client/src/settings/vsConfigReaderWriter.test.ts index ee93e13281..dbb7f9158a 100644 --- a/packages/client/src/settings/vsConfigReaderWriter.test.ts +++ b/packages/client/src/settings/vsConfigReaderWriter.test.ts @@ -1,13 +1,16 @@ import type { CSpellUserSettings } from '@cspell/cspell-types'; +import { describe, expect, test, vi } from 'vitest'; import { ConfigurationTarget, Uri } from 'vscode'; import { calculateConfigForTarget, updateConfig } from './vsConfig'; import { createVSConfigReaderWriter } from './vsConfigReaderWriter'; -jest.mock('./vsConfig'); +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); +vi.mock('./vsConfig'); -const mockedUpdateConfig = jest.mocked(updateConfig); -const mockedCalculateConfigForTarget = jest.mocked(calculateConfigForTarget); +const mockedUpdateConfig = vi.mocked(updateConfig); +const mockedCalculateConfigForTarget = vi.mocked(calculateConfigForTarget); describe('vsConfigReaderWriter', () => { test('createVSConfigReaderWriter', () => { diff --git a/packages/client/src/test/helpers.test.ts b/packages/client/src/test/helpers.test.ts index c260510c52..e02157bebd 100644 --- a/packages/client/src/test/helpers.test.ts +++ b/packages/client/src/test/helpers.test.ts @@ -1,8 +1,12 @@ import * as path from 'path'; +import { describe, expect, test, vi } from 'vitest'; import type { StackItem } from './helpers'; import { getCallStack, getPathToTemp, mustBeDefined, parseStackTrace } from './helpers'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('Validate Helpers', () => { test('getCallStack', () => { const stack = getCallStack(); diff --git a/packages/client/src/test/helpers.ts b/packages/client/src/test/helpers.ts index 9ee01853c7..0b300f4a2c 100644 --- a/packages/client/src/test/helpers.ts +++ b/packages/client/src/test/helpers.ts @@ -1,6 +1,7 @@ import { mustBeDefined } from '@internal/common-utils/util'; import * as fs from 'fs/promises'; import * as path from 'path'; +import { expect } from 'vitest'; import { Uri } from 'vscode'; import { isDefined } from '../util'; diff --git a/packages/client/src/util/broadcaster.test.ts b/packages/client/src/util/broadcaster.test.ts index 8415181b6a..6cbb86f731 100644 --- a/packages/client/src/util/broadcaster.test.ts +++ b/packages/client/src/util/broadcaster.test.ts @@ -1,14 +1,20 @@ +import { describe, expect, test, vi } from 'vitest'; +import {} from 'vscode'; + import { createBroadcaster } from './broadcaster'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('Validate broadcaster', () => { test('broadcast', () => { const bc = createBroadcaster(); bc.send('one'); - const f1 = jest.fn(); + const f1 = vi.fn(); const d1 = bc.listen(f1); bc.send('two'); expect(f1).toHaveBeenLastCalledWith('two'); - const f2 = jest.fn(); + const f2 = vi.fn(); const d2 = bc.listen(f2); bc.send('three'); expect(f1).toHaveBeenLastCalledWith('three'); diff --git a/packages/client/src/util/commonPrefix.test.ts b/packages/client/src/util/commonPrefix.test.ts index 49c8cd9a17..541d4cad31 100644 --- a/packages/client/src/util/commonPrefix.test.ts +++ b/packages/client/src/util/commonPrefix.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { commonPrefix } from './commonPrefix'; describe('validate commonPrefix', () => { diff --git a/packages/client/src/util/errors.test.ts b/packages/client/src/util/errors.test.ts index e5f9f396e6..1e6e0a4325 100644 --- a/packages/client/src/util/errors.test.ts +++ b/packages/client/src/util/errors.test.ts @@ -1,11 +1,14 @@ +import { beforeEach, describe, expect, test, vi } from 'vitest'; import { window } from 'vscode'; import { catchErrors, ErrorHandlers, handleErrors, isError, logErrors, Resolvers } from './errors'; -const debug = jest.spyOn(console, 'debug').mockImplementation(() => undefined); -const log = jest.spyOn(console, 'log').mockImplementation(() => undefined); -const error = jest.spyOn(console, 'error').mockImplementation(() => undefined); -const showErrorMessage = jest.spyOn(window, 'showErrorMessage').mockImplementation(() => Promise.resolve(undefined)); +vi.mock('vscode'); + +const debug = vi.spyOn(console, 'debug').mockImplementation(() => undefined); +const log = vi.spyOn(console, 'log').mockImplementation(() => undefined); +const error = vi.spyOn(console, 'error').mockImplementation(() => undefined); +const showErrorMessage = vi.spyOn(window, 'showErrorMessage').mockImplementation(() => Promise.resolve(undefined)); describe('Validate errors', () => { beforeEach(() => { diff --git a/packages/client/src/util/perf.test.ts b/packages/client/src/util/perf.test.ts index 810832ad8e..fd276aaf82 100644 --- a/packages/client/src/util/perf.test.ts +++ b/packages/client/src/util/perf.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { EVENT_TIMELINE_START, PerformanceTimeline } from './perf'; describe('Validate perf', () => { diff --git a/packages/client/src/util/pipe.test.ts b/packages/client/src/util/pipe.test.ts index 9108a76963..3cd5aa232a 100644 --- a/packages/client/src/util/pipe.test.ts +++ b/packages/client/src/util/pipe.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { defaultTo, extract, map, pipe } from './pipe'; interface Address { diff --git a/packages/client/src/vscode/findDocument.test.ts b/packages/client/src/vscode/findDocument.test.ts index 99fd5edced..149b5443ac 100644 --- a/packages/client/src/vscode/findDocument.test.ts +++ b/packages/client/src/vscode/findDocument.test.ts @@ -1,5 +1,10 @@ +import { describe, expect, test, vi } from 'vitest'; + import { findMatchingDocument } from './findDocument'; +vi.mock('vscode'); +vi.mock('vscode-languageclient/node'); + describe('findDocument', () => { test('findMatchingDocument', () => { expect(findMatchingDocument).toBeDefined(); diff --git a/packages/client/src/vscode/packageJson.test.ts b/packages/client/src/vscode/packageJson.test.ts index 4669a91101..b21745318b 100644 --- a/packages/client/src/vscode/packageJson.test.ts +++ b/packages/client/src/vscode/packageJson.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import type * as pkg from './packageJson'; describe('Validate Package Types', () => { diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 7130985988..f69ceffbc8 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "dist", "rootDir": "src", + "types": ["node"], "target": "ESNext", "module": "Node16", "moduleResolution": "Node16" diff --git a/packages/utils-disposables/src/disposable.ts b/packages/utils-disposables/src/disposable.ts index b9a160f33f..739008f9b1 100644 --- a/packages/utils-disposables/src/disposable.ts +++ b/packages/utils-disposables/src/disposable.ts @@ -190,7 +190,7 @@ export function createDisposeMethodFromList(disposables: DisposableLike[], name } if (error) { - _logger && console.error(error); + _logger?.warn(error); throw error; } } finally { diff --git a/packages/utils-disposables/tsconfig.json b/packages/utils-disposables/tsconfig.json index 777bf16a0c..4a1f1df0c0 100644 --- a/packages/utils-disposables/tsconfig.json +++ b/packages/utils-disposables/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "./dist/esm", "target": "es2022", - "lib": ["es2022", "esnext.disposable", "dom"], + "lib": ["es2023", "esnext.disposable", "dom"], "module": "NodeNext", "moduleResolution": "NodeNext", "esModuleInterop": true, diff --git a/vitest.config.mts b/vitest.config.mts index 78315d8222..20afac24bd 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -2,6 +2,16 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { + // cspell:ignore tsup + exclude: [ + '**/node_modules/**', + '**/dist/**', + '**/cypress/**', + '**/coverage/**', + '**/temp/**', + '**/.{idea,git,cache,output,temp}/**', + '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', + ], // reporters: 'verbose', coverage: { // enabled: true,