| | |
| | | |
| | | // THEN the CLI should print help info |
| | | expect(res.stdout).toContain("Convert from one currency to another"); |
| | | |
| | | // AND the command should exit normally |
| | | expect(res.stderr).toBeFalsy(); |
| | | }); |
| | | |
| | | it("should check for missing flags", async () => { |
| | |
| | | |
| | | // THEN the CLI should convert from USD to USD |
| | | expect(res.stdout).toMatch("3.5 USD -> 3.5 USD"); |
| | | |
| | | // AND the command should exit normally |
| | | expect(res.stderr).toBeFalsy(); |
| | | }); |
| | | |
| | | it("should convert different currencies", async () => { |
| | |
| | | |
| | | // THEN the CLI should convert between two different currencies |
| | | expect(res.stdout).toMatch("3.5 USD -> 364.6 JPY"); |
| | | |
| | | // AND the command should exit normally |
| | | expect(res.stderr).toBeFalsy(); |
| | | }); |
| | | }); |
| | | |