Skip to content

Commit f210cbc

Browse files
committed
updat e2e test snapshots
1 parent 44ab34a commit f210cbc

37 files changed

+261
-269
lines changed

src/utils/stylelint/formatting-options-to-rules.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type LSP from 'vscode-languageserver-protocol';
22

33
export type FormattingRules = {
4-
indentation: [number | string];
4+
indentation?: [number | string];
55
'no-missing-end-of-source-newline'?: true | null;
66
'no-eol-whitespace'?: true | null;
77
};

test/e2e/__tests__/__snapshots__/code-actions.ts.snap

+39-53
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,28 @@
22

33
exports[`Code actions should disable rules for a specific line with a comment on the previous line 1`] = `
44
"a {
5-
/* stylelint-disable-next-line indentation */
6-
font-size: 1.2em;
7-
/* stylelint-disable-next-line comment-no-empty */
5+
/* stylelint-disable-next-line value-keyword-case */
6+
display: BLOCK;
7+
/* stylelint-disable-next-line comment-no-empty */
88
color: #00;
99
}
1010
"
1111
`;
1212

1313
exports[`Code actions should disable rules for a specific line with a comment on the same line 1`] = `
1414
"a {
15-
font-size: 1.2em; /* stylelint-disable-line indentation */
16-
/* stylelint-disable-next-line comment-no-empty */
15+
display: BLOCK; /* stylelint-disable-line value-keyword-case */
16+
/* stylelint-disable-next-line comment-no-empty */
1717
color: #00;
1818
}
1919
"
2020
`;
2121

22-
exports[`Code actions should disable rules for a specific line with a comment on the same line 2`] = `
23-
"#!/usr/bin/env node
24-
/* stylelint-disable color-no-invalid-hex */
25-
/* eslint-disable node/shebang */
26-
'use strict';
27-
28-
const css = css\`
29-
.foo {
30-
color: #00;
31-
}
32-
\`;
33-
"
34-
`;
35-
3622
exports[`Code actions should disable rules for an entire file 1`] = `
37-
"/* stylelint-disable indentation */
23+
"/* stylelint-disable value-keyword-case */
3824
a {
39-
font-size: 1.2em;
40-
/* stylelint-disable-next-line comment-no-empty */
25+
display: BLOCK;
26+
/* stylelint-disable-next-line comment-no-empty */
4127
color: #00;
4228
}
4329
"
@@ -58,22 +44,22 @@ const css = css\`
5844
`;
5945

6046
exports[`Code actions should provide code actions for problems 1`] = `
61-
Array [
62-
Object {
63-
"edit": Array [
64-
Array [
47+
[
48+
{
49+
"edit": [
50+
[
6551
"<uri>",
66-
Array [
67-
Object {
52+
[
53+
{
6854
"newEol": undefined,
69-
"newText": " /* stylelint-disable-next-line indentation */
55+
"newText": " /* stylelint-disable-next-line value-keyword-case */
7056
",
71-
"range": Array [
72-
Object {
57+
"range": [
58+
{
7359
"character": 0,
7460
"line": 1,
7561
},
76-
Object {
62+
{
7763
"character": 0,
7864
"line": 1,
7965
},
@@ -86,23 +72,23 @@ Array [
8672
"kind": _ {
8773
"value": "quickfix",
8874
},
89-
"title": "Disable indentation for this line",
75+
"title": "Disable value-keyword-case for this line",
9076
},
91-
Object {
92-
"edit": Array [
93-
Array [
77+
{
78+
"edit": [
79+
[
9480
"<uri>",
95-
Array [
96-
Object {
81+
[
82+
{
9783
"newEol": undefined,
98-
"newText": "/* stylelint-disable indentation */
84+
"newText": "/* stylelint-disable value-keyword-case */
9985
",
100-
"range": Array [
101-
Object {
86+
"range": [
87+
{
10288
"character": 0,
10389
"line": 0,
10490
},
105-
Object {
91+
{
10692
"character": 0,
10793
"line": 0,
10894
},
@@ -115,32 +101,32 @@ Array [
115101
"kind": _ {
116102
"value": "quickfix",
117103
},
118-
"title": "Disable indentation for the entire file",
104+
"title": "Disable value-keyword-case for the entire file",
119105
},
120-
Object {
121-
"command": Object {
122-
"arguments": Array [
123-
Object {
124-
"uri": "https://stylelint.io/user-guide/rules/indentation",
106+
{
107+
"command": {
108+
"arguments": [
109+
{
110+
"uri": "https://stylelint.io/user-guide/rules/value-keyword-case",
125111
},
126112
],
127113
"command": "stylelint.openRuleDoc",
128-
"title": "Open documentation for indentation",
114+
"title": "Open documentation for value-keyword-case",
129115
},
130116
"isPreferred": undefined,
131117
"kind": _ {
132118
"value": "quickfix",
133119
},
134-
"title": "Show documentation for indentation",
120+
"title": "Show documentation for value-keyword-case",
135121
},
136122
]
137123
`;
138124

139125
exports[`Code actions should run auto-fix action on save 1`] = `
140126
"a {
141-
font-size: 1.2em;
142-
/* stylelint-disable-next-line comment-no-empty */
143-
color: #00;
127+
display: block;
128+
/* stylelint-disable-next-line comment-no-empty */
129+
color: #00;
144130
}
145131
"
146132
`;

test/e2e/__tests__/__snapshots__/config-basedir.ts.snap

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`"stylelint.configBasedir" setting should resolve referenced configs using the base directory 1`] = `
4-
Array [
5-
Object {
6-
"code": "color-hex-case",
7-
"codeDescription": Object {
8-
"href": "https://stylelint.io/user-guide/rules/color-hex-case",
4+
[
5+
{
6+
"code": "color-hex-alpha",
7+
"codeDescription": {
8+
"href": "https://stylelint.io/user-guide/rules/color-hex-alpha",
99
},
10-
"message": "Expected \\"#fff\\" to be \\"#FFF\\" (color-hex-case)",
11-
"range": Object {
12-
"end": Object {
13-
"character": 10,
10+
"message": "Expected alpha channel in "#fff" (color-hex-alpha)",
11+
"range": {
12+
"end": {
13+
"character": 13,
1414
"line": 1,
1515
},
16-
"start": Object {
16+
"start": {
1717
"character": 9,
1818
"line": 1,
1919
},
2020
},
2121
"severity": 1,
2222
"source": "Stylelint",
2323
},
24-
Object {
25-
"code": "indentation",
26-
"codeDescription": Object {
27-
"href": "https://stylelint.io/user-guide/rules/indentation",
24+
{
25+
"code": "color-hex-length",
26+
"codeDescription": {
27+
"href": "https://stylelint.io/user-guide/rules/color-hex-length",
2828
},
29-
"message": "Expected indentation of 8 spaces (indentation)",
30-
"range": Object {
31-
"end": Object {
32-
"character": 14,
29+
"message": "Expected "#fff" to be "#ffffff" (color-hex-length)",
30+
"range": {
31+
"end": {
32+
"character": 13,
3333
"line": 1,
3434
},
35-
"start": Object {
36-
"character": 2,
35+
"start": {
36+
"character": 9,
3737
"line": 1,
3838
},
3939
},

test/e2e/__tests__/__snapshots__/config-file.ts.snap

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`"stylelint.configFile" setting should resolve the config file using the specified path 1`] = `
4-
Array [
5-
Object {
4+
[
5+
{
66
"code": "block-no-empty",
7-
"codeDescription": Object {
7+
"codeDescription": {
88
"href": "https://stylelint.io/user-guide/rules/block-no-empty",
99
},
1010
"message": "Unexpected empty block (block-no-empty)",
11-
"range": Object {
12-
"end": Object {
11+
"range": {
12+
"end": {
1313
"character": 4,
1414
"line": 0,
1515
},
16-
"start": Object {
16+
"start": {
1717
"character": 2,
1818
"line": 0,
1919
},

test/e2e/__tests__/__snapshots__/custom-syntax.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
exports[`"stylelint.customSyntax" setting should auto-fix using the specified custom syntax 1`] = `
44
"/* prettier-ignore */
55
.foo .bar
6-
color: red"
6+
color: rgb(0 0 0)"
77
`;

test/e2e/__tests__/__snapshots__/ignore-disables.ts.snap

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`"stylelint.ignoreDisables" setting should ignore disable directives when enabled 1`] = `
4-
Array [
5-
Object {
6-
"code": "color-hex-case",
7-
"codeDescription": Object {
8-
"href": "https://stylelint.io/user-guide/rules/color-hex-case",
4+
[
5+
{
6+
"code": "color-hex-length",
7+
"codeDescription": {
8+
"href": "https://stylelint.io/user-guide/rules/color-hex-length",
99
},
10-
"message": "Expected \\"#fff\\" to be \\"#FFF\\" (color-hex-case)",
11-
"range": Object {
12-
"end": Object {
13-
"character": 10,
14-
"line": 3,
10+
"message": "Expected "#fff" to be "#ffffff" (color-hex-length)",
11+
"range": {
12+
"end": {
13+
"character": 18,
14+
"line": 2,
1515
},
16-
"start": Object {
17-
"character": 9,
18-
"line": 3,
16+
"start": {
17+
"character": 14,
18+
"line": 2,
1919
},
2020
},
2121
"severity": 1,
2222
"source": "Stylelint",
2323
},
24-
Object {
25-
"code": "indentation",
26-
"codeDescription": Object {
27-
"href": "https://stylelint.io/user-guide/rules/indentation",
24+
{
25+
"code": "function-name-case",
26+
"codeDescription": {
27+
"href": "https://stylelint.io/user-guide/rules/function-name-case",
2828
},
29-
"message": "Expected indentation of 4 spaces (indentation)",
30-
"range": Object {
31-
"end": Object {
32-
"character": 14,
33-
"line": 3,
29+
"message": "Expected "RGB" to be "rgb" (function-name-case)",
30+
"range": {
31+
"end": {
32+
"character": 23,
33+
"line": 2,
3434
},
35-
"start": Object {
36-
"character": 2,
37-
"line": 3,
35+
"start": {
36+
"character": 20,
37+
"line": 2,
3838
},
3939
},
4040
"severity": 1,

0 commit comments

Comments
 (0)