Skip to content

Commit 14c52f7

Browse files
committed
Add test coverage
1 parent 4f451ce commit 14c52f7

6 files changed

+48
-1
lines changed

test/entry.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import {locals as stylesBase} from './example.css';
22
import {locals as stylesCamelCase} from './example-camelcase.css';
3+
import {locals as stylesOrderAlphabetically} from './example-orderalphabetically.css';
34
import * as stylesNamedExport from './example-namedexport.css';
45
import * as stylesCamelCasedNamedExport from './example-camelcase-namedexport.css';
6+
import * as stylesNamedExportOrderAlphabetically from './example-namedexport-orderalphabetically.css';
57
import './example-no-css-modules.css';
68
import * as compose from './example-compose.css';
79

10+
811
const foo = stylesBase.foo;
912
const barBaz = stylesBase['bar-baz'];
1013

@@ -17,4 +20,12 @@ const fooNamedExport = stylesNamedExport.foo;
1720
const fooCamelCaseNamedExport = stylesCamelCasedNamedExport.foo;
1821
const barBazCamelCaseNamedExport = stylesCamelCasedNamedExport.barBaz;
1922

23+
const fooStylesOrderAlphabetically = stylesOrderAlphabetically.foo;
24+
const barStylesOrderAlphabetically = stylesOrderAlphabetically.bar;
25+
const bazStylesOrderAlphabetically = stylesOrderAlphabetically.baz;
26+
27+
const fooNamedExportOrderAlhpabetically = stylesNamedExportOrderAlphabetically.foo;
28+
const barNamedExportOrderAlhpabetically = stylesNamedExportOrderAlphabetically.bar;
29+
const bazNamedExportOrderAlhpabetically = stylesNamedExportOrderAlphabetically.baz;
30+
2031
const composed = compose.test;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.foo {
2+
color: white;
3+
}
4+
5+
.baz {
6+
color: red;
7+
}
8+
9+
.bar {
10+
color: green;
11+
}
12+

test/example-orderalphabetically.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.foo {
2+
color: white;
3+
}
4+
5+
.baz {
6+
color: red;
7+
}
8+
9+
.bar {
10+
color: green;
11+
}
12+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const bar: string;
2+
export const baz: string;
3+
export const foo: string;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface IExampleOrderalphabeticallyCss {
2+
'bar': string;
3+
'baz': string;
4+
'foo': string;
5+
}
6+
7+
export const locals: IExampleOrderalphabeticallyCss;

test/webpack.config.babel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ module.exports = {
1212
{ test: /example-namedexport\.css$/, loader: '../src/index.js?modules&namedExport' },
1313
{ test: /example-camelcase-namedexport\.css$/, loader: '../src/index.js?modules&camelCase&namedExport' },
1414
{ test: /example-no-css-modules\.css$/, loader: '../src/index.js' },
15-
{ test: /example-compose\.css$/, loader: '../src/index.js?modules&camelCase&namedExport' }
15+
{ test: /example-compose\.css$/, loader: '../src/index.js?modules&camelCase&namedExport' },
16+
{ test: /example-orderalphabetically\.css$/, loader: '../src/index.js?modules&orderAlphabetically' },
17+
{ test: /example-namedexport-orderalphabetically\.css$/, loader: '../src/index.js?modules&namedExport&orderAlphabetically' }
1618
]
1719
}
1820
};

0 commit comments

Comments
 (0)