Skip to content

Commit 4c3a086

Browse files
committed
fix: use default import for supertest and add forceExit to jest config
With esModuleInterop enabled, `import * as request` gives a namespace object instead of the callable function. Switch to default imports. Add forceExit to prevent BullMQ/Redis open handles from hanging CI.
1 parent 4596cb8 commit 4c3a086

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

test/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { INestApplication } from "@nestjs/common";
2-
import * as request from "supertest";
2+
import request from "supertest";
33
import { createTestApp } from "./test-helpers";
44

55
describe("AppController (e2e)", () => {

test/auth.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { INestApplication } from "@nestjs/common";
2-
import * as request from "supertest";
2+
import request from "supertest";
33
import { createTestApp } from "./test-helpers";
44

55
describe("Auth Guards (e2e)", () => {

test/jest-e2e.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"rootDir": ".",
44
"testEnvironment": "node",
55
"testTimeout": 30000,
6+
"forceExit": true,
67
"testRegex": ".e2e-spec.ts$",
78
"transform": {
89
"^.+\\.(t|j)s$": "ts-jest"

test/matches.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { INestApplication } from "@nestjs/common";
2-
import * as request from "supertest";
2+
import request from "supertest";
33
import { createTestApp } from "./test-helpers";
44

55
/**

0 commit comments

Comments
 (0)