@@ -298,6 +298,46 @@ describe('devupUIPlugin', () => {
298298 expect ( ( plugin as any ) . apply ( { } , { command : 'build' } ) ) . toBe ( true )
299299 } )
300300
301+ it ( 'should include' , ( ) => {
302+ const devupPath = 'devup.json'
303+ const interfacePath = '.df'
304+ const cssFile = join ( _dirname , 'devup-ui.css' )
305+ const libPackage = '@devup-ui/react'
306+ const plugin = DevupUI ( {
307+ package : libPackage ,
308+ cssFile,
309+ devupPath,
310+ interfacePath,
311+ include : [ '@devup/product-system' ] ,
312+ } )
313+ vi . mocked ( codeExtract ) . mockReturnValue ( {
314+ css : 'css code' ,
315+ code : 'code' ,
316+ } as any )
317+ ; ( plugin as any ) . transform ( 'code' , 'node_modules/@devup/test/dist/index.js' )
318+ expect ( codeExtract ) . toBeCalledTimes ( 0 )
319+ ; ( plugin as any ) . transform (
320+ 'code' ,
321+ 'node_modules/@devup/product-system/dist/index.js' ,
322+ )
323+ expect ( codeExtract ) . toHaveBeenCalledWith (
324+ 'node_modules/@devup/product-system/dist/index.js' ,
325+ 'code' ,
326+ libPackage ,
327+ cssFile ,
328+ )
329+ ; ( plugin as any ) . transform (
330+ 'code' ,
331+ 'C:/devfive/minions-front/apps/vendor/node_modules/.vite/deps/@devup_product-system.js?v=63f19272' ,
332+ )
333+ expect ( codeExtract ) . toHaveBeenCalledWith (
334+ 'C:/devfive/minions-front/apps/vendor/node_modules/.vite/deps/@devup_product-system.js?v=63f19272' ,
335+ 'code' ,
336+ libPackage ,
337+ cssFile ,
338+ )
339+ } )
340+
301341 describe ( 'basic' , ( ) => {
302342 const devupPath = 'devup.json'
303343 const interfacePath = '.df'
0 commit comments