Skip to content

Commit

Permalink
tests: add pending spec for repeated stylelintrc keys (#41)
Browse files Browse the repository at this point in the history
* implement unit test to highlight poor json config can break stylelint

* adds pending test

Because I did some investigation into stylelint's JSON parsing library (cosmiconfig) and wanted to add the fix there, but there were some blockers that we will have to get around another time.

Having this feedback in the master branch will be helpful.
  • Loading branch information
o2dazone authored and JaKXz committed Dec 17, 2016
1 parent e6cf081 commit f8ad86f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/.badstylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"color-hex-length": "short",
"color-hex-length": "short"
}
}
17 changes: 17 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ describe('stylelint-webpack-plugin', function () {
});
});

it.skip('fails when .stylelintrc is not a proper format', function () {
var badConfigFilePath = getPath('./.badstylelintrc');
var config = {
entry: './index',
plugins: [
new StyleLintPlugin({
configFile: badConfigFilePath
})
]
};

return pack(assign({}, baseConfig, config))
.then(function (stats) {
expect(stats.compilation.errors).to.have.length(0);
});
});

it('fails on errors when asked to', function () {
var config = {
context: './test/fixtures/test3',
Expand Down

0 comments on commit f8ad86f

Please sign in to comment.