Skip to content

Commit 640ebc8

Browse files
committed
refactor: update dependencies, drop TAP
This updates our dependencies. I was also recently made aware of Node's support for custom reporters thanks to rluvaton, which was not available when I first began working on the extension. This moves over to them and makes a bunch of assorted fixes found on the way. Some notable ones: - We now use `pretty-format`, the same library used in Jest, to format objects for diff comparison. - Console output is no longer associated with specific test cases. This is not possible to do with current APIs, since the test reporters always get events asynchronously, so a test may not even be 'started' when we intercept a `console.log`. We did some best effort stuff here before, but it was very poor. (It would be better to use async_hooks to handle tests running in parallel, but there's (perhaps rightly) not a point in which we can wrap test methods to do that without trying to money-patch modules.) - There's a new `nodejs-testing.verbose` config option folks can use to get raw reporter information in the Test Results output to aid in issue reporting. - The test runner might be a bit more speedy since our worker no longer imports the large `tap` module. - I fixed an issue that may have resulted in test cases not reporting results in spite of correct console output. - You can now choose between a couple of different simple output styles for the Test Results console using the `nodejs-testing.style` config option. cc @rluvaton
1 parent 0d487ca commit 640ebc8

File tree

21 files changed

+3818
-2653
lines changed

21 files changed

+3818
-2653
lines changed

.vscode/launch.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"description": "Integration test to run",
1212
"options": [
1313
"simple",
14-
"sourcemapped"
14+
"sourcemapped",
15+
"modules"
1516
// add more test names here as needed
1617
]
1718
}
@@ -21,13 +22,24 @@
2122
"name": "Run Extension",
2223
"type": "extensionHost",
2324
"request": "launch",
24-
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/testCases/simple/workspace"],
25+
"args": [
26+
"--extensionDevelopmentPath=${workspaceFolder}",
27+
"${workspaceFolder}/testCases/simple/workspace"
28+
],
2529
"trace": {
2630
"logFile": "/mnt/c/Users/conno/Downloads/log.txt"
2731
},
28-
// "autoAttachChildProcesses": true,
32+
"autoAttachChildProcesses": false,
2933
"outFiles": ["${workspaceFolder}/out/**/*.js"]
3034
},
35+
{
36+
"name": "Run Unit Tests",
37+
"type": "node",
38+
"request": "launch",
39+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/vitest",
40+
"args": ["--run"],
41+
"console": "integratedTerminal"
42+
},
3143
{
3244
"name": "Run Integration Tests",
3345
"type": "extensionHost",

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"typescript.tsc.autoDetect": "off",
1111
"editor.formatOnSave": true,
1212
"editor.codeActionsOnSave": {
13-
"source.organizeImports": true
14-
}
13+
"source.organizeImports": "explicit"
14+
},
15+
"testing.openTesting": "openOnTestStart"
1516
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _Theme: [Codesong](https://marketplace.visualstudio.com/items?itemName=connor431
4343
},
4444
{
4545
"extensions": ["mts", "cts", "ts"],
46-
"parameters": ["--loader", "tsx"]
46+
"parameters": ["--import", "tsx"]
4747
}
4848
]
4949
}

changelog.md

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

0 commit comments

Comments
 (0)