Download tests/entropy.test.ts from Snapkitty/kittybrowse: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/Snapkitty/kittybrowse/resolve/main/tests/entropy.test.ts
- Command line
-
hf download hf://Snapkitty/kittybrowse/tests/entropy.test.ts
-
curl -L -o entropy.test.ts https://huggingface.co/Snapkitty/kittybrowse/resolve/main/tests/entropy.test.ts
607 Bytes
| import assert from "node:assert/strict"; | |
| import test from "node:test"; | |
| import { entropyScore, isExecutable } from "../src/shared/entropy.js"; | |
| test("entropyScore combines workload, failure pressure, and latency", () => { | |
| const score = entropyScore({ | |
| dependencies: ["a", "b"], | |
| failRate: 0.1, | |
| latencyMs: 500, | |
| }); | |
| assert.equal(score, 0.12); | |
| }); | |
| test("isExecutable blocks high uncertainty tasks", () => { | |
| assert.equal( | |
| isExecutable({ | |
| dependencies: ["a", "b", "c", "d", "e", "f"], | |
| failRate: 0.5, | |
| latencyMs: 5_000, | |
| }), | |
| false, | |
| ); | |
| }); | |