Skip to content

Commit 56f3533

Browse files
committed
Fix linter things
1 parent 3131828 commit 56f3533

File tree

1 file changed

+144
-148
lines changed

1 file changed

+144
-148
lines changed

test/resolver.js

Lines changed: 144 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -239,64 +239,63 @@ describe('resolver', () => {
239239
})
240240

241241
const DOCUMENT_ORIGINAL = {
242-
"swagger": "2.0",
243-
"paths": {
244-
"/pet": {
245-
"post": {
246-
"tags": [
247-
"pet"
242+
swagger: '2.0',
243+
paths: {
244+
'/pet': {
245+
post: {
246+
tags: [
247+
'pet'
248248
],
249-
"summary": "Add a new pet to the store",
250-
"operationId": "addPet",
251-
"parameters": [
249+
summary: 'Add a new pet to the store',
250+
operationId: 'addPet',
251+
parameters: [
252252
{
253-
"in": "body",
254-
"name": "body",
255-
"description": "Pet object that needs to be added to the store",
256-
"required": true,
257-
"schema": {
258-
"$ref": "#/definitions/Pet"
253+
in: 'body',
254+
name: 'body',
255+
description: 'Pet object that needs to be added to the store',
256+
required: true,
257+
schema: {
258+
$ref: '#/definitions/Pet'
259259
}
260260
}
261261
],
262-
"responses": {
263-
"405": {
264-
"description": "Invalid input"
262+
responses: {
263+
405: {
264+
description: 'Invalid input'
265265
}
266266
}
267267
}
268268
}
269269
},
270-
"definitions": {
271-
"Category": {
272-
"type": "object",
273-
"properties": {
274-
"id": {
275-
"type": "integer",
276-
"format": "int64"
270+
definitions: {
271+
Category: {
272+
type: 'object',
273+
properties: {
274+
id: {
275+
type: 'integer',
276+
format: 'int64'
277277
},
278-
"name": {
279-
"type": "string"
278+
name: {
279+
type: 'string'
280280
}
281281
}
282282
},
283-
"Pet": {
284-
"type": "object",
285-
"required": [
286-
"category"
283+
Pet: {
284+
type: 'object',
285+
required: [
286+
'category'
287287
],
288-
"properties": {
289-
"category": {
290-
"$ref": "#/definitions/Category"
288+
properties: {
289+
category: {
290+
$ref: '#/definitions/Category'
291291
}
292292
}
293293
}
294294
}
295295
}
296296

297-
describe.only('Swagger usage', function() {
297+
describe.only('Swagger usage', function () {
298298
it.skip('should be able to resolve a Swagger document with $refs', () => {
299-
300299
// When
301300
return Swagger.resolve({spec: DOCUMENT_ORIGINAL, allowMetaPatches: false})
302301
.then(handleResponse)
@@ -305,80 +304,80 @@ describe('resolver', () => {
305304
function handleResponse(obj) {
306305
expect(obj.errors).toEqual([])
307306
expect(obj.spec).toEqual({
308-
"swagger": "2.0",
309-
"paths": {
310-
"/pet": {
311-
"post": {
312-
"tags": [
313-
"pet"
307+
swagger: '2.0',
308+
paths: {
309+
'/pet': {
310+
post: {
311+
tags: [
312+
'pet'
314313
],
315-
"summary": "Add a new pet to the store",
316-
"operationId": "addPet",
317-
"__originalOperationId": "addPet",
318-
"parameters": [
314+
summary: 'Add a new pet to the store',
315+
operationId: 'addPet',
316+
__originalOperationId: 'addPet',
317+
parameters: [
319318
{
320-
"in": "body",
321-
"name": "body",
322-
"description": "Pet object that needs to be added to the store",
323-
"required": true,
324-
"schema": {
325-
"type": "object",
326-
"required": [
327-
"category"
319+
in: 'body',
320+
name: 'body',
321+
description: 'Pet object that needs to be added to the store',
322+
required: true,
323+
schema: {
324+
type: 'object',
325+
required: [
326+
'category'
328327
],
329-
"properties": {
330-
"category": {
331-
"type": "object",
332-
"properties": {
333-
"id": {
334-
"type": "integer",
335-
"format": "int64"
328+
properties: {
329+
category: {
330+
type: 'object',
331+
properties: {
332+
id: {
333+
type: 'integer',
334+
format: 'int64'
336335
},
337-
"name": {
338-
"type": "string"
336+
name: {
337+
type: 'string'
339338
}
340339
}
341340
}
342341
}
343342
}
344343
}
345344
],
346-
"responses": {
347-
"405": {
348-
"description": "Invalid input"
345+
responses: {
346+
405: {
347+
description: 'Invalid input'
349348
}
350349
}
351350
}
352351
}
353352
},
354-
"definitions": {
355-
"Category": {
356-
"type": "object",
357-
"properties": {
358-
"id": {
359-
"type": "integer",
360-
"format": "int64"
353+
definitions: {
354+
Category: {
355+
type: 'object',
356+
properties: {
357+
id: {
358+
type: 'integer',
359+
format: 'int64'
361360
},
362-
"name": {
363-
"type": "string"
361+
name: {
362+
type: 'string'
364363
}
365364
}
366365
},
367-
"Pet": {
368-
"type": "object",
369-
"required": [
370-
"category"
366+
Pet: {
367+
type: 'object',
368+
required: [
369+
'category'
371370
],
372-
"properties": {
373-
"category": {
374-
"type": "object",
375-
"properties": {
376-
"id": {
377-
"type": "integer",
378-
"format": "int64"
371+
properties: {
372+
category: {
373+
type: 'object',
374+
properties: {
375+
id: {
376+
type: 'integer',
377+
format: 'int64'
379378
},
380-
"name": {
381-
"type": "string"
379+
name: {
380+
type: 'string'
382381
}
383382
}
384383
}
@@ -390,7 +389,6 @@ describe('resolver', () => {
390389
})
391390

392391
it('should be able to resolve a Swagger document with $refs when allowMetaPatches is enabled', () => {
393-
394392
// When
395393
return Swagger.resolve({spec: DOCUMENT_ORIGINAL, allowMetaPatches: true})
396394
.then(handleResponse)
@@ -399,85 +397,85 @@ describe('resolver', () => {
399397
function handleResponse(obj) {
400398
expect(obj.errors).toEqual([])
401399
expect(obj.spec).toEqual({
402-
"swagger": "2.0",
403-
"paths": {
404-
"/pet": {
405-
"post": {
406-
"tags": [
407-
"pet"
400+
swagger: '2.0',
401+
paths: {
402+
'/pet': {
403+
post: {
404+
tags: [
405+
'pet'
408406
],
409-
"summary": "Add a new pet to the store",
410-
"operationId": "addPet",
411-
"__originalOperationId": "addPet",
412-
"parameters": [
407+
summary: 'Add a new pet to the store',
408+
operationId: 'addPet',
409+
__originalOperationId: 'addPet',
410+
parameters: [
413411
{
414-
"in": "body",
415-
"name": "body",
416-
"description": "Pet object that needs to be added to the store",
417-
"required": true,
418-
"schema": {
419-
"$$ref": "#/definitions/Pet",
420-
"type": "object",
421-
"required": [
422-
"category"
412+
in: 'body',
413+
name: 'body',
414+
description: 'Pet object that needs to be added to the store',
415+
required: true,
416+
schema: {
417+
$$ref: '#/definitions/Pet',
418+
type: 'object',
419+
required: [
420+
'category'
423421
],
424-
"properties": {
425-
"category": {
426-
"$$ref": "#/definitions/Category",
427-
"type": "object",
428-
"properties": {
429-
"id": {
430-
"type": "integer",
431-
"format": "int64"
422+
properties: {
423+
category: {
424+
$$ref: '#/definitions/Category',
425+
type: 'object',
426+
properties: {
427+
id: {
428+
type: 'integer',
429+
format: 'int64'
432430
},
433-
"name": {
434-
"type": "string"
431+
name: {
432+
type: 'string'
435433
}
436434
}
437435
}
438436
}
439437
}
440438
}
441439
],
442-
"responses": {
443-
"405": {
444-
"description": "Invalid input"
440+
responses: {
441+
405: {
442+
description: 'Invalid input'
445443
}
446444
}
447445
}
448446
}
449447
},
450-
"definitions": {
451-
"Category": {
452-
"$$ref": "#/definitions/Category", // FIXME: benign, but this should not be present
453-
"type": "object",
454-
"properties": {
455-
"id": {
456-
"type": "integer",
457-
"format": "int64"
448+
definitions: {
449+
Category: {
450+
$$ref: '#/definitions/Category', // FIXME: benign, but this should not be present
451+
type: 'object',
452+
properties: {
453+
id: {
454+
type: 'integer',
455+
format: 'int64'
458456
},
459-
"name": {
460-
"type": "string"
457+
name: {
458+
type: 'string'
461459
}
462460
}
463461
},
464-
"Pet": {
465-
"$$ref": "#/definitions/Pet",
466-
"type": "object",
467-
"required": [
468-
"category"
462+
Pet: {
463+
$$ref: '#/definitions/Pet',
464+
type: 'object',
465+
required: [
466+
'category'
469467
],
470-
"properties": {
471-
"category": {
472-
"$$ref": "#/definitions/Category", // FIXME: benign, but this should not be present
473-
"type": "object",
474-
"properties": {
475-
"id": {
476-
"type": "integer",
477-
"format": "int64"
468+
properties: {
469+
category: {
470+
$$ref: '#/definitions/Category', // FIXME: benign, but this should not be present
471+
type: 'object',
472+
properties: {
473+
id: {
474+
type: 'integer',
475+
format: 'int64'
478476
},
479-
"name": {
480-
"type": "string"
477+
name: {
478+
type: 'string'
481479
}
482480
}
483481
}
@@ -488,6 +486,4 @@ describe('resolver', () => {
488486
}
489487
})
490488
})
491-
492-
493489
})

0 commit comments

Comments
 (0)