Commit graph

12 commits

Author SHA1 Message Date
schutzbot
6ef29afac3 Post release version bump
[skip ci]
2025-03-06 13:12:33 +01:00
regexowl
28253c040e vitests: Set global retry
This sets retry globally to `3`, so we don't have to add it to the tests individually.

For the tests that are reliable this shouldn't have any effect, but it will trigger on tests that proved to be a bit flakey (like revisit tests).
2025-02-10 10:02:54 +01:00
Gianluca Zuccarelli
ed8254f962 test/mocks: add cockpit os-release
Add a stub function for the `os-release` package from cockpit.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
2b82fa3c4b tsconfig: cockpit plumbing
It was necessary to do a bit of plumbing to get typescript, webpack &
vitest all happy. To do this we had had to create a separate tsconfig
for the on-prem version and the service frontend.

We override the module resolution for both config files. For on-prem we
check modules in `pkg/lib` and for the service we resolve the modules to
stub functions of the `cockpit` & `cockpit/fsinfo` modules. This was so
typescript and webpack would not complain.

For on-prem we had to intruct webpack to resolve modules from both
`node_modules` and `pkg/lib`. While for the service we set the
resulotion for the two modules to false, which means they won't get
bundled with the service.

Lastly, we needed to set some aliases in the vitest config so that
vitest could resolve the `cockpit` & `cockpit/fsinfo` modules.

Using the cjs `require` keyword to import cockpit would have worked to
make typescript and webpack compile since these imports are not
statically analysed like the `import` keyword is. However, this approach
broke the tests as `require` imports are not supported in vitest.
2024-12-21 08:19:15 -06:00
regexowl
d8c3a49c19 vitest.config: Inline @monaco-editor
`@monaco-editor` needs to be inlined in order to run the tests smoothly without any errors.

Note: dependencies include both `@monaco-editor` and `monaco-editor`, only the `@` one needs to be inlined in test dependencies.
2024-10-01 12:34:30 +02:00
Michal Gold
4801a09a85 codecov: enable codecov in our repo
this commit add the configuration for codecov,
to be able to see the coverage of vitest in codecov website.
2024-09-03 09:56:45 +02:00
regexowl
bb181fe324 devDeps: bump vitest and @vitest/coverage-v8
This bumps:
- vitest from 2.0.4 to 2.0.5
- @vitest/coverage-v8 from 2.0.4 to 2.0.5

and removes reporter from the coverage setting, leaving only default output for now (console output equal to jest).
2024-08-13 09:31:35 +02:00
regexowl
90a37db2f5 vitest: Disable fileParallelism
This re-disables `fileParallelism` again as it's still proving too flaky.
2024-08-08 10:18:36 +02:00
regexowl
68b7444b2f vitest: Enable fileParallelism
This allows paralel file testing, speeding up the tests.
2024-08-05 12:52:06 +02:00
regexowl
2160177494 vitest.config: Remove clsx from inlined deps
`clsx` does not need to be inlined.
2024-07-19 14:26:07 +02:00
regexowl
6964e8b312 src: Resolve ResizeObserver is not defined error
This mocks and stubs ResizeObserver as it is not defined in jsdom.
2024-07-16 16:55:31 +02:00
regexowl
da16a42128 Migrate from Jest to Vitest
This migrates our tests from using the Jest testing framework to Vitest.
2024-07-16 16:55:31 +02:00