Skip to content

Commit 019ccb1

Browse files
author
Zhen Zhen Yuan (BEYONDSOFT CONSULTING INC)
committed
chore: auto-format localization.test.ts for CI
1 parent 00f131a commit 019ccb1

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

test/localization/localization.test.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,28 @@ suite("localizationTest", function () {
1313
);
1414
const unknownPlatform = ErrorHelper.getInternalError(InternalErrorCode.UnknownPlatform);
1515
test("localization should show correct message on ZH-CN for CommandFailed error", (done: Mocha.Done) => {
16-
console.log(`[DEBUG] Actual message: "${commandFailedErrorChs.message}"`);
17-
console.log(
18-
`[DEBUG] Expected message: "执行命令 IncorrectCommand 时出错 (error code 101)"`,
19-
);
20-
assert.strictEqual(
21-
commandFailedErrorChs.message,
22-
"执行命令 IncorrectCommand 时出错 (error code 101)",
23-
);
16+
const actual = commandFailedErrorChs.message;
17+
const expected = "执行命令 IncorrectCommand 时出错 (error code 101)";
18+
19+
// Show actual message in assertion error for debugging
20+
if (actual !== expected) {
21+
assert.fail(
22+
`Message mismatch!\nActual: "${actual}"\nExpected: "${expected}"\nActual length: ${actual.length}, Expected length: ${expected.length}`,
23+
);
24+
}
2425
done();
2526
});
2627

2728
test("localization should show correct message on ZH-CN for unknownPlatform error", (done: Mocha.Done) => {
28-
console.log(`[DEBUG] Actual message: "${unknownPlatform.message}"`);
29-
console.log(`[DEBUG] Expected message: "未知平台: {0} (error code 201)"`);
30-
assert.strictEqual(unknownPlatform.message, "未知平台: {0} (error code 201)");
29+
const actual = unknownPlatform.message;
30+
const expected = "未知平台: {0} (error code 201)";
31+
32+
// Show actual message in assertion error for debugging
33+
if (actual !== expected) {
34+
assert.fail(
35+
`Message mismatch!\nActual: "${actual}"\nExpected: "${expected}"\nActual length: ${actual.length}, Expected length: ${expected.length}`,
36+
);
37+
}
3138
done();
3239
});
3340
});

0 commit comments

Comments
 (0)