Skip to content

Commit 21e95ab

Browse files
mdpdcbartlett
andauthored
Chore: Add baseline unit tests (RooCodeInc#2417)
* Fix: Better Windows path support * Move to 'chai' for test running * Fix: Let's start with what we know * Chore: Add 'root' level file path test, remove less useful tests * Chore: Add 'root' level file path test, remove less useful tests --------- Co-authored-by: Dennis Bartlett <[email protected]>
1 parent cac0309 commit 21e95ab

File tree

9 files changed

+536
-7
lines changed

9 files changed

+536
-7
lines changed

.changeset/mean-dragons-hug.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Chore: Add tests to context-mentions, run tests with mocha and ts-node - `npm run test:unit`
6+

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
- name: Build Extension
7474
run: npm run compile
7575

76+
- name: Unit Tests
77+
run: npm run test:unit
78+
7679
# Run extension tests with coverage
7780
- name: Extension Tests with Coverage
7881
id: extension_coverage

.mocharc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extension": ["ts"],
3+
"spec": "src/**/__tests__/*.ts",
4+
"require": ["ts-node/register", "source-map-support/register"],
5+
"recursive": true
6+
}

package-lock.json

Lines changed: 164 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@
303303
"format:fix": "prettier . --write",
304304
"test": "vscode-test",
305305
"test:ci": "node scripts/test-ci.js",
306+
"test:unit": "TS_NODE_PROJECT='./tsconfig.unit-test.json' mocha",
306307
"test:coverage": "vscode-test --coverage",
307308
"install:all": "npm install && cd webview-ui && npm install",
308309
"dev:webview": "cd webview-ui && npm run dev",
@@ -339,6 +340,7 @@
339340
"prettier": "^3.3.3",
340341
"should": "^13.2.3",
341342
"sinon": "^19.0.2",
343+
"ts-node": "^10.9.2",
342344
"typescript": "^5.4.5"
343345
},
344346
"dependencies": {

0 commit comments

Comments
 (0)