Skip to content

Commit 44f4952

Browse files
committed
Migrate integration-tests to typescript
Give us better confidence in our javascript code by writing it in typescript! Changes the tests to use typescript, and fixes compiler errors that went just unnoticed until now. We do not introduce eslint (yet), which might give us even better warnings. At last, changes the tests to always invoke `hdb` with a custom cache directory to ensure a perfectly hermetic test experience.
1 parent 15c956b commit 44f4952

File tree

7 files changed

+278
-15
lines changed

7 files changed

+278
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.bkp
22
.vscode/
33
node_modules/
4+
test/integration-tests/out/
45
vscode-extension/dist/
56
vscode-extension/result
67
dist-newstyle/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extension": ["ts"],
3+
"spec": "test/**/*.test.ts",
4+
"require": "ts-node/register"
5+
}

test/integration-tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ clean:
88
rm -rf ./node_modules
99

1010
node_modules:
11-
nix-shell -p 'nodejs' --run 'npm install'
11+
nix-shell -p 'nodejs' --run 'npm install && npm run compile'
1212

1313
test: node_modules
1414
# PATH=$(dir $(GHC)):$(dir $(DEBUGGER)):$$PATH ./node_modules/.bin/mocha -f 'allow arbitrarily deep'
1515
# nix-shell -p nodejs --run 'PATH=$(dir $(GHC)):$(dir $(DEBUGGER)):$$PATH ./node_modules/.bin/mocha'
1616
@echo "NODE: $(node)"
17-
PATH=$(dir $(GHC)):$(dir $(DEBUGGER)):$(dir $(node)):$$PATH ./node_modules/.bin/mocha --parallel
17+
PATH=$(dir $(GHC)):$(dir $(DEBUGGER)):$(dir $(node)):$$PATH npm run test

test/integration-tests/package-lock.json

Lines changed: 231 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
{
22
"name": "hdb-integration-tests",
33
"version": "1.0.0",
4-
"type": "module",
4+
"type": "commonjs",
55
"dependencies": {
66
"@vscode/debugadapter-testsupport": "^1.68",
77
"mocha": "^11.2.2"
88
},
99
"scripts": {
10-
"test": "mocha"
10+
"compile": "tsc",
11+
"test": "mocha --parallel"
12+
},
13+
"devDependencies": {
14+
"@types/mocha": "^10.0.10",
15+
"@types/node": "^24.3.0",
16+
"ts-node": "^10.9.2",
17+
"typescript": "^5.9.2"
1118
}
1219
}

0 commit comments

Comments
 (0)