Compare commits
3 commits
b48cd61e05
...
c13f6818a7
Author | SHA1 | Date | |
---|---|---|---|
c13f6818a7 | |||
56c886862c | |||
7c9411b4e2 |
3 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ export default class CliHelper {
|
||||||
const output = OutputHelper.GenerateOutput(response, options);
|
const output = OutputHelper.GenerateOutput(response, options);
|
||||||
|
|
||||||
if (options.o) {
|
if (options.o) {
|
||||||
writeFileSync(options.o, output);
|
writeFileSync(options.o, `${output}\n`);
|
||||||
} else {
|
} else {
|
||||||
console.log(output);
|
console.log(output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe("Endpoint", () => {
|
||||||
expect(OutputHelper.GenerateOutput).toHaveBeenCalledWith(response, options);
|
expect(OutputHelper.GenerateOutput).toHaveBeenCalledWith(response, options);
|
||||||
|
|
||||||
expect(fs.writeFileSync).toHaveBeenCalledTimes(1);
|
expect(fs.writeFileSync).toHaveBeenCalledTimes(1);
|
||||||
expect(fs.writeFileSync).toHaveBeenCalledWith("file.txt", "test output");
|
expect(fs.writeFileSync).toHaveBeenCalledWith("file.txt", "test output\n");
|
||||||
|
|
||||||
expect(console.log).not.toHaveBeenCalled();
|
expect(console.log).not.toHaveBeenCalled();
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ describe('randomBunny', () => {
|
||||||
expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound);
|
expect(result.Error!.Code).toBe(ErrorCode.NoImageResultsFound);
|
||||||
expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound);
|
expect(result.Error!.Message).toBe(ErrorMessages.NoImageResultsFound);
|
||||||
|
|
||||||
expect(fetchMock).toBeCalledWith('https://reddit.com/r/rabbits/new.json?limit=100');
|
expect(fetchMock).toHaveBeenCalledWith('https://reddit.com/r/rabbits/new.json?limit=100');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('GIVEN randomSelect does NOT find a valid response, EXPECT failure result', async () => {
|
test('GIVEN randomSelect does NOT find a valid response, EXPECT failure result', async () => {
|
||||||
|
|
Loading…
Reference in a new issue