aboutsummaryrefslogtreecommitdiffstats
path: root/jest.config.js
Commit message (Collapse)AuthorAge
* test(main): ConfigFile integration testLibravatar Kristóf Marussy2022-05-29
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* test(shared): SharedStoreBase testsLibravatar Kristóf Marussy2022-05-27
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: fix test rootDir configurationLibravatar Kristóf Marussy2022-05-27
| | | | | | Each package should load the tests from its src directory only. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: integration testing supportLibravatar Kristóf Marussy2022-05-16
| | | | | | Run integration tests in an electron environment for the main process. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* ci: Export test and coverage reportLibravatar Kristóf Marussy2022-01-10
|
* build: Add prettierLibravatar Kristóf Marussy2022-01-09
| | | | | | | eslint will also enforce prettier rules, so there is no need to call prettier separately in CI. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* build: Eslint fixes for multi-module projectLibravatar Kristóf Marussy2022-01-09
| | | | Signed-off-by: Kristóf Marussy <kristof@marussy.com>
* test: Set up v8 coverage analysisLibravatar Kristóf Marussy2021-12-31
| | | | | We can't use babel coverage analysis, because it hardcodes a babel config that is not compatible with ESM.
* test: Add tests for main packageLibravatar Kristóf Marussy2021-12-31
| | | | | | | | | | | | | - Changed jest to run from the root package and reference the packages as projects. This required moving the base jest config file away from the project root. - Module isolation seems to prevent ts-jest from loading the shared package, so we disabled it for now. - To better facilitate mocking, services should be split into interfaces and implementation - Had to downgrade to chald 4.1.2 as per https://github.com/chalk/chalk/releases/tag/v5.0.0 at least until https://github.com/microsoft/TypeScript/issues/46452 is resolved.
* build: Fully switch over to ESMLibravatar Kristóf Marussy2021-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | Now we can run with ESM at build and test time and transpile into commonjs for electron. This greatly simplifies testing, since we treat everything as ESM during build with esbuild anyways. Now the test environment and the build scripts match the apparent (but not the actual for the main, preload, and inject modules) runtime environment. Caveats: - We may use top-level async expressions in tests and script, but not in code that gets transpiled into commonjs or scripts that get imported by vite. The limitation w.r.t. commonjs seems fundamental. - Jest only experimentally supports ESM and there are some limitations with mocking. Most limitations (except the lack of automatic mocks) can be worked around by async importing code that uses mocks. - There are packages marked as modules (so that node reads any scripts in them as ESM) that nevertheless get transpiled into commonjs modules. However, these should be clearly marked by using a .cjs extension as their bundle. The worst offender is the root package, which has a .cjs as its main entry point that gets read by electron, but is in fact marked as a module. This doesn't seem to bother electron at all. The service-inject package is an IIFE with a .js extension, but it outputs a fully self-contained bundle, so the choice of module format should be irrelevant.
* build: Only use vite typings in rendererLibravatar Kristóf Marussy2021-12-30
| | | | | The rest of the packages aren't buld with vite, so we shouldn't use its typings.
* build: Use shared packages through modulesLibravatar Kristóf Marussy2021-12-30
| | | | | | | | | | By running the build for the shared packages only once, errors in them are reported only once in watch mode. We still have to point jest to the original source files (and rebuild the shared source files as part of the test), because it won't load the "module" entry of the shared packages. However, as a benefit, jest can now run even if the shared packages haven't been built yet.
* build: Disable typechecking for testsLibravatar Kristóf Marussy2021-12-28
|
* build: Test runner configuration per packageLibravatar Kristóf Marussy2021-12-27
|
* test: Add preload unit testsLibravatar Kristóf Marussy2021-12-27