Skip to content

Commit e2cbb23

Browse files
committed
Added two tests to extract
1 parent 8857e00 commit e2cbb23

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/extract.test.js

+24
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ describe("ExtractTextPlugin.extract()", function() {
7272
]);
7373
});
7474

75+
it("accepts an array of loader names in loader object", function() {
76+
ExtractTextPlugin.extract({
77+
use: ["css-loader", "postcss-loader", "sass-loader"]
78+
}).should.deepEqual([
79+
{ loader: loaderPath, options: { omit: 0, remove:true } },
80+
{ loader: "css-loader" },
81+
{ loader: "postcss-loader" },
82+
{ loader: "sass-loader" }
83+
]);
84+
});
85+
7586
it("accepts a loader object with an options object", function() {
7687
ExtractTextPlugin.extract(
7788
{ use: "css-loader", options: { modules: true } }
@@ -81,6 +92,19 @@ describe("ExtractTextPlugin.extract()", function() {
8192
]);
8293
});
8394

95+
it("accepts a loader object with an options object in array of loaders", function() {
96+
ExtractTextPlugin.extract({
97+
use: [
98+
{ loader: "css-loader", options: { modules: true } },
99+
"postcss-loader"
100+
]
101+
}).should.deepEqual([
102+
{ loader: loaderPath, options: { omit: 0, remove:true } },
103+
{ loader: "css-loader", options: { modules: true } },
104+
{ loader: "postcss-loader" }
105+
]);
106+
});
107+
84108
it("accepts a loader object with a (legacy) query object", function() {
85109
ExtractTextPlugin.extract(
86110
{ use: "css-loader", query: { modules: true } }

0 commit comments

Comments
 (0)