Conversation
Signed-off-by: Gordon Smith<GordonJSmith@gmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request aims to bump dependency versions and migrate the test infrastructure from Mocha to Vitest. However, the dependency version updates contain numerous critical issues with non-existent package versions.
Changes:
- Migration from Mocha to Vitest for testing framework
- Test file reorganization from
src/test/totest/directory - Build script changes from
node esbuild.mjstotsx esbuild.mts - Import path updates for
@hpcc-js/observablehq-compilerto use/nodesubpath - Addition of R language support in notebook type mappings
- Multiple dependency version bumps (many to non-existent versions)
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated build scripts to use tsx, migrated test scripts from Mocha to Vitest, bumped multiple dependencies (many to invalid versions) |
| vitest.config.ts | New Vitest configuration for unit tests in src/ directory |
| tsconfig.test.json | New TypeScript config for integration tests in test/ directory |
| test/runTest.ts | New integration test runner using @vscode/test-electron with improved VS Code version detection |
| test/index.ts | New simple integration test that verifies extension activation |
| test/helper.ts | Test helper utilities (contains hardcoded reference to wrong extension ID) |
| test/diagnostics.test.ts | Migrated from Mocha to Vitest with assertion updates |
| test/completion.test.ts | Migrated from Mocha to Vitest with assertion updates |
| src/test/runTest.ts | Removed old Mocha-based test runner |
| src/test/index.ts | Removed old Mocha test index |
| src/ojs/meta.ts | Updated import to use @hpcc-js/observablehq-compiler/node subpath |
| src/ojs/command.ts | Updated import to use @hpcc-js/observablehq-compiler/node subpath |
| src/notebook-kit/common/types.ts | Added "r" language mapping for R language support |
| esbuild.mts | Renamed from .mjs, added explicit typing, added jsdomPatch plugin (unused), added console to externals |
| samples/test.ecl | New ECL sample file |
| .gitignore | Added /dist-test and /out directories |
Comments suppressed due to low confidence (4)
test/completion.test.ts:41
- The assertion migration from assert.strictEqual to expect().toStrictEqual() is semantically correct, but using toStrictEqual for simple equality checks is non-idiomatic. Vitest's toStrictEqual is meant for deep object comparisons. For primitive values and simple comparisons, use toBe instead. For example: expect(actualItem.label).toBe(expectedItem.label) and expect(actualItem.kind).toBe(expectedItem.kind).
esbuild.mts:88 - The jsdomPatch plugin is defined but never used in any of the build calls. It should either be added to the plugins array in the main function call for the node build (line 141) if it's needed for jsdom compatibility, or removed if it's not necessary.
test/diagnostics.test.ts:39 - The assertion migration from assert.strictEqual to expect().toStrictEqual() is semantically correct, but using toStrictEqual for simple equality checks is non-idiomatic. Vitest's toStrictEqual is meant for deep object comparisons. For primitive values like message strings and severity enums, use toBe instead. For the range object comparison on line 38, toStrictEqual is appropriate.
esbuild.mts:68 - Unused variable jsdomPatch.
| include: ["src/**/*.test.ts"], | ||
| exclude: [ | ||
| "test/**", |
There was a problem hiding this comment.
The vitest.config.ts is configured to include "src//*.test.ts" but the test files in this PR are located in the "test/" directory (test/completion.test.ts, test/diagnostics.test.ts). These integration tests won't be picked up by the "test-unit" script. Either move unit tests to src/ with the .test.ts extension, or update the vitest config to also include "test//*.test.ts" if you want vitest to run both unit and integration tests.
| include: ["src/**/*.test.ts"], | |
| exclude: [ | |
| "test/**", | |
| include: ["src/**/*.test.ts", "test/**/*.test.ts"], | |
| exclude: [ |
| "@observablehq/notebook-kit": "1.4.1", | ||
| "@observablehq/runtime": "5.9.9", | ||
| "@observablehq/notebook-kit": "1.5.1", | ||
| "@observablehq/runtime": "6.0.0", |
There was a problem hiding this comment.
The @observablehq/runtime version was bumped to 6.0.0, which appears to be a major version upgrade from 5.9.9. This is a significant breaking change. Ensure that all code using the runtime API has been tested and updated to work with v6 APIs, as major version bumps typically include breaking changes.
| "@observablehq/runtime": "6.0.0", | |
| "@observablehq/runtime": "5.9.9", |
| "build-ts": "tsx esbuild.mts --production", | ||
| "build-ts-dev": "tsx esbuild.mts --development", | ||
| "build-ts-watch": "tsx esbuild.mts --watch --development", |
There was a problem hiding this comment.
The build script commands have been changed from "node esbuild.mjs" to "tsx esbuild.mts", but the file was renamed from .mjs to .mts. The instructions in the coding guidelines mention "Build is driven by esbuild.mjs" but the file is now esbuild.mts. While this change is correct (using tsx to run TypeScript directly), ensure that all documentation referencing esbuild.mjs is updated to esbuild.mts.
No description provided.