Autofix ESLint problems

This commit is contained in:
Kyle Shockey
2017-03-22 20:40:05 -07:00
parent 664e44d3d9
commit f195d01184
11 changed files with 35 additions and 35 deletions

View File

@@ -21,7 +21,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://example.com -H "Accept: application/json" -H "content-type: application/json" -d {"id":0,"name":"doggie","status":"available"}')
expect(curlified).toEqual("curl -X POST http://example.com -H \"Accept: application/json\" -H \"content-type: application/json\" -d {\"id\":0,\"name\":\"doggie\",\"status\":\"available\"}")
})
it("does not change the case of header in curl", function() {
@@ -35,7 +35,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://example.com -H "conTenT Type: application/Moar"')
expect(curlified).toEqual("curl -X POST http://example.com -H \"conTenT Type: application/Moar\"")
})
it("prints a curl statement with an array of query params", function() {
@@ -46,7 +46,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith')
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith")
})
it("prints a curl statement with an array of query params and auth", function() {
@@ -60,7 +60,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "authorization: Basic Zm9vOmJhcg=="')
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"authorization: Basic Zm9vOmJhcg==\"")
})
it("prints a curl statement with html", function() {
@@ -71,13 +71,13 @@ describe("curlify", function() {
accept: "application/json"
},
body: {
description: '<b>Test</b>'
description: "<b>Test</b>"
}
}
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
expect(curlified).toEqual("curl -X GET http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
})
it("handles post body with html", function() {
@@ -88,13 +88,13 @@ describe("curlify", function() {
accept: "application/json"
},
body: {
description: '<b>Test</b>'
description: "<b>Test</b>"
}
}
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H "accept: application/json" -d {"description":"<b>Test</b>"}')
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -H \"accept: application/json\" -d {\"description\":\"<b>Test</b>\"}")
})
it("handles post body with special chars", function() {
@@ -102,14 +102,14 @@ describe("curlify", function() {
url: "http://swaggerhub.com/v1/one?name=john|smith",
method: "POST",
body: {
description: '@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n' +
'@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .'
description: "@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .\n" +
"@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."
}
}
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {"description":"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> ."}')
expect(curlified).toEqual("curl -X POST http://swaggerhub.com/v1/one?name=john|smith -d {\"description\":\"@prefix nif:<http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .@prefix itsrdf: <http://www.w3.org/2005/11/its/rdf#> .\"}")
})
it("handles delete form with parameters", function() {
@@ -123,7 +123,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X DELETE http://example.com -H "accept: application/x-www-form-urlencoded"')
expect(curlified).toEqual("curl -X DELETE http://example.com -H \"accept: application/x-www-form-urlencoded\"")
})
it("should print a curl with formData", function() {
@@ -136,7 +136,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://example.com -H "content-type: multipart/form-data" -F id=123 -F name=Sahar')
expect(curlified).toEqual("curl -X POST http://example.com -H \"content-type: multipart/form-data\" -F id=123 -F name=Sahar")
})
it("prints a curl post statement from an object", function() {
@@ -153,7 +153,7 @@ describe("curlify", function() {
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d {"id":10101}')
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d {\"id\":10101}")
})
it("prints a curl post statement from a string containing a single quote", function() {
@@ -163,12 +163,12 @@ describe("curlify", function() {
headers: {
accept: "application/json"
},
body: '{"id":"foo\'bar"}'
body: "{\"id\":\"foo'bar\"}"
}
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual('curl -X POST http://example.com -H "accept: application/json" -d "{\\"id\\":\\"foo\'bar\\"}"')
expect(curlified).toEqual("curl -X POST http://example.com -H \"accept: application/json\" -d \"{\\\"id\\\":\\\"foo'bar\\\"}\"")
})
})