• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marcomontalbano / figma-export / 8040637088

25 Feb 2024 08:41PM CUT coverage: 96.473%. Remained the same
8040637088

push

github

web-flow
Merge pull request #162 from marcomontalbano/add-overrides-for-axios

Add `overrides` for axios

236 of 258 branches covered (91.47%)

Branch coverage included in aggregate %.

612 of 621 relevant lines covered (98.55%)

17.9 hits per line

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

95.45
/packages/cli/src/utils.ts
1
import fs from 'fs';
1✔
2
import path from 'path';
1✔
3

4
const resolveNameOrPath = (nameOrPath: string): string => {
1✔
5
    const absolutePath = path.resolve(nameOrPath);
1✔
6
    return fs.existsSync(absolutePath) ? absolutePath : nameOrPath;
1!
7
};
8

9
// eslint-disable-next-line @typescript-eslint/ban-types
10
export const requirePackages = <T extends Function>(packages: string[], baseOptions = {}): T[] => {
1✔
11
    return packages.map((pkg) => {
2✔
12
        const pkgNameOrPath = resolveNameOrPath(pkg);
1✔
13

14
        // eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
15
        return require(pkgNameOrPath)(baseOptions);
1✔
16
    });
17
};
18

19
export function asUndefinableArray<T>(entry: T | T[] | undefined): T[] | undefined {
1✔
20
    return entry ? ([] as T[]).concat(entry) : undefined;
9✔
21
}
22

23
export function asArray<T>(entry: T | T[] | undefined): T[] {
1✔
24
    return asUndefinableArray(entry) ?? [];
9✔
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc