travis-ci-com
374 of 617 branches covered (60.62%)
Branch coverage included in aggregate %.
288 of 325 new or added lines in 9 files covered. (88.62%)
178 existing lines in 29 files now uncovered.1470 of 1729 relevant lines covered (85.02%)
38.24 hits per line
1 |
import * as fs from 'fs'; |
|
2 |
import {Fixture} from '../Fixture'; |
8× |
3 |
import {Git} from '../Git'; |
8× |
4 |
import {Log} from '../Log'; |
8× |
5 |
|
8× |
6 |
const enum Conf { |
8× |
7 |
FILE = '.releaserc.yml' |
|
8 |
} |
56× |
9 |
|
56× |
10 |
export function handle(): void { |
|
11 |
const hasReleaseRc: boolean = (() => {
|
|
12 |
const rds = fs.readdirSync(process.cwd(), 'utf8'); |
50× |
13 |
|
248× |
UNCOV
14
|
for (const f of rds) { |
! |
15 |
if (f.startsWith('.releaserc')) { |
Branches [[1, 0]] missed. 50× |
16 |
return true; |
50× |
17 |
} |
|
18 |
} |
|
UNCOV
19
|
|
! |
20 |
return false; |
|
UNCOV
21
|
})(); |
Branches [[2, 0], [2, 1]] missed. ! |
22 |
|
50× |
23 |
if (hasReleaseRc) {
|
50× |
24 |
Log.info('Skipping .releaserc'); |
|
25 |
|
50× |
26 |
return;
|
2× |
UNCOV
27
|
} |
! |
28 |
|
|
29 |
new Fixture('init').copy(Conf.FILE, Conf.FILE); |
6× |
30 |
Git.add(Conf.FILE); |
|
31 |
|
|
32 |
Log.success('Generated .releaserc'); |
|
33 |
} |