-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
26 lines (22 loc) · 1.01 KB
/
test.js
File metadata and controls
26 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import assert from "node:assert/strict";
import { analyzeAmbiguity } from "./src/index.js";
const mixed = analyzeAmbiguity(
"I care about you a lot, but I just can't do this right now. Maybe later when things calm down."
);
assert.equal(mixed.status, "mixed-signal heavy");
assert.equal(mixed.decision.verdict, "ask one concrete question");
assert.ok(mixed.metrics.ambiguity >= 6);
assert.ok(mixed.metrics.pushPull >= 3);
const direct = analyzeAmbiguity(
"I can talk tomorrow at 3. Call me when you are free and we can sort it out."
);
assert.equal(direct.status, "fairly direct");
assert.equal(direct.decision.verdict, "take the text at face value");
assert.ok(direct.metrics.clarity >= 7);
const blaming = analyzeAmbiguity(
"You're overthinking this again. I was joking. Don't make this harder than it is."
);
assert.equal(blaming.status, "defensive / minimising");
assert.equal(blaming.decision.verdict, "do not argue the framing first");
assert.ok(blaming.metrics.blame >= 5);
console.log("ambiguity-meter tests passed");