@@ -170,6 +170,46 @@ describe('loader', () => {
170170 expect ( stats . compilation . errors ) . toMatchSnapshot ( 'errors' ) ;
171171 } ) ;
172172
173+ // Uncomment after `css-loader` release the `esModule` option
174+ // if (
175+ // [
176+ // 'styleTag',
177+ // 'singletonStyleTag',
178+ // 'lazyStyleTag',
179+ // 'lazySingletonStyleTag',
180+ // ].includes(injectType)
181+ // ) {
182+ // it(`should work when the "injectType" option is "${injectType}" and "css-loader" uses ES module syntax`, async () => {
183+ // const testId = getTestId('simple.js', injectType);
184+ // const stats = await compile(testId, {
185+ // loader: { options: { injectType } },
186+ // cssLoader: { options: { esModule: true } },
187+ // });
188+ //
189+ // runTestInJsdom(stats, (dom) => {
190+ // expect(dom.serialize()).toMatchSnapshot('DOM');
191+ // });
192+ //
193+ // expect(stats.compilation.warnings).toMatchSnapshot('warnings');
194+ // expect(stats.compilation.errors).toMatchSnapshot('errors');
195+ // });
196+ //
197+ // it(`should work when the "injectType" option is "${injectType}" and "css-loader" uses CommonJS module syntax`, async () => {
198+ // const testId = getTestId('simple.js', injectType);
199+ // const stats = await compile(testId, {
200+ // loader: { options: { injectType } },
201+ // cssLoader: { options: { esModule: true } },
202+ // });
203+ //
204+ // runTestInJsdom(stats, (dom) => {
205+ // expect(dom.serialize()).toMatchSnapshot('DOM');
206+ // });
207+ //
208+ // expect(stats.compilation.warnings).toMatchSnapshot('warnings');
209+ // expect(stats.compilation.errors).toMatchSnapshot('errors');
210+ // });
211+ // }
212+
173213 if ( [ 'lazyStyleTag' , 'lazySingletonStyleTag' ] . includes ( injectType ) ) {
174214 it ( `should work when ref is negative when the "injectType" option is "${ injectType } "` , async ( ) => {
175215 expect . assertions ( 3 ) ;
0 commit comments