Cb 6265 Return front unit tests after migration#3338
Conversation
There was a problem hiding this comment.
This test is useless; I deleted it. importLazyComponent is just a syntax sugar which has no logic to test
| export function timestampToDate(timestamp: number) { | ||
| return new Date(timestamp).toLocaleString(); | ||
| return new Date(timestamp).toLocaleString('en-US', { | ||
| year: 'numeric', | ||
| month: '2-digit', | ||
| day: '2-digit', | ||
| hour: '2-digit', | ||
| minute: '2-digit', | ||
| second: '2-digit', | ||
| hour12: false, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Please revert. This must be handled on the test's side. You are currently changing the behavior of the application
| afterEach(() => { | ||
| function resetMocks() { | ||
| vi.clearAllTimers(); | ||
| vi.useFakeTimers(); |
There was a problem hiding this comment.
Do we want to use fake timers by default?
There was a problem hiding this comment.
Sure. Real-timers run in real-time. So it takes tests longer
If tests have timers, it is required to fake timers
If tests have no timers, there is no harm to performance or test run environment
These changes save you a few lines of code, so you don't need to mock it again and again, and they also save you from forgetting about mocking timers
This reverts commit 143cbb0.
…"" This reverts commit 8261055.
* СB-6265 sets up vitest instead of jest * CB-6265 gets back core-utils tests * СB-6265 gets back react-testing-library tests * СB-6265 gets back some tests from another plugins * CB-6265 renames dist -> lib in each plugin + removes all jest from the repo * CB-6265 disables watch mode so build can go on * CB-6265 extends tests types for react-testing-library * CB-6265 reverts dist->lib rename cause it contains other assets also * CB-6265 moves setupFiles to the vitest.config.ts * CB-6265 pr fixes * CB-6265 fixes tests run for Windows * CB-6265 removes global: true in config + uses jest-dom/vitest lib to have extended expect types * CB-6565 removes unused deps * СB-6265 improves performance of the test x10 times * CB-6265 gets back renderInApp, fixes vitest setup reset config for mocks, cleans up * CB-6265 reset -> restore all mocks * CB-6265 fixes unit tests * CB-6265 vitest.setup.ts cleanup * CB-6265 timestamp to date shows military time both: on unix and windows (win tests fix) * CB-6265 improves tests running (sequential run instead of parallel) * CB-6265 cleanup * CB-6265 eslint fix * CB-6265 eslint fix 2 * CB-6265 reverts useCombined handler * CB-6265 reverts some tests * CB-6265 removes all redundant timer configs * Merge branch 'devel' into CB-6265-return-front-unit-tests-after-migration * CB-6265 pr fixes * CB-6265 fixes time for windows * CB-6265 removes default fake timers before each test
No description provided.