Skip to content

Commit 2284692

Browse files
authored
chore: replace mocha with vitest for 'task unit' (#2347)
1 parent 25c479b commit 2284692

File tree

14 files changed

+48
-116
lines changed

14 files changed

+48
-116
lines changed

.depcheckrc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# https://github.com/yarnpkg/yarn/issues/3368
22
ignores:
3-
- "@ansible/ansible-mcp-server"
43
- "@ansible/ansible-language-server"
5-
- "@types/vscode-webview" # provides VSCodeAPI
4+
- "@ansible/ansible-mcp-server"
65
- "@types/vscode" # determined by (package.json).engines.vscode
6+
- "@types/vscode-webview" # provides VSCodeAPI
7+
- "@vitest/coverage-v8"
78
- "@vscode/test-electron" # used by @vscode/test-cli
89
- "@vscode/vsce"
910
- cypress-multi-reporters

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ CHANGELOG.html
1818
!.yarn/sdks
1919
!.yarn/versions
2020
.DS_Store
21-
coverage
2221
.nyc_output
2322
.idea
2423
*.pyc

.mocharc.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ tasks:
215215
generates:
216216
- out/coverage/unit/lcov.info
217217
cmds:
218-
- c8 --config test/unit/.c8rc.json mocha {{ .MOCHA_OPTS }}
218+
- vitest run
219219
interactive: true
220220
package:
221221
desc: Package extension
@@ -272,4 +272,4 @@ tasks:
272272
deps:
273273
- package
274274
cmds:
275-
- mocha --dry-run
275+
- vitest list

eslint.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import globals from "globals";
1010
import path from "path";
1111
import { fileURLToPath } from "url";
1212
import html from "@html-eslint/eslint-plugin";
13-
import mochaPlugin from "eslint-plugin-mocha";
1413
import { defineConfig } from "eslint/config";
1514

1615
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
@@ -68,10 +67,8 @@ export default defineConfig(
6867
// loaded implicitly, will trigger 'Cannot redefine plugin' if enabled:
6968
// "@typescript-eslint": ts,
7069
tsdoc: tsdocPlugin,
71-
mocha: mochaPlugin,
7270
},
7371
rules: {
74-
"mocha/max-top-level-suites": ["warn", { limit: 1 }],
7572
eqeqeq: ["error", "smart"],
7673
// Needed for tseslint.configs.strictTypeChecked
7774
"@typescript-eslint/no-namespace": "error",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@
10321032
"@types/vscode-webview": "^1.57.5",
10331033
"@types/yargs": "^17.0.35",
10341034
"@typescript-eslint/parser": "^8.48.0",
1035+
"@vitest/coverage-v8": "^4.0.14",
1036+
"@vitest/ui": "^4.0.4",
10351037
"@vscode/test-cli": "^0.0.12",
10361038
"@vscode/test-electron": "^2.5.2",
10371039
"@vscode/vsce": "^3.7.1",
@@ -1043,7 +1045,6 @@
10431045
"eslint-formatter-gha": "^1.6.0",
10441046
"eslint-formatter-unix": "^9.0.1",
10451047
"eslint-plugin-chai-friendly": "^1.1.0",
1046-
"eslint-plugin-mocha": "^11.2.0",
10471048
"eslint-plugin-prettier": "^5.5.4",
10481049
"eslint-plugin-tsdoc": "^0.5.0",
10491050
"express": "^5.1.0",
@@ -1052,8 +1053,6 @@
10521053
"globals": "^16.5.0",
10531054
"jsdom": "^27.2.0",
10541055
"lodash": "^4.17.21",
1055-
"mocha": "^11.7.5",
1056-
"mocha-junit-reporter": "^2.2.1",
10571056
"mocha-multi-reporters": "^1.5.1",
10581057
"morgan": "^1.10.1",
10591058
"npm-check-updates": "^19.1.2",
@@ -1068,6 +1067,7 @@
10681067
"tsx": "^4.20.6",
10691068
"typescript": "^5.9.3",
10701069
"typescript-eslint": "^8.48.0",
1070+
"vitest": "^4.0.14",
10711071
"vscode-extension-tester": "^8.19.0",
10721072
"warnings-to-errors-webpack-plugin": "^2.3.0",
10731073
"webpack": "^5.103.0",

packages/ansible-language-server/.c8rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"branches": 80.31,
2+
"branches": 81.24,
33
"check-coverage": true,
44
"extends": "../../.c8rc.json",
55
"lines": 0,

renovate.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
],
1414
"github-actions": {
1515
"branchTopic": "build",
16-
"commitMessageTopic": "github actions",
1716
"enabled": true,
1817
"groupName": "github actions",
1918
"groupSlug": "actions",
@@ -58,15 +57,13 @@
5857
},
5958
{
6059
"branchTopic": "npm-dev",
61-
"commitMessageTopic": "npm dev",
6260
"groupSlug": "npm-dev",
6361
"matchDepTypes": ["devDependencies"],
6462
"matchManagers": ["npm"],
6563
"matchUpdateTypes": ["minor", "patch", "major"]
6664
},
6765
{
6866
"branchTopic": "npm",
69-
"commitMessageTopic": "npm",
7067
"matchDepTypes": ["dependencies"],
7168
"matchManagers": ["npm"],
7269
"matchUpdateTypes": ["minor", "patch", "major"]
@@ -77,7 +74,6 @@
7774
},
7875
{
7976
"branchTopic": "npm-lock",
80-
"commitMessageTopic": "npm lockfile",
8177
"description": "Separate lockfile maintenance for npm",
8278
"groupName": "npm lockfile",
8379
"groupSlug": "npm-lockfile",
@@ -86,7 +82,6 @@
8682
},
8783
{
8884
"branchTopic": "pep621",
89-
"commitMessageTopic": "pep621 lockfile",
9085
"description": "Separate lockfile maintenance for Python",
9186
"groupName": "python lockfile",
9287
"groupSlug": "python-lockfile",

test/mochaHooks.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/unit/.c8rc.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)