diff --git a/jest.config.ts b/jest.config.ts index 3a9741cf..d06ac09a 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -5,12 +5,6 @@ export default { '^.+\\.(ts|tsx)$': 'ts-jest', }, moduleNameMapper: { - '^assets/(.*)$': '/src/assets/$1', - '^components/(.*)$': '/src/components/$1', - '^lib/(.*)$': '/src/lib/$1', - '^pages/(.*)$': '/src/pages/$1', - '^queries/(.*)$': '/src/queries/$1', - '^store/(.*)$': '/src/store/$1', - '^styles/(.*)$': '/src/styles/$1', + '^@/(.*)$': '/src/$1', }, }; diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 5875dc5b..00000000 --- a/jsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "src" - }, - "include": ["src"] -} diff --git a/src/lib/__tests__/charts.test.ts b/src/lib/__tests__/charts.test.ts index cd9e8651..e330fadd 100644 --- a/src/lib/__tests__/charts.test.ts +++ b/src/lib/__tests__/charts.test.ts @@ -1,5 +1,5 @@ -import { renderNumberLabels, renderDateLabels } from 'lib/charts'; -import { formatDate } from 'lib/date'; +import { renderNumberLabels, renderDateLabels } from '../charts'; +import { formatDate } from '../date'; // test for renderNumberLabels @@ -45,7 +45,8 @@ describe('renderDateLabels', () => { const mockValues = [{ value: '2024-03-23T10:00:00Z' }, { value: '2024-03-24T15:30:00Z' }]; beforeEach(() => { - jest.spyOn(require('lib/date'), 'formatDate'); + // eslint-disable-next-line @typescript-eslint/no-require-imports + jest.spyOn(require('@/lib/date'), 'formatDate'); }); afterEach(() => { diff --git a/tsconfig.json b/tsconfig.json index efe4861d..1e4f0ae5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,7 @@ "incremental": false, "types": ["jest"], "typeRoots": ["node_modules/@types"], + "baseUrl": ".", "paths": { "@/*": ["./src/*"] },