Skip to content

Commit e67b939

Browse files
feggeclaude
andcommitted
refactor: improve type safety and strengthen extension tests
- Fix unsafe non-null assertions by properly handling undefined activeTextEditor in getActiveSelectionLocation and related methods - Add eslint-disable comments with justifications for necessary non-null assertions - Refactor extension tests to verify actual behavior (persisted data) instead of only checking command execution success - Remove redundant unit tests superseded by integration tests - Update pre-commit hook to fail on ESLint warnings - Add pretest:ext script to ensure compilation before extension tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent eeef9e1 commit e67b939

26 files changed

+731
-6528
lines changed

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

3-
# Run ESLint on src/
3+
# Run ESLint on src/ (fail on warnings too)
44
echo "Running ESLint..."
5-
npm run lint
5+
npm run lint -- --max-warnings 0
66
if [ $? -ne 0 ]; then
77
echo "ESLint failed. Please fix the errors before committing."
88
exit 1

.vscode-test.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { defineConfig } from "@vscode/test-cli";
2+
import * as path from "path";
23

34
export default defineConfig({
4-
files: "out/test/extension/**/*.test.js",
5+
files: "out/test/extension/suite/**/*.test.js",
56
version: process.env.VSCODE_VERSION || "stable",
7+
workspaceFolder: path.resolve("test/extension/fixtures/sample-workspace"),
68
mocha: {
7-
ui: "bdd",
9+
ui: "tdd",
810
timeout: 60000,
911
},
10-
launchArgs: ["--disable-extensions", "--disable-gpu"],
12+
launchArgs: ["--disable-extensions", "--disable-gpu", "--disable-workspace-trust"],
13+
extensionDevelopmentPath: path.resolve("."),
1114
});

0 commit comments

Comments
 (0)