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 845698f0..a5c259c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,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" } }, @@ -5723,9 +5723,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 a7ee8f8f..b78a8b0e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,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 8c912564..5b8d2cf3 100644 --- a/src/webServiceClient.spec.ts +++ b/src/webServiceClient.spec.ts @@ -13,6 +13,11 @@ const auth = { }; describe('WebServiceClient', () => { + afterEach(() => { + nock.cleanAll(); + nock.abortPendingRequests(); + }); + const client = new Client(auth.user, auth.pass); describe('city()', () => { @@ -393,9 +398,6 @@ describe('WebServiceClient', () => { }); describe('timeout handling', () => { - afterEach(() => { - nock.cleanAll(); - }); it('should time out if the request takes too long', async () => { const ip = '8.8.8.8'; diff --git a/tsconfig.json b/tsconfig.json index 0f42c437..68127631 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "allowUnreachableCode": true, - "baseUrl": ".", "allowJs": false, "declaration": 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": [] +}