Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Commit be51bd3

Browse files
committed
add test case for non-module css and slightly improve test log output
1 parent ac16c0f commit be51bd3

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"prepublish": "npm run build",
99
"pretest": "rm -f ./test/example*.css.d.ts",
1010
"test:diff": "(cd test; set -e; for f in example*css.d.ts; do diff $f expected-$f; done;)",
11-
"test:run": "babel-node ./node_modules/webpack/bin/webpack --config ./test/webpack.config.babel.js && npm run test:diff",
12-
"test": "npm run test:run > /dev/null 2>&1 && npm run test:run"
11+
"test:run": "babel-node ./node_modules/webpack/bin/webpack --config ./test/webpack.config.babel.js",
12+
"test:run-twice" : "npm run test:run > /dev/null 2>&1 && npm run test:run",
13+
"test": "npm run test:run-twice && npm run test:diff"
1314
},
1415
"author": "Tim Sebastian <[email protected]>",
1516
"license": "MIT",

test/entry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {locals as stylesBase} from './example.css';
22
import {locals as stylesCamelCase} from './example-camelcase.css';
33
import * as stylesNamedExport from './example-namedexport.css';
44
import * as stylesCamelCasedNamedExport from './example-camelcase-namedexport.css';
5+
import './example-no-css-modules.css';
56

67
const foo = stylesBase.foo;
78
const barBaz = stylesBase['bar-baz'];

test/example-no-css-modules.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.foo {
2+
color: white;
3+
}
4+
5+
.bar-baz {
6+
color: green;
7+
}

test/webpack.config.babel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
{ test: /example.css$/, loader: '../src/index.js?modules' },
1111
{ test: /example-camelcase.css$/, loader: '../src/index.js?modules&camelCase' },
1212
{ test: /example-namedexport.css$/, loader: '../src/index.js?modules&namedExport' },
13-
{ test: /example-camelcase-namedexport.css$/, loader: '../src/index.js?modules&camelCase&namedExport' }
13+
{ test: /example-camelcase-namedexport.css$/, loader: '../src/index.js?modules&camelCase&namedExport' },
14+
{ test: /example-no-css-modules.css$/, loader: '../src/index.js' },
1415
]
1516
}
1617
};

0 commit comments

Comments
 (0)