Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 38 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import path from 'path'; |
||
2 | import { assert } from 'chai'; |
||
3 | import fs from 'fs-extra'; |
||
4 | import { load } from '../utils'; |
||
5 | import { testsRootFolder, tmpFolder } from '../constants'; |
||
6 | import Test from '../Test'; |
||
7 | |||
8 | const { getGitCommit } = load('utils/gitUtils'); |
||
9 | const factory = new Test(); |
||
10 | const tmpRepoDir = path.join(tmpFolder, 'repo'); |
||
11 | |||
12 | suite('gitUtils'); |
||
13 | |||
14 | before(async function () { |
||
15 | await factory.setTmpFolder(); |
||
16 | |||
17 | await fs.copy( |
||
18 | path.join(testsRootFolder, 'files/repository'), |
||
19 | tmpRepoDir |
||
20 | ); |
||
21 | |||
22 | await fs.move( |
||
23 | path.join(tmpRepoDir, 'git_folder'), |
||
24 | path.join(tmpRepoDir, '.git') |
||
25 | ); |
||
26 | }); |
||
27 | |||
28 | test('Positive: getGitCommit', async function () { |
||
29 | assert.equal( |
||
30 | await getGitCommit(tmpRepoDir), |
||
31 | '1c3e319b380a9572a80499984ba6f0c3341a3772' |
||
32 | ); |
||
33 | }); |
||
34 | |||
35 | after(async function () { |
||
36 | await factory.cleanTmpFolder(); |
||
37 | await fs.remove(tmpRepoDir); |
||
38 | }); |
||
39 |