1
1
import { describe , expect , it , vi } from 'vitest' ;
2
- import {
3
- collectAndPersistReports ,
4
- readCodePushupConfig ,
5
- } from '@code-pushup/core' ;
2
+ import { collectAndPersistReports , readRcByPath } from '@code-pushup/core' ;
6
3
import { DEFAULT_CLI_CONFIGURATION } from '../../../mocks/constants' ;
7
4
import { yargsCli } from '../yargs-cli' ;
8
5
import { yargsCollectCommandObject } from './collect-command' ;
@@ -14,7 +11,7 @@ vi.mock('@code-pushup/core', async () => {
14
11
return {
15
12
...core ,
16
13
collectAndPersistReports : vi . fn ( ) . mockResolvedValue ( { } ) ,
17
- readCodePushupConfig : vi . fn ( ) . mockResolvedValue ( CORE_CONFIG_MOCK ) ,
14
+ readRcByPath : vi . fn ( ) . mockResolvedValue ( CORE_CONFIG_MOCK ) ,
18
15
} ;
19
16
} ) ;
20
17
@@ -26,9 +23,7 @@ describe('collect-command', () => {
26
23
commands : [ yargsCollectCommandObject ( ) ] ,
27
24
} ) . parseAsync ( ) ;
28
25
29
- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
30
- '/test/code-pushup.config.ts' ,
31
- ) ;
26
+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
32
27
33
28
expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
34
29
expect . objectContaining ( {
@@ -57,9 +52,7 @@ describe('collect-command', () => {
57
52
} ,
58
53
) . parseAsync ( ) ;
59
54
60
- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
61
- '/test/code-pushup.config.ts' ,
62
- ) ;
55
+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
63
56
64
57
expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
65
58
expect . objectContaining ( {
@@ -86,9 +79,7 @@ describe('collect-command', () => {
86
79
} ,
87
80
) . parseAsync ( ) ;
88
81
89
- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
90
- '/test/code-pushup.config.ts' ,
91
- ) ;
82
+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
92
83
93
84
expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
94
85
expect . objectContaining ( {
0 commit comments