Skip to content

Commit 247ce73

Browse files
committed
Fix nock cleanup to prevent InterceptorError from delayed responses
1 parent ae16c2a commit 247ce73

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/webServiceClient.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const fullPath = (path: string) => `/minfraud/v2.0/${path}`;
2424
const client = new Client(auth.user, auth.pass);
2525

2626
describe('WebServiceClient', () => {
27+
afterEach(() => {
28+
nock.cleanAll();
29+
nock.abortPendingRequests();
30+
});
31+
2732
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2833
const factors = structuredClone(insights) as any;
2934
factors.response.full.risk_score_reasons = structuredClone(reasons);
@@ -901,10 +906,6 @@ describe('WebServiceClient', () => {
901906
});
902907

903908
describe('error handling', () => {
904-
afterEach(() => {
905-
nock.cleanAll();
906-
});
907-
908909
const transaction = new Transaction({
909910
device: new Device({
910911
ipAddress: '1.1.1.1',

0 commit comments

Comments
 (0)