Skip to content

Commit f5c6205

Browse files
committed
fix(tests): read Sharp metadata through its resolved entry
1 parent 316de48 commit f5c6205

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/vscode-ide-companion/src/tests/sharp-loader.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { buildSharpInstallArgs, createSharpLoader, type SharpInstallProgress } f
1010

1111
const tempDirs: string[] = [];
1212
const require = createRequire(import.meta.url);
13-
const SHARP_VERSION: string = require("sharp/package.json").version;
13+
const sharpPackagePath = path.join(path.dirname(require.resolve("sharp")), "..", "package.json");
14+
const SHARP_VERSION: string = JSON.parse(fs.readFileSync(sharpPackagePath, "utf8")).version;
1415

1516
afterEach(() => {
1617
for (const dir of tempDirs.splice(0)) {

0 commit comments

Comments
 (0)