Skip to content

Commit

Permalink
fix(tests): add missing await after premature merge (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 23, 2018
1 parent 9e28161 commit a1d1402
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"**/node_modules": true,
"**/bower_components": true,
"**/build": true
}
},
"tslint.jsEnable": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,54 @@ Array [
]
`;

exports[`fastify will report an extended error when extendedErrors is enabled 1`] = `
Array [
Object {
"detail": "test detail",
"errcode": "12345",
"extensions": Object {
"exception": Object {
"detail": "test detail",
"errcode": "12345",
"hint": "test hint",
},
"testingExtensions": true,
},
"hint": "test hint",
"locations": Array [
Object {
"column": 2,
"line": 1,
},
],
"message": "test message",
"path": Array [
"testError",
],
},
]
`;

exports[`fastify will report standard error when extendedErrors is not enabled 1`] = `
Array [
Object {
"extensions": Object {
"testingExtensions": true,
},
"locations": Array [
Object {
"column": 2,
"line": 1,
},
],
"message": "test message",
"path": Array [
"testError",
],
},
]
`;

exports[`http will report an extended error when extendedErrors is enabled 1`] = `
Array [
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ const serverCreators = new Map([
app.use(handler);
}
await app.ready();
if (!server) {
throw new Error('Fastify server not created!');
}
return server;
},
],
Expand Down Expand Up @@ -678,7 +681,7 @@ for (const { name, createServerFromHandler, subpath = '' } of toTest) {
pgPool.connect.mockClear();
pgClient.query.mockClear();
pgClient.release.mockClear();
const server = createServer();
const server = await createServer();
const res = await request(server)
.post(`${subpath}/graphql`)
.send({ query: '{testError}' })
Expand Down

0 comments on commit a1d1402

Please sign in to comment.