Skip to content

Commit

Permalink
chore: Add a test against #146
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed Oct 7, 2020
1 parent 3902651 commit 536a0b6
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions test/customize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,71 @@ function mergeNested() {
);
});

it("should merge #146", function() {
const a = {
module: {
rules: [
{
test: /\.css$/,
use: [{ loader: "style-loader" }, { loader: "sass-loader" }]
}
]
}
};
const b = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: "style-loader",
options: {
modules: true
}
}
]
}
]
}
};
const result = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: "style-loader",
options: {
modules: true
}
},
{ loader: "sass-loader" }
]
}
]
}
};

assert.deepStrictEqual(
mergeWithCustomize({
customizeArray: customizeArray({
module: {
rules: {
test: CustomizeRule.Match,
use: {
loader: CustomizeRule.Match,
options: CustomizeRule.Replace
}
}
}
})
})(a, b),
result
);
});

it("should merge #149", function() {
const base = {
module: {
Expand Down

0 comments on commit 536a0b6

Please sign in to comment.