| Total Complexity | 4 |
| Complexity/F | 1 |
| Lines of Code | 29 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 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 |