@@ -45,6 +45,7 @@ describe('rdme docs upload', () => {
45
45
. reply ( 201 , { } ) ;
46
46
47
47
const result = await run ( [ '__tests__/__fixtures__/docs/new-docs/new-doc.md' , '--key' , key ] ) ;
48
+
48
49
expect ( result ) . toMatchSnapshot ( ) ;
49
50
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
50
51
@@ -64,6 +65,7 @@ describe('rdme docs upload', () => {
64
65
. reply ( 201 , { } ) ;
65
66
66
67
const result = await run ( [ '__tests__/__fixtures__/docs/new-docs/new-doc.md' , '--key' , key , '--version' , '1.2.3' ] ) ;
68
+
67
69
expect ( result ) . toMatchSnapshot ( ) ;
68
70
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
69
71
@@ -75,6 +77,7 @@ describe('rdme docs upload', () => {
75
77
const mock = getAPIv2Mock ( { authorization } ) . head ( '/versions/stable/guides/new-doc' ) . reply ( 404 ) ;
76
78
77
79
const result = await run ( [ '__tests__/__fixtures__/docs/new-docs/new-doc.md' , '--key' , key , '--dry-run' ] ) ;
80
+
78
81
expect ( result ) . toMatchSnapshot ( ) ;
79
82
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
80
83
@@ -85,6 +88,7 @@ describe('rdme docs upload', () => {
85
88
const mock = getAPIv2Mock ( { authorization } ) . head ( '/versions/stable/guides/some-slug' ) . reply ( 200 ) ;
86
89
87
90
const result = await run ( [ '__tests__/__fixtures__/docs/slug-docs/new-doc-slug.md' , '--key' , key , '--dry-run' ] ) ;
91
+
88
92
expect ( result ) . toMatchSnapshot ( ) ;
89
93
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
90
94
@@ -95,6 +99,7 @@ describe('rdme docs upload', () => {
95
99
const mock = getAPIv2Mock ( { authorization } ) . head ( '/versions/stable/guides/some-slug' ) . reply ( 500 ) ;
96
100
97
101
const result = await run ( [ '__tests__/__fixtures__/docs/slug-docs/new-doc-slug.md' , '--key' , key , '--dry-run' ] ) ;
102
+
98
103
expect ( result ) . toMatchSnapshot ( ) ;
99
104
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
100
105
@@ -116,6 +121,7 @@ describe('rdme docs upload', () => {
116
121
. reply ( 201 , { } ) ;
117
122
118
123
const result = await run ( [ '__tests__/__fixtures__/docs/slug-docs/new-doc-slug.md' , '--key' , key ] ) ;
124
+
119
125
expect ( result ) . toMatchSnapshot ( ) ;
120
126
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
121
127
@@ -134,6 +140,7 @@ describe('rdme docs upload', () => {
134
140
. reply ( 201 , { } ) ;
135
141
136
142
const result = await run ( [ '__tests__/__fixtures__/docs/slug-docs/new-doc-slug.md' , '--key' , key ] ) ;
143
+
137
144
expect ( result ) . toMatchSnapshot ( ) ;
138
145
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
139
146
@@ -157,6 +164,7 @@ describe('rdme docs upload', () => {
157
164
prompts . inject ( [ true ] ) ;
158
165
159
166
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' , '--key' , key ] ) ;
167
+
160
168
expect ( result ) . toMatchSnapshot ( ) ;
161
169
expect ( fs . writeFileSync ) . toHaveBeenCalledWith (
162
170
'__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' ,
@@ -190,6 +198,7 @@ describe('rdme docs upload', () => {
190
198
prompts . inject ( [ true ] ) ;
191
199
192
200
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' , '--key' , key ] ) ;
201
+
193
202
expect ( result ) . toMatchSnapshot ( ) ;
194
203
expect ( fs . writeFileSync ) . toHaveBeenCalledWith (
195
204
'__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' ,
@@ -205,6 +214,7 @@ describe('rdme docs upload', () => {
205
214
prompts . inject ( [ false ] ) ;
206
215
207
216
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' , '--key' , key ] ) ;
217
+
208
218
expect ( result ) . toMatchSnapshot ( ) ;
209
219
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
210
220
} ) ;
@@ -227,6 +237,7 @@ describe('rdme docs upload', () => {
227
237
key ,
228
238
'--skip-validation' ,
229
239
] ) ;
240
+
230
241
expect ( result ) . toMatchSnapshot ( ) ;
231
242
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
232
243
@@ -249,6 +260,7 @@ describe('rdme docs upload', () => {
249
260
. reply ( 201 , { } ) ;
250
261
251
262
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs/invalid-attributes.md' , '--key' , key ] ) ;
263
+
252
264
expect ( result ) . toMatchSnapshot ( ) ;
253
265
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
254
266
@@ -278,6 +290,7 @@ describe('rdme docs upload', () => {
278
290
. reply ( 201 , { } ) ;
279
291
280
292
const result = await run ( [ '__tests__/__fixtures__/docs/new-docs/new-doc.md' , '--key' , key ] ) ;
293
+
281
294
expect ( result ) . toMatchSnapshot ( ) ;
282
295
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
283
296
@@ -287,6 +300,7 @@ describe('rdme docs upload', () => {
287
300
288
301
it ( 'should error out if the file has validation errors' , async ( ) => {
289
302
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs/legacy-category.md' , '--key' , key ] ) ;
303
+
290
304
expect ( result ) . toMatchSnapshot ( ) ;
291
305
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
292
306
} ) ;
@@ -296,6 +310,7 @@ describe('rdme docs upload', () => {
296
310
const mock = getAPIv2Mock ( { authorization } ) . head ( '/versions/stable/guides/new-doc' ) . reply ( 500 ) ;
297
311
298
312
const result = await run ( [ '__tests__/__fixtures__/docs/new-docs/new-doc.md' , '--key' , key ] ) ;
313
+
299
314
expect ( result ) . toMatchSnapshot ( ) ;
300
315
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
301
316
@@ -304,12 +319,14 @@ describe('rdme docs upload', () => {
304
319
305
320
it ( 'should error out if the file does not exist' , async ( ) => {
306
321
const result = await run ( [ 'non-existent-file' , '--key' , key ] ) ;
322
+
307
323
expect ( result ) . toMatchSnapshot ( ) ;
308
324
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
309
325
} ) ;
310
326
311
327
it ( 'should error out if the file has an invalid file extension' , async ( ) => {
312
328
const result = await run ( [ 'package.json' , '--key' , key ] ) ;
329
+
313
330
expect ( result ) . toMatchSnapshot ( ) ;
314
331
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
315
332
} ) ;
@@ -337,6 +354,7 @@ describe('rdme docs upload', () => {
337
354
. reply ( 201 , { } ) ;
338
355
339
356
const result = await run ( [ '__tests__/__fixtures__/docs/existing-docs' , '--key' , key ] ) ;
357
+
340
358
expect ( result ) . toMatchSnapshot ( ) ;
341
359
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
342
360
@@ -362,6 +380,7 @@ describe('rdme docs upload', () => {
362
380
. reply ( 201 , { } ) ;
363
381
364
382
const result = await run ( [ '__tests__/__fixtures__/docs/existing-docs' , '--key' , key ] ) ;
383
+
365
384
expect ( result ) . toMatchSnapshot ( ) ;
366
385
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
367
386
@@ -407,6 +426,7 @@ describe('rdme docs upload', () => {
407
426
. reply ( 201 , { } ) ;
408
427
409
428
const result = await run ( [ '__tests__/__fixtures__/docs/multiple-docs' , '--key' , key ] ) ;
429
+
410
430
expect ( result ) . toMatchSnapshot ( ) ;
411
431
expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( ) ;
412
432
@@ -416,6 +436,7 @@ describe('rdme docs upload', () => {
416
436
417
437
it ( 'should error out if the directory does not contain any Markdown files' , async ( ) => {
418
438
const result = await run ( [ '__tests__/__fixtures__/ref-oas' , '--key' , key ] ) ;
439
+
419
440
expect ( result ) . toMatchSnapshot ( ) ;
420
441
} ) ;
421
442
@@ -459,6 +480,7 @@ describe('rdme docs upload', () => {
459
480
prompts . inject ( [ true ] ) ;
460
481
461
482
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs' , '--key' , key ] ) ;
483
+
462
484
expect ( result ) . toMatchSnapshot ( ) ;
463
485
expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 5 ) ;
464
486
@@ -479,6 +501,7 @@ describe('rdme docs upload', () => {
479
501
prompts . inject ( [ true ] ) ;
480
502
481
503
const result = await run ( [ '__tests__/__fixtures__/docs/mixed-docs' , '--key' , key , '--dry-run' ] ) ;
504
+
482
505
expect ( result ) . toMatchSnapshot ( ) ;
483
506
expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 5 ) ;
484
507
0 commit comments