Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 26 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import fse from 'fs-extra'; |
||
2 | import { getNamespace } from 'cls-hooked'; |
||
3 | import { tmpFolder } from './constants'; |
||
4 | import { traces } from './mock'; |
||
5 | import './init-hooks'; |
||
6 | |||
7 | |||
8 | export * from './utils'; |
||
9 | export * from './constants'; |
||
10 | |||
11 | export default class Test { |
||
12 | async setTmpFolder() { |
||
13 | await this.cleanTmpFolder(); |
||
14 | await fse.ensureDir(tmpFolder); |
||
15 | } |
||
16 | |||
17 | async cleanTmpFolder() { |
||
18 | await fse.remove(tmpFolder); |
||
19 | } |
||
20 | |||
21 | getTraces() { |
||
22 | const traceID = getNamespace('__TEST__').get('current').id; |
||
23 | |||
24 | return traces.filter(t => t.type === 'requestSent' && t.traceId === traceID); |
||
25 | } |
||
26 | } |
||
27 |