-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (24 loc) · 1 KB
/
test.js
File metadata and controls
28 lines (24 loc) · 1 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
27
28
import assert from "node:assert/strict";
import { analyzeReplyTone } from "./src/index.js";
const warm = analyzeReplyTone(
"Thanks for the nudge. I appreciate it. Please send the draft by Friday and I will review it that day.",
{ context: "client" }
);
assert.equal(warm.label, "warm / clear");
assert.ok(warm.metrics.warmth > warm.metrics.pressure);
assert.equal(warm.decision.verdict, "send");
const harsh = analyzeReplyTone(
"You need to send this ASAP. Why didn't you do it already?! I need an answer right now.",
{ context: "dating" }
);
assert.equal(harsh.label, "sharp / pressuring");
assert.ok(harsh.metrics.pressure >= 7);
assert.equal(harsh.decision.verdict, "slow down");
const vague = analyzeReplyTone(
"Maybe we can sort of revisit this whenever you want, I guess, if that still makes sense?",
{ context: "recruiter" }
);
assert.equal(vague.label, "vague / overly soft");
assert.ok(vague.metrics.clarity < 5.5);
assert.equal(vague.decision.verdict, "clarify");
console.log("replytone tests passed");