File tree Expand file tree Collapse file tree
packages/openapi-ts/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,6 +286,32 @@ describe('createClient', () => {
286286 expect ( results ) . toHaveLength ( 4 ) ;
287287 } ) ;
288288
289+ it ( 'warns when duplicate plugins are specified' , async ( ) => {
290+ const warnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
291+
292+ await createClient ( {
293+ dryRun : true ,
294+ input : {
295+ info : { title : 'duplicate-plugin-test' , version : '1.0.0' } ,
296+ openapi : '3.1.0' ,
297+ } ,
298+ logs : {
299+ level : 'silent' ,
300+ } ,
301+ output : 'output' ,
302+ plugins : [
303+ { name : '@hey-api/typescript' } ,
304+ { name : '@hey-api/typescript' } ,
305+ ] ,
306+ } ) ;
307+
308+ expect ( warnSpy ) . toHaveBeenCalledWith (
309+ expect . stringContaining ( 'Duplicate plugin' ) ,
310+ ) ;
311+
312+ warnSpy . mockRestore ( ) ;
313+ } ) ;
314+
289315 it ( 'executes @angular/common HttpRequest builder path' , async ( ) => {
290316 const results = await createClient ( {
291317 dryRun : true ,
You can’t perform that action at this time.
0 commit comments