diff --git a/e2e/ts/tsconfig.json b/e2e/ts/tsconfig.json new file mode 100644 index 00000000..a99b181c --- /dev/null +++ b/e2e/ts/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "commonjs", + "strict": true, + "target": "es6" + } +} diff --git a/jest.config.js b/jest.config.js index 85615532..ef28747e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,7 +9,7 @@ module.exports = { }, roots: ['/src'], transform: { - '^.+\\.tsx?$': 'ts-jest', + '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }], }, testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], diff --git a/package-lock.json b/package-lock.json index ee0c50b2..bc8e2009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "prettier": "^3.0.0", "ts-jest": "^29.1.0", "typedoc": "^0.28.1", - "typescript": "^5.0.2", + "typescript": "^6.0.2", "typescript-eslint": "^8.5.0" } }, @@ -5742,9 +5742,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index ed2d43a4..74a6adeb 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "prettier": "^3.0.0", "ts-jest": "^29.1.0", "typedoc": "^0.28.1", - "typescript": "^5.0.2", + "typescript": "^6.0.2", "typescript-eslint": "^8.5.0" }, "publishConfig": { diff --git a/src/webServiceClient.spec.ts b/src/webServiceClient.spec.ts index 896b185e..aa3a4994 100644 --- a/src/webServiceClient.spec.ts +++ b/src/webServiceClient.spec.ts @@ -24,6 +24,11 @@ const fullPath = (path: string) => `/minfraud/v2.0/${path}`; const client = new Client(auth.user, auth.pass); describe('WebServiceClient', () => { + afterEach(() => { + nock.cleanAll(); + nock.abortPendingRequests(); + }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const factors = structuredClone(insights) as any; factors.response.full.risk_score_reasons = structuredClone(reasons); @@ -901,10 +906,6 @@ describe('WebServiceClient', () => { }); describe('error handling', () => { - afterEach(() => { - nock.cleanAll(); - }); - const transaction = new Transaction({ device: new Device({ ipAddress: '1.1.1.1', diff --git a/tsconfig.json b/tsconfig.json index b0bc6dc9..960cdc75 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { "allowUnreachableCode": true, - "baseUrl": ".", "allowJs": false, "declaration": true, "esModuleInterop": true, - "lib": ["es2015", "es2016", "es2017"], + "lib": ["es2022"], + "types": ["node"], "module": "commonjs", "outDir": "dist", "pretty": true, diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..4c5d1088 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "types": ["jest", "node"] + }, + "include": ["src"], + "exclude": [] +}