Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

Alorel / personal-build-tools / 367

23 Oct 2018 - 20:45 coverage increased (+5.02%) to 78.602%
367

Pull #33

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
fix travis typecheck script
Pull Request #33: Build

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

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/src/lib/init/00_test.ts
1
import * as fs from 'fs-extra';
2
import {Git} from '../Git';
8×
3
import {Log} from '../Log';
8×
4

8×
5
const enum Paths {
8×
6
  MOCHA_OPTS = 'mocha.opts',
7
  SRC_INDEX = 'src/index.ts',
56×
8
  TEST_STUB = 'test/stub.ts'
56×
9
}
56×
10

56×
11
export function handle(): void {
12
  if (!fs.pathExistsSync(Paths.MOCHA_OPTS)) {
13
    const contents = [
Branches [[1, 1]] missed. 50×
14
      '--check-leaks',
50×
15
      '--exit',
16
      '--full-trace',
17
      '-r ts-node/register',
18
      '-r source-map-support/register',
19
      '-t 10000',
20
      '--trace-deprecation',
21
      '--trace-warnings',
22
      '--throw-deprecation',
23
      '--recursive',
24
      '--watch-extensions ts',
25
      'test/**/*.ts'
26
    ].join('\n') + '\n';
27
    fs.writeFileSync(Paths.MOCHA_OPTS, contents);
28
    Git.add(Paths.MOCHA_OPTS);
50×
29
    Log.success('Created mocha.opts');
50×
30
  }
50×
31

32
  if (!fs.pathExistsSync('test')) {
Branches [[2, 1]] missed. 50×
33
    fs.mkdirpSync('test');
50×
34
    const contents = [
50×
35
      'import {expect} from \'chai\';',
36
      '',
37
      'describe(\'Stub test suite\', function () {',
38
      '  it(\'Stub test\', () => {',
39
      '    console.log(\'I pass!\');',
40
      '  });',
41
      '});'
42
    ].join('\n') + '\n';
43
    fs.writeFileSync(Paths.TEST_STUB, contents);
50×
44
    Git.add(Paths.TEST_STUB);
50×
45
    Log.success('Created test/stub.ts');
50×
46
  }
47

Branches [[3, 1]] missed. 50×
48
  if (!fs.pathExistsSync(Paths.SRC_INDEX)) {
Branches [[4, 0], [4, 1]] missed. 50×
49
    if (!fs.pathExistsSync('src')) {
2×
50
      fs.mkdirpSync('src');
UNCOV
51
    }
!
UNCOV
52
    fs.writeFileSync(Paths.SRC_INDEX, '// stub\n');
!
UNCOV
53
    Git.add(Paths.SRC_INDEX);
!
54
    Log.success('Created src/index.ts');
55
  }
56
}
6×
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2022 Coveralls, Inc