Skip to content

Commit a4e791b

Browse files
author
Limon Monte
committed
be more specific in test description
1 parent 924f34b commit a4e791b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"dependencies": {
1818
"stylelint-config-property-sort-order-smacss": "^5.0.0",
1919
"stylelint-config-standard": "^18.3.0",
20-
"stylelint-order": "^3.0.0",
2120
"stylelint-scss": "^3.9.0"
2221
},
2322
"devDependencies": {

test/index.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ const assert = require('assert').strict
44

55
const config = require('../index.js')
66

7-
test('stylelint configuration', async () => {
7+
test('declaration-block-single-line-max-declarations (stylelint-config-standard)', async () => {
88
const output = await stylelint.lint({
9-
code: "a { color: red; top: 0; }",
9+
code: 'a { top: 0; color: red; }\n',
1010
config,
1111
})
1212

13+
assert.strictEqual(output.results[0].warnings.length, 1)
14+
assert.strictEqual(output.results[0].warnings[0].text.trim(), 'Expected no more than 1 declaration (declaration-block-single-line-max-declarations)')
15+
})
16+
17+
test('order/properties-order (stylelint-config-property-sort-order-smacss)', async () => {
18+
const output = await stylelint.lint({
19+
code:
20+
'a {\n' +
21+
' color: red;\n' +
22+
' top: 0;\n' +
23+
'}\n',
24+
config,
25+
})
26+
27+
assert.strictEqual(output.results[0].warnings.length, 1)
1328
assert.strictEqual(output.results[0].warnings[0].text.trim(), 'Expected "top" to come before "color" (order/properties-order)')
14-
assert.strictEqual(output.results[0].warnings[1].text.trim(), 'Expected no more than 1 declaration (declaration-block-single-line-max-declarations)')
15-
assert.strictEqual(output.results[0].warnings[2].text.trim(), 'Unexpected missing end-of-source newline (no-missing-end-of-source-newline)')
1629
})

0 commit comments

Comments
 (0)