diff --git a/jest.config.js b/jest.config.js index 9b57e37..c4fe30d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html -module.exports = { +export default { // All imported modules in your tests should be mocked automatically // automock: false, @@ -24,9 +24,10 @@ module.exports = { coverageDirectory: 'coverage', // An array of regexp pattern strings used to skip coverage collection - // coveragePathIgnorePatterns: [ - // "/node_modules/" - // ], + coveragePathIgnorePatterns: [ + "/node_modules/", + "src/index.ts" + ], // A list of reporter names that Jest uses when writing coverage reports coverageReporters: [ diff --git a/src/__tests__/index.test.ts b/src/__tests__/notificationapi.test.ts similarity index 99% rename from src/__tests__/index.test.ts rename to src/__tests__/notificationapi.test.ts index 281fa89..edab344 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/notificationapi.test.ts @@ -1,7 +1,7 @@ import mockConsole from 'jest-mock-console'; jest.unmock('axios'); import axios from 'axios'; -import notificationapi from '../index'; +import notificationapi from '../notificationapi'; import MockAdapter from 'axios-mock-adapter'; import { Channels, diff --git a/tsconfig.json b/tsconfig.json index 7e08a53..3421b7e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,8 @@ "removeComments": false, "noUnusedLocals": true, "noUnusedParameters": true, - "moduleResolution": "Node" + "moduleResolution": "Node", + "esModuleInterop": true }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*", "**/__mocks__/*"]