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

80.0
/src/lib/sync-request/pkg-version/pkg-version.ts
1
import {memoize} from 'lodash';
2
import {join} from 'path';
8×
3
import {ext} from '../../../const/ext';
8×
4
import {execLocal} from '../../../fns/execLocal';
8×
5
import {Log} from '../../Log';
8×
6
import {PkgVersionCache} from './PkgVersionCache';
8×
7

8×
8
export type GetPkgVersionsOutput<T extends string> = {
9
  [k in T]?: string;
Branches [[0, 0]] missed. 4×
UNCOV
10
};
!
11

12
function getPkgVersions$<T extends string>(...packages: T[]): GetPkgVersionsOutput<T> {
4×
13
  if (!packages.length) {
4×
14
    return {};
4×
15
  }
Branches [[1, 1]] missed. 4×
16
  Log.info('Querying package versions for the following packages:\n\t' + packages.join('\n\t'));
4×
17
  const args: string[] = ['--pkgs'].concat(packages);
4×
18
  const ret = execLocal(join(__dirname, `get.${ext}`), args);
Branches [[2, 1]] missed. 44×
19

44×
20
  if (ret.status === 0) {
21
    const parsed: PkgVersionCache = JSON.parse(ret.stdout);
44×
22

23
    return packages.reduce<GetPkgVersionsOutput<T>>(
UNCOV
24
      (acc, pkgName) => {
!
25
        if (parsed[pkgName]) {
26
          acc[pkgName] = parsed[pkgName].latest;
8×
27
        }
28

29
        return acc;
30
      },
31
      {}
32
    );
33
  }
34

35
  throw new Error(ret.stderr);
36
}
37

38
export const getPkgVersions: typeof getPkgVersions$ = <any>memoize(getPkgVersions$);
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