forked from webpack-contrib/eslint-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'MoOx/master' into interpolate_outputReport
* MoOx/master: README: Add information about eslint behaviour when configFile is set directly (webpack-contrib#129) (webpack-contrib#130) Add clarifying note to README (webpack-contrib#127) Removed test.only so that all tests will run (webpack-contrib#125) 1.6.1 Fixed: multiples config per instance are now supported (webpack-contrib#123)
- Loading branch information
Showing
5 changed files
with
88 additions
and
9 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
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("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() | ||
}) | ||
}) |