Skip to content

Commit

Permalink
chore: run eslint fix / prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Oct 9, 2020
1 parent d08bfce commit 275716b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/ajv/src/pipes/AjvValidationPipe.spec.ts
Expand Up @@ -58,7 +58,7 @@ describe("AjvValidationPipe", () => {

const error = await validate(value, ParamMetadata.get(Ctrl, "get", 0));

expect(error?.message).to.deep.equal("Bad request on parameter \"request.body\".\nValue should be object. Given value: []");
expect(error?.message).to.deep.equal('Bad request on parameter "request.body".\nValue should be object. Given value: []');
expect(error?.origin?.errors).to.deep.equal([
{
data: [],
Expand Down
Expand Up @@ -13,7 +13,7 @@ describe("ParseExpressionError", () => {
} as any,
{message: "message"}
);
expect(error.message).to.equal("Bad request on parameter \"request.name.expression\".\nmessage");
expect(error.message).to.equal('Bad request on parameter "request.name.expression".\nmessage');
expect(error.name).to.equal("PARAM_VALIDATION_ERROR");
expect(error.dataPath).to.equal("expression");
expect(error.requestType).to.equal("name");
Expand Down Expand Up @@ -80,7 +80,7 @@ describe("ParseExpressionError", () => {
]);

const error = ParamValidationError.from(metadata, origin);
expect(error.message).to.equal("Bad request on parameter \"request.name.expression\".\nIt should have 1 item");
expect(error.message).to.equal('Bad request on parameter "request.name.expression".\nIt should have 1 item');
expect(error.dataPath).to.equal("expression");
expect(error.requestType).to.equal("name");

Expand Down
Expand Up @@ -18,7 +18,7 @@ describe("PassportSerializerService", () => {

const result = await new Promise((resolve) => service.serialize(userInfo, (...args: any[]) => resolve(args)));

expect(result).to.deep.eq([null, "{\"id\":\"id\",\"email\":\"email@email.fr\"}"]);
expect(result).to.deep.eq([null, '{"id":"id","email":"email@email.fr"}']);
})
);

Expand Down Expand Up @@ -48,7 +48,7 @@ describe("PassportSerializerService", () => {
"should deserialize model",
PlatformTest.inject([PassportSerializerService], async (service: PassportSerializerService) => {
const result = await new Promise((resolve) =>
service.deserialize("{\"id\":\"id\",\"email\":\"email@email.fr\"}", (...args: any[]) => resolve(args))
service.deserialize('{"id":"id","email":"email@email.fr"}', (...args: any[]) => resolve(args))
);

expect(result).to.deep.eq([
Expand All @@ -72,7 +72,7 @@ describe("PassportSerializerService", () => {
});

const result = await new Promise((resolve) =>
service.deserialize("{\"id\":\"id\",\"email\":\"email@email.fr\"}", (...args: any[]) => resolve(args))
service.deserialize('{"id":"id","email":"email@email.fr"}', (...args: any[]) => resolve(args))
);

expect(result).to.deep.eq([error]);
Expand Down
8 changes: 1 addition & 7 deletions packages/platform-express/src/index.ts
@@ -1,10 +1,4 @@
import {
createExpressApplication,
createHttpServer,
createHttpsServer,
ExpressApplication,
PlatformTest
} from "@tsed/common";
import {createExpressApplication, createHttpServer, createHttpsServer, ExpressApplication, PlatformTest} from "@tsed/common";

import {PlatformExpress} from "./components/PlatformExpress";

Expand Down
4 changes: 2 additions & 2 deletions packages/platform-test-utils/src/tests/testAcceptMime.ts
Expand Up @@ -30,7 +30,7 @@ export function testAcceptMime(options: PlatformTestOptions) {
});
after(PlatformTest.reset);
describe("Scenario 1: POST /rest/accept-mime/scenario-1", () => {
it("should return a 200 response when Accept header match with @AcceptMime(\"application/json\")", async () => {
it('should return a 200 response when Accept header match with @AcceptMime("application/json")', async () => {
const response = await request
.post("/rest/accept-mime/scenario-1")
.set({
Expand All @@ -42,7 +42,7 @@ export function testAcceptMime(options: PlatformTestOptions) {
accept: "application/json"
});
});
it("should return a 406 response when Accept header doesn't match with @AcceptMime(\"application/json\")", async () => {
it('should return a 406 response when Accept header doesn\'t match with @AcceptMime("application/json")', async () => {
const response = await request
.post("/rest/accept-mime/scenario-1")
.set({
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-test-utils/src/tests/testErrors.ts
Expand Up @@ -142,7 +142,7 @@ export function testErrors(options: PlatformTestOptions) {
const response: any = await request.post("/rest/errors/scenario-5").expect(400);

expect(response.text).to.deep.eq(
"Bad request on parameter \"request.body\".<br />CustomModel should have required property 'name'. Given value: \"undefined\""
'Bad request on parameter "request.body".<br />CustomModel should have required property \'name\'. Given value: "undefined"'
);
// expect(response.body).to.deep.eq({
// "name": "AJV_VALIDATION_ERROR",
Expand All @@ -163,7 +163,7 @@ export function testErrors(options: PlatformTestOptions) {
const response: any = await request.post(`/rest/errors/scenario-6`).send({}).expect(400);

expect(response.text).to.deep.eq(
"Bad request on parameter \"request.body\".<br />CustomPropModel should have required property 'role_item'. Given value: \"undefined\""
'Bad request on parameter "request.body".<br />CustomPropModel should have required property \'role_item\'. Given value: "undefined"'
);
});
}
2 changes: 1 addition & 1 deletion packages/platform-test-utils/src/tests/testQueryParams.ts
Expand Up @@ -136,7 +136,7 @@ export function testQueryParams(options: PlatformTestOptions) {
const response = await request.get(`${endpoint}?test=error`).expect(400);
// FIXME REMOVE THIS when @tsed/schema is out
expect(response.text).to.deep.equal(
"Bad request on parameter \"request.query.test\".<br />Cast error. Expression value is not a number."
'Bad request on parameter "request.query.test".<br />Cast error. Expression value is not a number.'
);
});
it("should return undefined when query is empty", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-test-utils/src/tests/testResponse.ts
Expand Up @@ -263,7 +263,7 @@ export function testResponse(options: PlatformTestOptions) {
it("should throw a badRequest when path params isn't set as number", async () => {
const response = await request.get("/rest/response/scenario9/kkk").expect(400);

expect(response.text).to.equal("Bad request on parameter \"request.path.id\".<br />Cast error. Expression value is not a number.");
expect(response.text).to.equal('Bad request on parameter "request.path.id".<br />Cast error. Expression value is not a number.');
});
});
});
Expand Down
4 changes: 1 addition & 3 deletions packages/swagger/test/swagger.integration.spec.ts
Expand Up @@ -176,9 +176,7 @@ describe("Swagger integration", () => {
}
}
],
produces: [
"text/plain"
],
produces: ["text/plain"],
responses: {
"200": {
description: "Success"
Expand Down

0 comments on commit 275716b

Please sign in to comment.