Skip to content

Commit 56727ca

Browse files
committed
test(doctor): assert exact scrubbed error output
1 parent 6ee3c17 commit 56727ca

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

src/flows/doctor-lint-flow.test.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@ function check(id: string, detect: HealthCheck["detect"]): HealthCheck {
2424
};
2525
}
2626

27-
function hasUnpairedSurrogate(value: string): boolean {
28-
for (let index = 0; index < value.length; index++) {
29-
const code = value.charCodeAt(index);
30-
if (code >= 0xd800 && code <= 0xdbff) {
31-
const next = value.charCodeAt(index + 1);
32-
if (next < 0xdc00 || next > 0xdfff) {
33-
return true;
34-
}
35-
index++;
36-
} else if (code >= 0xdc00 && code <= 0xdfff) {
37-
return true;
38-
}
39-
}
40-
return false;
41-
}
42-
4327
describe("runDoctorLintChecks", () => {
4428
it("filters selected checks and reports skipped count", async () => {
4529
const result = await runDoctorLintChecks(ctx, {
@@ -162,10 +146,7 @@ describe("runDoctorLintChecks", () => {
162146
],
163147
});
164148

165-
const message = result.findings[0]?.message ?? "";
166-
expect(message).toMatch(/^health check threw: /);
167-
expect(message.endsWith("...")).toBe(true);
168-
expect(hasUnpairedSurrogate(message)).toBe(false);
149+
expect(result.findings[0]?.message).toBe(`health check threw: ${"A".repeat(252)}...`);
169150
});
170151
});
171152

0 commit comments

Comments
 (0)