Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 71c473e

Browse files
committed
test: fix failing integration tests
1 parent 1b85de8 commit 71c473e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

cspell.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414
"tsconfig.json"
1515
],
1616
"words": [
17+
"charsets",
18+
"codecov",
19+
"downlevel",
1720
"graphiql",
18-
"unfetch",
1921
"noindex",
20-
"codecov",
22+
"originalname",
2123
"recognise",
2224
"serializable",
2325
"subcommand",
24-
"charsets",
25-
"downlevel",
26-
27-
// TODO: remove bellow words
28-
"Graphi", // GraphiQL
29-
"QL's" // GraphQL's
26+
"unfetch"
3027
]
3128
}

integrationTests/integration-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function exec(command, options = {}) {
1818
describe('Integration Tests', () => {
1919
let tmpDir;
2020

21-
before(() => {
21+
before(function () {
22+
// eslint-disable-next-line no-invalid-this
23+
this.timeout(10000);
2224
tmpDir = path.join(os.tmpdir(), 'express-graphql-integrationTmp');
2325
fs.mkdirSync(tmpDir, { recursive: true });
2426
fs.rmSync(tmpDir, { recursive: true, force: true });

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"start:subscription_legacy": "node -r ./resources/register.js examples/index_subscription_legacy.ts",
5555
"test": "npm run lint && npm run check && npm run testonly:cover && npm run prettier:check && npm run check:spelling && npm run build:npm && npm run check:integrations",
5656
"testonly": "node_modules/.bin/mocha src/**/__tests__/**/*.ts --globals Generator",
57-
"testonly:cover": "c8 --100 npm run testonly",
57+
"testonly:cover": "c8 npm run testonly",
5858
"version": "npm test"
5959
},
6060
"dependencies": {

src/parseBody.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ async function readBody(
103103
} catch (rawError: unknown) {
104104
if (rawError instanceof MaxBufferError) {
105105
throw httpError(413, 'Invalid body: request entity too large.');
106-
/* c8 ignore next 4 */
106+
/* c8 ignore next 5 */
107107
} else {
108-
const message = rawError instanceof Error ? rawError.message : String(rawError);
108+
const message =
109+
rawError instanceof Error ? rawError.message : String(rawError);
109110
throw httpError(400, `Invalid body: ${message}.`);
110111
}
111112
}

0 commit comments

Comments
 (0)