diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 68f3eb01b7ba..4d5efc9cc086 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,8 @@ jobs: - run: npm test - run: tree -L 2 ./coverage -P 'lcov.info' - uses: codecov/codecov-action@v5.1.1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: directory: ./coverage/ flags: summary diff --git a/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts b/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts index fbafe21464c3..244f4d63fbac 100644 --- a/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts +++ b/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts @@ -212,12 +212,6 @@ describe('InputDateRangeComponent', () => { }); describe('With items', () => { - beforeAll(() => { - jest.useFakeTimers({advanceTimers: true}).setSystemTime( - new Date('2024-01-15'), - ); - }); - beforeEach(() => { testComponent.items = tuiCreateDefaultDayRangePeriods(); }); diff --git a/projects/testing/setup-jest/index.ts b/projects/testing/setup-jest/index.ts index 91d12ff012dc..c3c55aae657f 100644 --- a/projects/testing/setup-jest/index.ts +++ b/projects/testing/setup-jest/index.ts @@ -143,6 +143,14 @@ class TransferMockEvent { global.DragEvent = TransferMockEvent as unknown as typeof DragEvent; global.ClipboardEvent = TransferMockEvent as unknown as typeof ClipboardEvent; +// Need before initialize any static methods +global.Date = class extends Date { + constructor(...args: DateConstructor[]) { + // @ts-ignore + super(...(args.length === 0 ? ['2023-02-15T00:00:00Z'] : args)); + } +} as unknown as DateConstructor; + /** * in our jest setupFilesAfterEnv file, * however when running with ng test those