File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
packages/plugin-typescript/src/lib Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11import type { CompilerOptions } from 'typescript' ;
22import type { Audit , CategoryConfig , CategoryRef } from '@code-pushup/models' ;
3- import { kebabCaseToCamelCase , ui } from '@code-pushup/utils' ;
3+ import { kebabCaseToCamelCase , logger } from '@code-pushup/utils' ;
44import { AUDITS , GROUPS , TYPESCRIPT_PLUGIN_SLUG } from './constants.js' ;
55import type {
66 TypescriptPluginConfig ,
@@ -146,6 +146,6 @@ export function logSkippedAudits(audits: Audit[]) {
146146 audit => ! audits . some ( filtered => filtered . slug === audit . slug ) ,
147147 ) . map ( audit => kebabCaseToCamelCase ( audit . slug ) ) ;
148148 if ( skippedAudits . length > 0 ) {
149- ui ( ) . logger . info ( `Skipped audits: [${ skippedAudits . join ( ', ' ) } ]` ) ;
149+ logger . info ( `Skipped audits: [${ skippedAudits . join ( ', ' ) } ]` ) ;
150150 }
151151}
Original file line number Diff line number Diff line change 11import { describe , expect , it } from 'vitest' ;
22import { type Audit , categoryRefSchema } from '@code-pushup/models' ;
3- import { ui } from '@code-pushup/utils' ;
3+ import { logger } from '@code-pushup/utils' ;
44import { AUDITS } from './constants.js' ;
55import {
66 filterAuditsByCompilerOptions ,
@@ -124,15 +124,16 @@ describe('logSkippedAudits', () => {
124124 it ( 'should warn about skipped audits' , ( ) => {
125125 logSkippedAudits ( AUDITS . slice ( 0 , - 1 ) ) ;
126126
127- expect ( ui ( ) ) . toHaveLogged (
128- 'info' ,
127+ expect ( logger . info ) . toHaveBeenCalledWith (
129128 expect . stringContaining ( `Skipped audits: [` ) ,
130129 ) ;
131130 } ) ;
132131
133132 it ( 'should camel case the slugs in the audit message' , ( ) => {
134133 logSkippedAudits ( AUDITS . slice ( 0 , - 1 ) ) ;
135134
136- expect ( ui ( ) ) . toHaveLogged ( 'info' , expect . stringContaining ( `unknownCodes` ) ) ;
135+ expect ( logger . info ) . toHaveBeenCalledWith (
136+ expect . stringContaining ( `unknownCodes` ) ,
137+ ) ;
137138 } ) ;
138139} ) ;
You can’t perform that action at this time.
0 commit comments