Skip to content

Commit

Permalink
fix: bad type
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaringe committed Jul 1, 2022
1 parent 16d6ff4 commit 259c2f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/__tests__/fixture/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ export async function purgeContainer(container: Docker.Container) {
await containers.delete(container);
try {
await container.remove({ force: true });
} catch (err: { statusCode?: number }) {
} catch (err: any) {
const statusCode =
err && err.statusCode && typeof err.statusCode === "number"
? err.statusCode
: 0;
// if 404, we probably used the --rm flag on container launch. it's all good.
if (!(err.statusCode === 404 || err.statusCode === 409)) {
if (!(statusCode === 404 || statusCode === 409)) {
throw err; // eslint-disable-line
}
}
Expand Down

0 comments on commit 259c2f7

Please sign in to comment.