@@ -5,42 +5,52 @@ import { expect, test } from 'vitest';
55test ( 'should extract css with pluginSass in bundle' , async ( ) => {
66 const fixturePath = join ( __dirname , 'bundle' ) ;
77 const { contents } = await buildAndGetResults ( { fixturePath, type : 'css' } ) ;
8- const esmFiles = Object . keys ( contents . esm ) ;
9- expect ( esmFiles ) . toMatchInlineSnapshot ( `
8+
9+ const esmFileNames = Object . keys ( contents . esm ) ;
10+ const esmFileContents = Object . values ( contents . esm ) ;
11+ expect ( esmFileNames ) . toMatchInlineSnapshot ( `
1012 [
1113 "<ROOT>/tests/integration/style/sass/bundle/dist/esm/index.css",
1214 ]
1315 ` ) ;
1416
15- const cjsFiles = Object . keys ( contents . cjs ) ;
16- expect ( cjsFiles ) . toMatchInlineSnapshot ( `
17+ expect ( esmFileContents ) . toMatchSnapshot ( ) ;
18+
19+ const cjsFileNames = Object . keys ( contents . cjs ) ;
20+ const cjsFileContents = Object . values ( contents . cjs ) ;
21+ expect ( cjsFileNames ) . toMatchInlineSnapshot ( `
1722 [
1823 "<ROOT>/tests/integration/style/sass/bundle/dist/cjs/index.css",
1924 ]
2025 ` ) ;
26+ expect ( cjsFileContents ) . toMatchSnapshot ( ) ;
2127} ) ;
2228
2329test ( 'should extract css with pluginSass in bundle-false' , async ( ) => {
2430 const fixturePath = join ( __dirname , 'bundle-false' ) ;
2531 const { contents } = await buildAndGetResults ( { fixturePath, type : 'css' } ) ;
26- const esmFiles = Object . keys ( contents . esm ) ;
2732
28- expect ( esmFiles ) . toMatchInlineSnapshot ( `
33+ const esmFileNames = Object . keys ( contents . esm ) ;
34+ const esmFileContents = Object . values ( contents . esm ) ;
35+ expect ( esmFileNames ) . toMatchInlineSnapshot ( `
2936 [
3037 "<ROOT>/tests/integration/style/sass/bundle-false/dist/esm/foundation/_code.css",
3138 "<ROOT>/tests/integration/style/sass/bundle-false/dist/esm/foundation/_lists.css",
3239 "<ROOT>/tests/integration/style/sass/bundle-false/dist/esm/foundation/index.css",
3340 "<ROOT>/tests/integration/style/sass/bundle-false/dist/esm/index.css",
3441 ]
3542 ` ) ;
43+ expect ( esmFileContents ) . toMatchSnapshot ( ) ;
3644
37- const cjsFiles = Object . keys ( contents . cjs ) ;
38- expect ( cjsFiles ) . toMatchInlineSnapshot ( `
45+ const cjsFileNames = Object . keys ( contents . cjs ) ;
46+ const cjsFileContents = Object . values ( contents . cjs ) ;
47+ expect ( cjsFileNames ) . toMatchInlineSnapshot ( `
3948 [
4049 "<ROOT>/tests/integration/style/sass/bundle-false/dist/cjs/foundation/_code.css",
4150 "<ROOT>/tests/integration/style/sass/bundle-false/dist/cjs/foundation/_lists.css",
4251 "<ROOT>/tests/integration/style/sass/bundle-false/dist/cjs/foundation/index.css",
4352 "<ROOT>/tests/integration/style/sass/bundle-false/dist/cjs/index.css",
4453 ]
4554 ` ) ;
55+ expect ( cjsFileContents ) . toMatchSnapshot ( ) ;
4656} ) ;
0 commit comments