-
Notifications
You must be signed in to change notification settings - Fork 37
/
border-none.test.mjs
49 lines (40 loc) · 964 Bytes
/
border-none.test.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { beforeEach, describe, it } from 'node:test';
import assert from 'node:assert/strict';
import stylelint from 'stylelint';
import config from '../index.js';
describe('flags warnings with border none', () => {
const invalidScss = (
`.borderzero {
border: none;
}
`);
let result;
beforeEach(async () => {
result = await stylelint.lint({
code: invalidScss,
config,
});
});
it('did error', () => {
assert.equal(result.errored, true);
});
it('flags warnings', () => {
assert.equal(result.results[0].warnings.length, 1);
});
it('correct warning text', () => {
assert.deepEqual(
result.results[0].warnings.map((w) => w.text),
[
'Unexpected value "none" for property "border" (declaration-property-value-disallowed-list)',
],
);
});
it('correct rule flagged', () => {
assert.deepEqual(
result.results[0].warnings.map((w) => w.rule),
[
'declaration-property-value-disallowed-list',
],
);
});
});