Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Fix test.
Mike Cao97b7a14a295c
diff --git a/jest.config.ts b/jest.config.tsindex 3a9741cf1..d06ac09a6 100644--- a/jest.config.ts+++ b/jest.config.ts@@ -5,12 +5,6 @@ export default {'^.+\\.(ts|tsx)$': 'ts-jest',},moduleNameMapper: {- '^assets/(.*)$': '<rootDir>/src/assets/$1',- '^components/(.*)$': '<rootDir>/src/components/$1',- '^lib/(.*)$': '<rootDir>/src/lib/$1',- '^pages/(.*)$': '<rootDir>/src/pages/$1',- '^queries/(.*)$': '<rootDir>/src/queries/$1',- '^store/(.*)$': '<rootDir>/src/store/$1',- '^styles/(.*)$': '<rootDir>/src/styles/$1',+ '^@/(.*)$': '<rootDir>/src/$1',},};diff --git a/jsconfig.json b/jsconfig.jsondeleted file mode 100644index 5875dc5b6..000000000--- 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.tsindex cd9e86517..e330fadda 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.jsonindex efe4861d4..1e4f0ae56 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -23,6 +23,7 @@"incremental": false,"types": ["jest"],"typeRoots": ["node_modules/@types"],+ "baseUrl": ".","paths": {"@/*": ["./src/*"]},