Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import { initAutoMetrics, getMetricsInstance } from '../init'; |
||
2 | |||
3 | describe('initAutoMetrics', () => { |
||
4 | it('would store the metrics instance that can be got', () => { |
||
5 | const instance = { foo: 'bar' }; |
||
6 | initAutoMetrics(instance); |
||
7 | const metrics = getMetricsInstance(); |
||
8 | expect(metrics).toBe(instance); |
||
9 | }); |
||
10 | }); |
||
11 | |||
12 | describe('getMetricsInstance', () => { |
||
13 | it('should repeatedly get the stored instance after init', () => { |
||
14 | const instance = { foo: 'bar' }; |
||
15 | initAutoMetrics(instance); |
||
16 | expect(getMetricsInstance()).toBe(instance); |
||
17 | expect(getMetricsInstance()).toBe(instance); |
||
18 | }); |
||
19 | }); |
||
20 |