mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-14 10:06:04 +08:00
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:
@@ -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');
|
||||
Reference in New Issue
Block a user