-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrunner.int.test.ts
More file actions
68 lines (66 loc) · 1.86 KB
/
Copy pathrunner.int.test.ts
File metadata and controls
68 lines (66 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { expect } from 'vitest';
import { type AuditOutputs, DEFAULT_PERSIST_CONFIG } from '@code-pushup/models';
import { createRunnerFunction } from './index.js';
describe('createRunnerFunction', () => {
it('should successfully execute runner', async () => {
const runner = createRunnerFunction({
reports: [
path.join(
fileURLToPath(path.dirname(import.meta.url)),
'..',
'..',
'..',
'mocks',
'single-record-lcov.info',
),
],
coverageTypes: ['line'],
continueOnCommandFail: true,
});
await expect(
runner({ persist: DEFAULT_PERSIST_CONFIG }),
).resolves.toStrictEqual([
{
slug: 'line-coverage',
score: 0.7,
value: 70,
displayValue: '70 %',
details: {
trees: [
{
type: 'coverage',
title: 'Line coverage',
root: {
name: '.',
values: { coverage: 0.7 },
children: [
{
name: 'src',
values: { coverage: 0.7 },
children: [
{
name: 'lib',
values: { coverage: 0.7 },
children: [
{
name: 'utils.ts',
values: {
coverage: 0.7,
missing: [{ startLine: 7, endLine: 9 }],
},
},
],
},
],
},
],
},
},
],
},
},
] satisfies AuditOutputs);
});
});