Skip to content

Commit 45d93a8

Browse files
committed
.
1 parent 9a3d756 commit 45d93a8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/helpers/__tests__/logger.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,38 @@ test('debug should call console.debug', () => {
1111
logger.debug('test message');
1212

1313
expect(_console.debug).toHaveBeenCalledTimes(1);
14-
expect(_console.debug).toHaveBeenCalledWith(expect.any(String));
14+
expect(jest.mocked(_console.debug).mock.calls[0][0]).toMatchInlineSnapshot(`
15+
" ● test message
16+
"
17+
`);
1518
});
1619

1720
test('should call console.info', () => {
1821
logger.info('info message');
1922

2023
expect(_console.info).toHaveBeenCalledTimes(1);
21-
expect(_console.info).toHaveBeenCalledWith(expect.any(String));
24+
expect(jest.mocked(_console.info).mock.calls[0][0]).toMatchInlineSnapshot(`
25+
" ● info message
26+
"
27+
`);
2228
});
2329

2430
test('should call console.warn', () => {
2531
logger.warn('warning message');
2632

2733
expect(_console.warn).toHaveBeenCalledTimes(1);
28-
expect(_console.warn).toHaveBeenCalledWith(expect.any(String));
34+
expect(jest.mocked(_console.warn).mock.calls[0][0]).toMatchInlineSnapshot(`
35+
" ▲ warning message
36+
"
37+
`);
2938
});
3039

3140
test('should call console.error', () => {
3241
logger.error('error message');
3342

3443
expect(_console.error).toHaveBeenCalledTimes(1);
35-
expect(_console.error).toHaveBeenCalledWith(expect.any(String));
44+
expect(jest.mocked(_console.error).mock.calls[0][0]).toMatchInlineSnapshot(`
45+
" ■ error message
46+
"
47+
`);
3648
});

0 commit comments

Comments
 (0)