Skip to content

Commit 5d48319

Browse files
authored
test(yaml): Fix code block indents (#35211)
1 parent e746331 commit 5d48319

File tree

1 file changed

+67
-67
lines changed

1 file changed

+67
-67
lines changed

lib/util/yaml.spec.ts

+67-67
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ describe('util/yaml', () => {
1111
it('should parse content with single document', () => {
1212
expect(
1313
parseYaml(codeBlock`
14-
myObject:
15-
aString: value
16-
`),
14+
myObject:
15+
aString: value
16+
`),
1717
).toEqual([
1818
{
1919
myObject: {
@@ -27,9 +27,9 @@ describe('util/yaml', () => {
2727
expect(
2828
parseYaml(
2929
codeBlock`
30-
myObject:
31-
aString: value
32-
`,
30+
myObject:
31+
aString: value
32+
`,
3333
{
3434
customSchema: z.object({
3535
myObject: z.object({
@@ -50,11 +50,11 @@ describe('util/yaml', () => {
5050
it('should parse content with multiple documents', () => {
5151
expect(
5252
parseYaml(codeBlock`
53-
myObject:
54-
aString: value
55-
---
56-
foo: bar
57-
`),
53+
myObject:
54+
aString: value
55+
---
56+
foo: bar
57+
`),
5858
).toEqual([
5959
{
6060
myObject: {
@@ -71,12 +71,12 @@ describe('util/yaml', () => {
7171
expect(
7272
parseYaml(
7373
codeBlock`
74-
myObject:
75-
aString: foo
76-
---
77-
myObject:
78-
aString: bar
79-
`,
74+
myObject:
75+
aString: foo
76+
---
77+
myObject:
78+
aString: bar
79+
`,
8080
{
8181
customSchema: z.object({
8282
myObject: z.object({
@@ -103,11 +103,11 @@ describe('util/yaml', () => {
103103
expect(() =>
104104
parseYaml(
105105
codeBlock`
106-
myObject:
107-
aString: foo
108-
---
109-
aString: bar
110-
`,
106+
myObject:
107+
aString: foo
108+
---
109+
aString: bar
110+
`,
111111
{
112112
customSchema: z.object({
113113
myObject: z.object({
@@ -123,11 +123,11 @@ describe('util/yaml', () => {
123123
expect(() =>
124124
parseYaml(
125125
codeBlock`
126-
myObject:
127-
aString: foo
128-
---
129-
aString: bar
130-
`,
126+
myObject:
127+
aString: foo
128+
---
129+
aString: bar
130+
`,
131131
{
132132
customSchema: z.object({
133133
myObject: z.object({
@@ -144,11 +144,11 @@ describe('util/yaml', () => {
144144
expect(
145145
parseYaml(
146146
codeBlock`
147-
myObject:
148-
aString: foo
149-
---
150-
aString: bar
151-
`,
147+
myObject:
148+
aString: foo
149+
---
150+
aString: bar
151+
`,
152152
{
153153
customSchema: z.object({
154154
myObject: z.object({
@@ -171,11 +171,11 @@ describe('util/yaml', () => {
171171
expect(
172172
parseYaml(
173173
codeBlock`
174-
myObject:
175-
aString: {{ value }}
176-
---
177-
foo: {{ foo.bar }}
178-
`,
174+
myObject:
175+
aString: {{ value }}
176+
---
177+
foo: {{ foo.bar }}
178+
`,
179179
{ removeTemplates: true },
180180
),
181181
).toEqual([
@@ -199,9 +199,9 @@ describe('util/yaml', () => {
199199
it('should parse content with single document', () => {
200200
expect(
201201
parseSingleYaml(codeBlock`
202-
myObject:
203-
aString: value
204-
`),
202+
myObject:
203+
aString: value
204+
`),
205205
).toEqual({
206206
myObject: {
207207
aString: 'value',
@@ -212,13 +212,13 @@ describe('util/yaml', () => {
212212
it('should parse invalid content using strict=false', () => {
213213
expect(
214214
parseSingleYaml(codeBlock`
215-
version: '2.1'
215+
version: '2.1'
216216
217-
services:
218-
rtl_433:
219-
image: ubuntu:oracular-20240918
220-
# inserting a space before the hash on the next line makes Renovate work.
221-
command: "echo some text"# a comment
217+
services:
218+
rtl_433:
219+
image: ubuntu:oracular-20240918
220+
# inserting a space before the hash on the next line makes Renovate work.
221+
command: "echo some text"# a comment
222222
`),
223223
).not.toBeNull();
224224
});
@@ -227,9 +227,9 @@ services:
227227
expect(
228228
parseSingleYaml(
229229
codeBlock`
230-
myObject:
231-
aString: value
232-
`,
230+
myObject:
231+
aString: value
232+
`,
233233
{
234234
customSchema: z.object({
235235
myObject: z.object({
@@ -249,8 +249,8 @@ services:
249249
expect(() =>
250250
parseSingleYaml(
251251
codeBlock`
252-
myObject: foo
253-
`,
252+
myObject: foo
253+
`,
254254
{
255255
customSchema: z.object({
256256
myObject: z.object({
@@ -265,25 +265,25 @@ services:
265265
it('should parse content with multiple documents', () => {
266266
expect(() =>
267267
parseSingleYaml(codeBlock`
268-
myObject:
269-
aString: value
270-
---
271-
foo: bar
272-
`),
268+
myObject:
269+
aString: value
270+
---
271+
foo: bar
272+
`),
273273
).toThrow();
274274
});
275275

276276
it('should parse content with template', () => {
277277
expect(
278278
parseSingleYaml(
279279
codeBlock`
280-
myObject:
281-
aString: {{value}}
282-
{% if test.enabled %}
283-
myNestedObject:
284-
aNestedString: {{value}}
285-
{% endif %}
286-
`,
280+
myObject:
281+
aString: {{value}}
282+
{% if test.enabled %}
283+
myNestedObject:
284+
aNestedString: {{value}}
285+
{% endif %}
286+
`,
287287
{ removeTemplates: true },
288288
),
289289
).toEqual({
@@ -300,10 +300,10 @@ services:
300300
expect(
301301
parseSingleYaml(
302302
codeBlock`
303-
myObject:
304-
aString: value
305-
aStringWithTag: !reset null
306-
`,
303+
myObject:
304+
aString: value
305+
aStringWithTag: !reset null
306+
`,
307307
{ removeTemplates: true },
308308
),
309309
).toEqual({

0 commit comments

Comments
 (0)