Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 33 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import * as nAutoMetrics from '@financial-times/n-auto-metrics'; |
||
2 | import * as nAutoLogger from '@financial-times/n-auto-logger'; |
||
3 | |||
4 | import setupMonitor from '../setup'; |
||
5 | |||
6 | jest.mock('@financial-times/n-auto-metrics'); |
||
|
|||
7 | jest.mock('@financial-times/n-auto-logger'); |
||
8 | |||
9 | describe('setupMonitor', () => { |
||
10 | afterEach(() => { |
||
11 | jest.resetAllMocks(); |
||
12 | }); |
||
13 | |||
14 | afterAll(() => { |
||
15 | jest.resetModules(); |
||
16 | }); |
||
17 | |||
18 | const app = { |
||
19 | use: jest.fn(), |
||
20 | }; |
||
21 | const metrics = {}; |
||
22 | const logger = {}; |
||
23 | |||
24 | it('initAutoMetrics if metrics instance is provided', () => { |
||
25 | setupMonitor({ app, metrics }); |
||
26 | expect(nAutoMetrics.initAutoMetrics).toBeCalledWith(metrics); |
||
27 | }); |
||
28 | |||
29 | it('setupLoggerInstance to override the default if logger is provided', () => { |
||
30 | setupMonitor({ app, logger }); |
||
31 | expect(nAutoLogger.setupLoggerInstance).toBeCalledWith(logger); |
||
32 | }); |
||
33 | }); |
||
34 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.