feat: Add a unit test target (jest) to the UI extension and run it in CI (#1192)

- Introduce test targets.
- Adding additional tests.

Related to: https://github.com/harvester/harvester/issues/11892

Signed-off-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
Volker Theile
2026-10-13 18:00:38 +02:00
committed by GitHub
parent 02862bbeea
commit 71141b257a
18 changed files with 924 additions and 108 deletions
+15
View File
@@ -0,0 +1,15 @@
/**
* Unit tests are failing with the following error:
*
* ```
* [@vue/compiler-sfc] No fs option provided to `compileScript` in non-Node environment. File system access is required for resolving imported types.
* ```
*
* It seems TypeScript does not populate ts.sys when loaded in Jest. In order to
* resolve this issue, we can use the hack below to point to a different
* transformer than vue-jest and call registerTs before exporting vue-jest.
*
* SEE: https://github.com/vuejs/core/issues/8301
*/
require('@vue/compiler-sfc').registerTS(() => require('typescript'));
module.exports = require('@vue/vue3-jest');