Skip to content

Commit f8ad86f

Browse files
o2dazoneJaKXz
authored andcommitted
tests: add pending spec for repeated stylelintrc keys (#41)
* 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.
1 parent e6cf081 commit f8ad86f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/.badstylelintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rules": {
3+
"color-hex-length": "short",
4+
"color-hex-length": "short"
5+
}
6+
}

test/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ describe('stylelint-webpack-plugin', function () {
4545
});
4646
});
4747

48+
it.skip('fails when .stylelintrc is not a proper format', function () {
49+
var badConfigFilePath = getPath('./.badstylelintrc');
50+
var config = {
51+
entry: './index',
52+
plugins: [
53+
new StyleLintPlugin({
54+
configFile: badConfigFilePath
55+
})
56+
]
57+
};
58+
59+
return pack(assign({}, baseConfig, config))
60+
.then(function (stats) {
61+
expect(stats.compilation.errors).to.have.length(0);
62+
});
63+
});
64+
4865
it('fails on errors when asked to', function () {
4966
var config = {
5067
context: './test/fixtures/test3',

0 commit comments

Comments
 (0)