11import { 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' ;
63import { DEFAULT_CLI_CONFIGURATION } from '../../../mocks/constants' ;
74import { yargsCli } from '../yargs-cli' ;
85import { yargsCollectCommandObject } from './collect-command' ;
@@ -14,7 +11,7 @@ vi.mock('@code-pushup/core', async () => {
1411 return {
1512 ...core ,
1613 collectAndPersistReports : vi . fn ( ) . mockResolvedValue ( { } ) ,
17- readCodePushupConfig : vi . fn ( ) . mockResolvedValue ( CORE_CONFIG_MOCK ) ,
14+ readRcByPath : vi . fn ( ) . mockResolvedValue ( CORE_CONFIG_MOCK ) ,
1815 } ;
1916} ) ;
2017
@@ -26,9 +23,7 @@ describe('collect-command', () => {
2623 commands : [ yargsCollectCommandObject ( ) ] ,
2724 } ) . parseAsync ( ) ;
2825
29- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
30- '/test/code-pushup.config.ts' ,
31- ) ;
26+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
3227
3328 expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
3429 expect . objectContaining ( {
@@ -57,9 +52,7 @@ describe('collect-command', () => {
5752 } ,
5853 ) . parseAsync ( ) ;
5954
60- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
61- '/test/code-pushup.config.ts' ,
62- ) ;
55+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
6356
6457 expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
6558 expect . objectContaining ( {
@@ -86,9 +79,7 @@ describe('collect-command', () => {
8679 } ,
8780 ) . parseAsync ( ) ;
8881
89- expect ( readCodePushupConfig ) . toHaveBeenCalledWith (
90- '/test/code-pushup.config.ts' ,
91- ) ;
82+ expect ( readRcByPath ) . toHaveBeenCalledWith ( '/test/code-pushup.config.ts' ) ;
9283
9384 expect ( collectAndPersistReports ) . toHaveBeenCalledWith (
9485 expect . objectContaining ( {
0 commit comments