Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Added two tests to extract
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Mar 2, 2017
1 parent 8857e00 commit e2cbb23
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/extract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ describe("ExtractTextPlugin.extract()", function() {
]);
});

it("accepts an array of loader names in loader object", function() {
ExtractTextPlugin.extract({
use: ["css-loader", "postcss-loader", "sass-loader"]
}).should.deepEqual([
{ loader: loaderPath, options: { omit: 0, remove:true } },
{ loader: "css-loader" },
{ loader: "postcss-loader" },
{ loader: "sass-loader" }
]);
});

it("accepts a loader object with an options object", function() {
ExtractTextPlugin.extract(
{ use: "css-loader", options: { modules: true } }
Expand All @@ -81,6 +92,19 @@ describe("ExtractTextPlugin.extract()", function() {
]);
});

it("accepts a loader object with an options object in array of loaders", function() {
ExtractTextPlugin.extract({
use: [
{ loader: "css-loader", options: { modules: true } },
"postcss-loader"
]
}).should.deepEqual([
{ loader: loaderPath, options: { omit: 0, remove:true } },
{ loader: "css-loader", options: { modules: true } },
{ loader: "postcss-loader" }
]);
});

it("accepts a loader object with a (legacy) query object", function() {
ExtractTextPlugin.extract(
{ use: "css-loader", query: { modules: true } }
Expand Down

0 comments on commit e2cbb23

Please sign in to comment.