diff --git a/tests/unit/build/optional-transformers-dependency.test.ts b/tests/unit/build/optional-transformers-dependency.test.ts index 5f4301b887..07bf0d8b69 100644 --- a/tests/unit/build/optional-transformers-dependency.test.ts +++ b/tests/unit/build/optional-transformers-dependency.test.ts @@ -15,8 +15,7 @@ test("@huggingface/transformers is a regular dependency so npm ci never skips it // pin dragged onnxruntime-node@1.21.0 whose NAN build no longer compiles), which // broke `npm ci`/`next build` with "Can't resolve @huggingface/transformers" // (lazy import in src/lib/memory/embedding/transformersLocal.ts). As a regular - // dep with onnxruntime-node@~1.24.3 (the version @huggingface/transformers - // requires, napi prebuilds, no node-gyp) it stays + // dep with onnxruntime-node@~1.24.3 (napi prebuilds, no node-gyp) it stays // installable and the memory embedding path requires() cleanly. const pkg = readJson<{ dependencies?: Record; @@ -45,14 +44,7 @@ test("transformers + onnxruntime-node are regular dependencies (not optional)", assert.equal(pkg.optionalDependencies?.["onnxruntime-node"], undefined); const lock = readJson<{ - packages: Record< - string, - { - optional?: boolean; - dependencies?: Record; - optionalDependencies?: Record; - } - >; + packages: Record; optionalDependencies?: Record }>; }>("package-lock.json"); assert.equal( @@ -62,16 +54,7 @@ test("transformers + onnxruntime-node are regular dependencies (not optional)", ); // Optional flag is only written `true` for genuinely optional packages; // regular deps leave it absent/null. Assert each is NOT optional. - assert.ok( - !lock.packages["node_modules/@huggingface/transformers"]?.optional, - "transformers must not be marked optional in the lockfile" - ); - assert.ok( - !lock.packages["node_modules/onnxruntime-node"]?.optional, - "onnxruntime-node must not be marked optional in the lockfile" - ); - assert.ok( - !lock.packages["node_modules/onnxruntime-common"]?.optional, - "onnxruntime-common must not be marked optional in the lockfile" - ); + assert.ok(!lock.packages["node_modules/@huggingface/transformers"]?.optional, "transformers must not be marked optional in the lockfile"); + assert.ok(!lock.packages["node_modules/onnxruntime-node"]?.optional, "onnxruntime-node must not be marked optional in the lockfile"); + assert.ok(!lock.packages["node_modules/onnxruntime-common"]?.optional, "onnxruntime-common must not be marked optional in the lockfile"); });