This repository has been archived by the owner on Sep 28, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: multiples config per instance are now supported (#123)
Closes #105
- Loading branch information
1 parent
570730c
commit 672a100
Showing
3 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
var test = require("tape") | ||
var webpack = require("webpack") | ||
var assign = require("object-assign") | ||
var conf = require("./utils/conf") | ||
|
||
test.only("eslint-loader will create an engine for each unique config", function(t) { // eslint-disable-line max-len | ||
webpack(assign({}, | ||
conf, | ||
{ | ||
entry: "./test/fixtures/good.js", | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
loader: "./index", | ||
query: { | ||
rules: { | ||
quotes: [1, "single"], | ||
}, | ||
}, | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: "./index", | ||
query: { | ||
rules: { | ||
semi: [1, "always"], | ||
}, | ||
}, | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
} | ||
), | ||
function(err, stats) { | ||
if (err) { | ||
throw err | ||
} | ||
|
||
t.ok( | ||
stats.compilation.warnings.length === 2, | ||
"should report an error for each config" | ||
) | ||
|
||
t.ok( | ||
stats.compilation.warnings.find(warning => /quotes/.test(warning)), | ||
"should have a warning about quotes" | ||
) | ||
|
||
t.ok( | ||
stats.compilation.warnings.find(warning => /semi/.test(warning)), | ||
"should have a warning about semi" | ||
) | ||
|
||
t.end() | ||
}) | ||
}) |