Skip to content

Commit edebe6e

Browse files
tests: take regExpForStyles into account
1 parent 12b64db commit edebe6e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/generators/__tests__/utils/styleSupport.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ describe('styleSupport', () => {
3535
const gen = getMockGenerator();
3636
const { ExtractUseProps, regExpForStyles } = style(gen, StylingType.SASS);
3737
expect(gen.dependencies).toEqual(['node-sass', 'sass-loader', 'css-loader', 'style-loader']);
38-
expect(regExpForStyles).toEqual('/.(scss|css)$/');
3938
expect(ExtractUseProps.length).toEqual(3);
4039
});
4140

4241
it('generates production SASS configuration', () => {
4342
const gen = getMockGenerator();
4443
gen.isProd = true;
45-
const { ExtractUseProps } = style(gen, StylingType.SASS);
44+
const { ExtractUseProps, regExpForStyles } = style(gen, StylingType.SASS);
45+
expect(regExpForStyles).toEqual('/.(scss|css)$/');
4646
expect(gen.dependencies).toEqual(['node-sass', 'sass-loader', 'css-loader']);
4747
expect(ExtractUseProps.length).toEqual(2);
4848
});
@@ -58,7 +58,8 @@ describe('styleSupport', () => {
5858
it('generates production LESS configuration', () => {
5959
const gen = getMockGenerator();
6060
gen.isProd = true;
61-
const { ExtractUseProps } = style(gen, StylingType.LESS);
61+
const { ExtractUseProps, regExpForStyles } = style(gen, StylingType.LESS);
62+
expect(regExpForStyles).toEqual('/.(less|css)$/');
6263
expect(gen.dependencies).toEqual(['less', 'less-loader', 'css-loader']);
6364
expect(ExtractUseProps.length).toEqual(2);
6465
});
@@ -76,8 +77,9 @@ describe('styleSupport', () => {
7677
it('generates production PostCSS configuration', () => {
7778
const gen = getMockGenerator();
7879
gen.isProd = true;
79-
const { ExtractUseProps } = style(gen, StylingType.PostCSS);
80+
const { ExtractUseProps, regExpForStyles } = style(gen, StylingType.PostCSS);
8081
expect(gen.dependencies).toEqual(['precss', 'autoprefixer', 'css-loader', 'postcss-loader']);
82+
expect(regExpForStyles).toEqual('/.css$/');
8183
expect(ExtractUseProps.length).toEqual(2);
8284
});
8385
});

0 commit comments

Comments
 (0)