Skip to content

Commit

Permalink
test: add more test cases (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Sep 12, 2024
1 parent 538be81 commit 578f859
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ describe('fanyi CLI', () => {
expect(stdout4).toContain('{"iciba":true}');
});

it('should print without color', async () => {
await runScript(['config', 'set', 'color', 'false']);
const { stdout } = await runScript(['hello']);
expect(stdout).toContain(`hello 英[ hə'ləʊ ] 美[ həˈloʊ ] ~ iciba.com`);
});

it('should print config', async () => {
const { stdout } = await runScript(['config', 'list']);
expect(stdout).toContain('.config/fanyi/.fanyirc');
Expand Down

0 comments on commit 578f859

Please sign in to comment.