Skip to content

Commit

Permalink
Silence some console.logs during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Mar 19, 2021
1 parent a9a2b5d commit 2b9d623
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/utilities/Fragments.js
Expand Up @@ -55,8 +55,13 @@ describe('utilities/Fragments', function() {
});

test('No template resolver returns `null`', async function() {
let mockConsole = jest.spyOn(console, 'log').mockImplementation(() => {});

let result = await extractFragment(DEFAULT_PREFIX, null, {});
expect(result).toBe(null);
expect(mockConsole).toHaveBeenCalledWith('No template resolver configured');

mockConsole.mockRestore();
});
});
});
5 changes: 5 additions & 0 deletions test/utilities/Messages.js
Expand Up @@ -32,8 +32,13 @@ describe('utilities/Messages', function() {
});

test('No message resolver returns `null`', async function() {
let mockConsole = jest.spyOn(console, 'log').mockImplementation(() => {});

let result = await buildMessage(null, null);
expect(result).toBe(null);
expect(mockConsole).toHaveBeenCalledWith('No message resolver configured');

mockConsole.mockRestore();
});
});
});

0 comments on commit 2b9d623

Please sign in to comment.