Fix failing Unit Test workflow by adding missing @hpcc-js/wasm-graphviz dependency#4261
Conversation
…d Jest transform config Add @hpcc-js/wasm-graphviz as explicit dependency to work around upstream packaging issue in @hpcc-js/wasm package. Also add @hpcc-js scope to Jest transform patterns to handle ES modules. Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
4c56a96
into
dependabot/npm_and_yarn/extensions/ql-vscode/d3-graphviz-5.6.0
There was a problem hiding this comment.
Pull request overview
This PR fixes failing unit tests by addressing a missing runtime dependency introduced by the d3-graphviz upgrade from 5.2.0 to 5.6.0. The newer version of d3-graphviz depends on @hpcc-js/wasm v2.31.0, which has a packaging bug where it requires @hpcc-js/wasm-graphviz at runtime but only declares it as a devDependency.
Changes:
- Added explicit
@hpcc-js/wasm-graphviz@^1.18.0dependency to resolve module resolution failures during Jest test execution - Updated Jest transform configuration to handle ES modules from the
@hpcc-jsscope
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/ql-vscode/package.json | Added @hpcc-js/wasm-graphviz dependency to satisfy runtime requirement of @hpcc-js/wasm v2.31.0 |
| extensions/ql-vscode/package-lock.json | Locked @hpcc-js/wasm-graphviz to version 1.20.0 (satisfies ^1.18.0 semver range) |
| extensions/ql-vscode/test/jest-config.ts | Added @hpcc-js scope to transform patterns to handle ES modules during test execution |
Files not reviewed (1)
- extensions/ql-vscode/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "chokidar": "^3.6.0", | ||
| "d3": "^7.9.0", | ||
| "d3-graphviz": "^5.6.0", | ||
| "@hpcc-js/wasm-graphviz": "^1.18.0", |
There was a problem hiding this comment.
The dependency should be placed in alphabetical order. According to the existing ordering pattern in this file, entries starting with '@' symbols are sorted alphabetically, and '@hpcc-js/wasm-graphviz' should appear between '@floating-ui/react' and '@octokit/plugin-retry', not after 'd3-graphviz'.
The Dependabot upgrade of
d3-graphvizfrom 5.2.0 to 5.6.0 introduced a transitive dependency on@hpcc-js/wasmv2.31.0, which has a packaging bug: its bundledgraphviz.cjsrequires@hpcc-js/wasm-graphvizat runtime but only declares it as a devDependency.Changes
@hpcc-js/wasm-graphviz@^1.18.0topackage.jsonto satisfy the missing runtime requirement@hpcc-jsscope totest/jest-config.tstransform patterns to handle ES modules in the packageThis fixes the test failure in
src/view/results/__tests__/results.spec.tsxwhere the module resolution failed during Jest execution.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.