Passed
Push — master ( cb0bee...b6af25 )
by Dmytro
01:59 queued 11s
created

tests/Test.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 29
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 0

4 Functions

Rating   Name   Duplication   Size   Complexity  
A Test.setTmpFolder 0 3 1
A Test.js ➔ load 0 4 1
A Test.js ➔ resolve 0 3 1
A Test.cleanTmpFolder 0 3 1
1
import path from 'path';
2
import fse from 'fs-extra';
3
import { tmpFolder, entry } from './constants';
4
5
export default class Test {
6
    async setTmpFolder() {
7
        await fse.ensureDir(tmpFolder);
8
    }
9
10
    async cleanTmpFolder() {
11
        await fse.remove(tmpFolder);
12
    }
13
}
14
15
function load(relPath) {
16
    // eslint-disable-next-line security/detect-non-literal-require
17
    return require(path.join(entry, relPath));
18
}
19
20
function resolve(relPath) {
21
    return require.resolve(path.join(entry, relPath));
22
}
23
24
export {
25
    tmpFolder,
26
    entry,
27
    load,
28
    resolve
29
};
30