Skip to content

Commit

Permalink
Fixed a testcase that caused an error on CI (#24)
Browse files Browse the repository at this point in the history
Fixed a testcase that caused an error on CI
  • Loading branch information
ntwb committed Dec 27, 2019
2 parents 0ca0077 + b9b0f92 commit 1a0509d
Showing 1 changed file with 39 additions and 10 deletions.
49 changes: 39 additions & 10 deletions lib/stylelint-vscode/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,23 +370,52 @@ a { color: #000 }
}
})();

try {
t.deepEqual(
await stylelintVSCode(new Document('unknown-rule.css', 'css', 'b{}'), {
config: {
rules: {
'this-rule-does-not-exist': 1,
'this-rule-also-does-not-exist': 1,
},
},
});
fail();
} catch ({ message }) {
t.equal(
message,
'Undefined rule this-rule-does-not-exist',
'should be rejected when the rules include unknown one.',
);
}
})
.then(r=>r.diagnostics),
[
{
range: {
start: {
line: 0,
character: 0,
},
end: {
line: 0,
character: 0,
},
},
message: 'Unknown rule this-rule-does-not-exist.',
severity: ERROR,
code: 'this-rule-does-not-exist',
source: 'stylelint',
},
{
range: {
start: {
line: 0,
character: 0,
},
end: {
line: 0,
character: 0,
},
},
message: 'Unknown rule this-rule-also-does-not-exist.',
severity: ERROR,
code: 'this-rule-also-does-not-exist',
source: 'stylelint',
},
],
'should be resolved with diagnostics when the rules include unknown rules.'
);

try {
await stylelintVSCode(Symbol('!'));
Expand Down

0 comments on commit 1a0509d

Please sign in to comment.