test: tighten locale version assertion · openclaw/openclaw@a4c95bb
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -143,8 +143,12 @@ describe("i18n", () => {
|
143 | 143 | |
144 | 144 | it("keeps the version label available in shipped locales", () => { |
145 | 145 | for (const [locale, value] of Object.entries(shippedLocales)) { |
146 | | -expect((value.common as { version?: string }).version, locale).toBeTypeOf("string"); |
147 | | -expect((value.common as { version?: string }).version?.trim(), locale).not.toBe(""); |
| 146 | +const version = (value.common as { version?: unknown }).version; |
| 147 | +expect(version, locale).toBeTypeOf("string"); |
| 148 | +if (typeof version !== "string") { |
| 149 | +throw new Error(`expected ${locale} common.version to be a string`); |
| 150 | +} |
| 151 | +expect(version.trim(), locale).not.toBe(""); |
148 | 152 | } |
149 | 153 | }); |
150 | 154 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。