Skip to content

Commit 16d6ff4

Browse files
committed
chore: add timeout extesion for image download
1 parent e1a7ab6 commit 16d6ff4

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pnpm-lock.yaml
2+
build

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"scripts": {
4949
"build": "tsc",
5050
"format": "prettier --write .",
51-
"test": "ava build/**/*.test.js",
51+
"test": "ava --timeout=2m build/**/*.test.js",
5252
"semantic-release": "semantic-release",
5353
"lint": "prettier --check .",
5454
"prepare": "husky install"

src/__tests__/fixture/db.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function purgeContainer(container: Docker.Container) {
3737
await containers.delete(container);
3838
try {
3939
await container.remove({ force: true });
40-
} catch (err) {
40+
} catch (err: { statusCode?: number }) {
4141
// if 404, we probably used the --rm flag on container launch. it's all good.
4242
if (!(err.statusCode === 404 || err.statusCode === 409)) {
4343
throw err; // eslint-disable-line

src/__tests__/main.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { container, DbContext } from "./fixture/db"; // eslint-disable-line no-unused-vars
1+
import { container, DbContext } from "./fixture/db";
22
import { createPool } from "./fixture/client";
3-
import { createServer, Server } from "http"; // eslint-disable-line no-unused-vars
3+
import { createServer, Server } from "http";
44
import { freeport } from "./fixture/freeport";
55
import { PgMutationUpsertPlugin } from "../postgraphile-upsert";
6-
import { Pool } from "pg"; // eslint-disable-line no-unused-vars
6+
import { Pool } from "pg";
77
import { postgraphile } from "postgraphile";
8-
import ava, { TestFn, ExecutionContext } from "ava"; // eslint-disable-line no-unused-vars
8+
import ava, { TestFn, ExecutionContext } from "ava";
99
import nanographql = require("nanographql");
1010
import Bluebird = require("bluebird");
1111
import fetch from "node-fetch";
@@ -25,7 +25,7 @@ test.beforeEach(async (t) => {
2525
await container.setup(t.context);
2626
await Bluebird.delay(5000);
2727
t.context.client = await createPool(t.context.dbConfig);
28-
t.context.client.on("error", (err) => {}); // eslint-disable-line
28+
t.context.client.on("error", (_err) => {});
2929
await t.context.client.query(`
3030
create table bikes (
3131
id serial,
@@ -63,9 +63,9 @@ test.beforeEach(async (t) => {
6363

6464
test.afterEach(async (t) => {
6565
t.context.client.on("error", () => null);
66+
container.teardown(t.context).catch(console.error);
6667
await t.context.middleware.release();
6768
await new Promise((res) => t.context.server.close(res));
68-
await container.teardown(t.context);
6969
});
7070

7171
const execGqlOp = (t: PluginExecutionContext, query: () => string) =>

0 commit comments

Comments
 (0)