src/__tests__/init.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 19
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 4
c 1
b 0
f 0
nc 1
mnd 0
bc 4
fnc 4
dl 0
loc 19
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A init.js ➔ ??? 0 8 1
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