Skip to content

Commit

Permalink
Update tests/index.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gitauto-ai[bot] authored Nov 28, 2024
1 parent dade2e6 commit 4446964
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,9 @@ describe('fanyi CLI', () => {
const { stderr } = await runScript(['ant love']);
expect(stderr).not.toContain('访问 iciba 失败');
});

it('should translate Chinese text to English', async () => {
const { stdout } = await runScript(['translate', '无法翻译这段文字']);
expect(stdout).toContain('Translation failed. Please try again later.');

Check failure on line 88 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / test (18)

tests/index.test.ts > fanyi CLI > should translate Chinese text to English

AssertionError: expected '\n translate 无法翻译这段文字 \u001b[90m ~ i…' to contain 'Translation failed. Please try again …' - Expected + Received - Translation failed. Please try again later. + + translate 无法翻译这段文字 ~ iciba.com + + ----- + + translate [trænzˈleɪt] ~ 翻译 [fān yì] ~ 💡 + + - 动词 [动] 把一种语言转换成另一种语言 + - 名词 [名] 翻译的结果;译文 + + 例句: + 1. 请帮助我翻译这篇文章。 + Please help me translate this article. + 2. 他是一位优秀的翻译家。 + He is an excellent translator. + + 💡 Believe in the power of language, and let translation be the bridge to a wider world. + 相信语言的力量,让翻译成为通往更广阔世界的桥梁。 + ❯ tests/index.test.ts:88:20
});
});

0 comments on commit 4446964

Please sign in to comment.