Skip to content

Commit

Permalink
fix: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Coobaha committed Jul 14, 2021
1 parent 222e21b commit 584c73e
Show file tree
Hide file tree
Showing 6 changed files with 1,074 additions and 1,092 deletions.
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@
"dependencies": {
"crypto-js": "^4.0.0",
"escape-string-regexp": "^4.0.0",
"glob": "^7.1.6",
"glob": "^7.1.7",
"json-schema-merge-allof": "^0.8.1",
"json-schema-traverse": "^1.0.0",
"typescript-json-schema": "^0.49.0",
"yargs": "^16.2.0"
"typescript-json-schema": "^0.50.1",
"yargs": "^17.0.1"
},
"devDependencies": {
"@types/crypto-js": "^4.0.1",
"@types/glob": "^7.1.3",
"@types/json-schema-merge-allof": "^0.6.0",
"@types/node": "^14.14.31",
"@types/prettier": "^2.2.1",
"@types/split2": "^2.1.6",
"@types/tap": "^14.10.2",
"@types/yargs": "^16.0.0",
"fastify": "^3.12.0",
"@types/crypto-js": "^4.0.2",
"@types/glob": "^7.1.4",
"@types/json-schema-merge-allof": "^0.6.1",
"@types/node": "^16.3.2",
"@types/prettier": "^2.3.2",
"@types/split2": "^3.2.1",
"@types/tap": "^15.0.5",
"@types/yargs": "^17.0.2",
"fastify": "^3.19.1",
"husky": "^5.1.1",
"lint-staged": "^10.5.4",
"lint-staged": "^11.0.1",
"pinst": "^2.1.6",
"prettier": "^2.2.1",
"prettier": "^2.3.2",
"split2": "^3.2.2",
"syncpack": "^5.7.11",
"tap": "^14.11.0",
"tsd": "^0.14.0",
"type-fest": "^0.21.2",
"typescript": "^4.2.2"
"tap": "^15.0.9",
"ts-node-dev": "^1.1.8",
"tsd": "^0.17.0",
"type-fest": "^1.2.2",
"typescript": "^4.3.5"
},
"directories": {
"test": "test/",
Expand Down Expand Up @@ -70,9 +71,9 @@
"postinstall": "husky install",
"postpublish": "pinst --enable",
"prepublishOnly": "pinst --disable",
"pretest": "ts-node generator/gen.bin.ts gen 'test/test_schema.ts'",
"pretest": "tsnd generator/gen.bin.ts gen 'test/test_schema.ts'",
"test": "yarn test:types && yarn test:integration",
"test:integration": "tap test/*.test.ts -R terse",
"test:integration": "TAP_TS=1 tap test/*.test.ts -R terse --no-check-coverage",
"test:types": "tsc -p test/tsconfig.test.json"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/integration.test.ts TAP GET /empty works > request path:GET /empty id:1 1`] = `
exports[`test/integration.test.ts TAP GET /empty works > request path:GET /empty id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand All @@ -20,7 +20,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP GET /empty works > response path:GET /empty id:1 1`] = `
exports[`test/integration.test.ts TAP GET /empty works > response path:GET /empty id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 204 No Content",
Expand Down Expand Up @@ -56,7 +56,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / rejects invalid payload > request path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / rejects invalid payload > request path:POST / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -110,7 +110,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / rejects invalid payload > response path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / rejects invalid payload > response path:POST / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 400 Bad Request",
Expand Down Expand Up @@ -138,7 +138,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / type casts payload when possible > request path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / type casts payload when possible > request path:POST / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -192,7 +192,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / type casts payload when possible > response path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / type casts payload when possible > response path:POST / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
Expand Down Expand Up @@ -221,7 +221,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / works > request path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / works > request path:POST / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -275,7 +275,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST / works > response path:POST / id:1 1`] = `
exports[`test/integration.test.ts TAP POST / works > response path:POST / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
Expand All @@ -295,7 +295,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /params/:id/:subid works > request path:POST /params/11/22 id:1 1`] = `
exports[`test/integration.test.ts TAP POST /params/:id/:subid works > request path:POST /params/11/22 id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -328,7 +328,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /params/:id/:subid works > response path:POST /params/11/22 id:1 1`] = `
exports[`test/integration.test.ts TAP POST /params/:id/:subid works > response path:POST /params/11/22 id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
Expand Down Expand Up @@ -357,7 +357,7 @@ Error: params.id should be number {
}
`

exports[`test/integration.test.ts TAP POST /paramswithtypo/:Ids/:subid > request path:POST /params/paramswithtypo/22 id:1 1`] = `
exports[`test/integration.test.ts TAP POST /paramswithtypo/:Ids/:subid > request path:POST /params/paramswithtypo/22 id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -390,7 +390,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /paramswithtypo/:Ids/:subid > response path:POST /params/paramswithtypo/22 id:1 1`] = `
exports[`test/integration.test.ts TAP POST /paramswithtypo/:Ids/:subid > response path:POST /params/paramswithtypo/22 id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 400 Bad Request",
Expand All @@ -409,7 +409,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /redirect works > request path:POST /redirect id:1 1`] = `
exports[`test/integration.test.ts TAP POST /redirect works > request path:POST /redirect id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand All @@ -424,7 +424,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /redirect works > response path:POST /redirect id:1 1`] = `
exports[`test/integration.test.ts TAP POST /redirect works > response path:POST /redirect id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 302 Found",
Expand All @@ -437,13 +437,48 @@ Object {
}
`

exports[`test/integration.test.ts TAP POST /testframe works > request path:POST /testframe id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
"host": "localhost:80",
"user-agent": "lightMyRequest",
},
"Params": Object {},
"Query": Null Object {},
"schema": Object {
"response": Object {},
},
}
`

exports[`test/integration.test.ts TAP POST /testframe works > response path:POST /testframe id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
"content-type: application/json; charset=utf-8",
"content-length: 39",
"Date: dateString",
"Connection: keep-alive",
],
"Payload": Array [
Object {
"frame": Object {
"id": "string",
"type": "TEST",
},
},
],
}
`

exports[`test/integration.test.ts TAP app starts and GET / works > happy path 1`] = `
Object {
"name": "hello",
}
`

exports[`test/integration.test.ts TAP app starts and GET / works > request path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP app starts and GET / works > request path:GET / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -487,7 +522,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP app starts and GET / works > response path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP app starts and GET / works > response path:GET / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
Expand All @@ -505,7 +540,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it sends headers > request path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP it sends headers > request path:GET / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -549,7 +584,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it sends headers > response path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP it sends headers > response path:GET / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 200 OK",
Expand Down Expand Up @@ -594,7 +629,7 @@ Error: querystring.getQueryParam should be boolean {
}
`

exports[`test/integration.test.ts TAP it validates get query param against schema > request path:GET /?getQueryParam=1 id:1 1`] = `
exports[`test/integration.test.ts TAP it validates get query param against schema > request path:GET /?getQueryParam=1 id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -640,7 +675,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it validates get query param against schema > response path:GET /?getQueryParam=1 id:1 1`] = `
exports[`test/integration.test.ts TAP it validates get query param against schema > response path:GET /?getQueryParam=1 id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 400 Bad Request",
Expand Down Expand Up @@ -716,7 +751,7 @@ Array [
]
`

exports[`test/integration.test.ts TAP it validates headers > request path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP it validates headers > request path:GET / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -759,7 +794,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it validates headers > request path:GET / id:2 1`] = `
exports[`test/integration.test.ts TAP it validates headers > request path:GET / id:req-2 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -802,7 +837,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it validates headers > response path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP it validates headers > response path:GET / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 400 Bad Request",
Expand All @@ -821,7 +856,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP it validates headers > response path:GET / id:2 1`] = `
exports[`test/integration.test.ts TAP it validates headers > response path:GET / id:req-2 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 400 Bad Request",
Expand Down Expand Up @@ -852,7 +887,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP response is validated > request path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP response is validated > request path:GET / id:req-1 1`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -896,7 +931,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP response is validated > request path:GET / id:1 2`] = `
exports[`test/integration.test.ts TAP response is validated > request path:GET / id:req-1 2`] = `
Object {
"Body": null,
"Headers": Object {
Expand Down Expand Up @@ -940,7 +975,7 @@ Object {
}
`

exports[`test/integration.test.ts TAP response is validated > response path:GET / id:1 1`] = `
exports[`test/integration.test.ts TAP response is validated > response path:GET / id:req-1 1`] = `
Object {
"Headers": Array [
"HTTP/1.1 500 Internal Server Error",
Expand Down
20 changes: 19 additions & 1 deletion test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ const defaultService: Service<TestSchema> = {
'POST /paramswithtypo/:Ids/:subid': (req, reply) => {
return reply.status(200).send();
},
'POST /testframe': (req, reply) => {
return reply.status(200).send({
frame: {
type: 'TEST',
id: 'string',
},
});
},
};

const buildApp = async (t: Test, service?: Service<TestSchema>) => {
Expand Down Expand Up @@ -95,7 +103,7 @@ const buildApp = async (t: Test, service?: Service<TestSchema>) => {
service,
});
await app.ready();
t.tearDown(async () => app.close());
t.teardown(async () => app.close());
return app;
};

Expand Down Expand Up @@ -263,6 +271,16 @@ t.test('POST /params/:id/:subid works', async (t) => {
t.equal(res.statusCode, 200);
});

t.test('POST /testframe works', async (t) => {
const app = await buildApp(t);
const res = await app.inject({
url: '/testframe',
method: 'POST',
});

t.equal(res.statusCode, 200);
});

t.test('POST /paramswithtypo/:Ids/:subid', async (t) => {
const app = await buildApp(t);
const res = await app.inject({
Expand Down
Loading

0 comments on commit 584c73e

Please sign in to comment.