Skip to content

Commit 4b5f5f6

Browse files
authored
add tests for runAsTask (#872)
1 parent 2bd3add commit 4b5f5f6

File tree

3 files changed

+759
-1
lines changed

3 files changed

+759
-1
lines changed

.github/instructions/testing-workflow.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,4 @@ envConfig.inspect
550550
- When fixing mock environment creation, use `null` to truly omit properties rather than `undefined` (1)
551551
- Always recompile TypeScript after making import/export changes before running tests, as stubs won't work if they're applied to old compiled JavaScript that doesn't have the updated imports (2)
552552
- Create proxy abstraction functions for Node.js APIs like `cp.spawn` to enable clean testing - use function overloads to preserve Node.js's intelligent typing while making the functions mockable (1)
553+
- When unit tests fail with VS Code API errors like `TypeError: X is not a constructor` or `Cannot read properties of undefined (reading 'Y')`, check if VS Code APIs are properly mocked in `/src/test/unittests.ts` - add missing Task-related APIs (`Task`, `TaskScope`, `ShellExecution`, `TaskRevealKind`, `TaskPanelKind`) and namespace mocks (`tasks`) following the existing pattern of `mockedVSCode.X = vscodeMocks.vscMockExtHostedTypes.X` (1)

0 commit comments

Comments
 (0)