Skip to content

Commit bfed6cc

Browse files
mishig25claude
andcommitted
test: use callable assert() so TS narrows moe
`assert.ok(x, msg)` doesn't carry an `asserts value` signature, so the CI build flagged `moe` as possibly undefined on the lines below. Use the plain callable form, matching the existing `assert(!parse.sharded)` pattern in this file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 700434e commit bfed6cc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/hub/src/lib/parse-safetensors-metadata.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe("parseSafetensorsMetadata", () => {
159159
});
160160

161161
assert(parse.sharded);
162-
assert.ok(parse.moe, "expected `moe` field on MoE repo");
162+
assert(parse.moe, "expected `moe` field on MoE repo");
163163
assert.strictEqual(parse.moe.numExperts, 8);
164164
assert.strictEqual(parse.moe.topK, 2);
165165
assert.strictEqual(parse.moe.hasSharedExpert, false);
@@ -176,7 +176,7 @@ describe("parseSafetensorsMetadata", () => {
176176
});
177177

178178
assert(parse.sharded);
179-
assert.ok(parse.moe, "expected `moe` field on MoE repo");
179+
assert(parse.moe, "expected `moe` field on MoE repo");
180180
assert.strictEqual(parse.moe.numExperts, 128);
181181
assert.strictEqual(parse.moe.topK, 8);
182182
// Published: A3B (3B active).
@@ -191,7 +191,7 @@ describe("parseSafetensorsMetadata", () => {
191191
});
192192

193193
assert(parse.sharded);
194-
assert.ok(parse.moe, "expected `moe` field on MoE repo");
194+
assert(parse.moe, "expected `moe` field on MoE repo");
195195
assert.strictEqual(parse.moe.numExperts, 64);
196196
assert.strictEqual(parse.moe.topK, 6);
197197
assert.strictEqual(parse.moe.hasSharedExpert, true);

0 commit comments

Comments
 (0)