Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit e2eb3f2

Browse files
authored
update vite config and setupTest template (#109)
* update vite config and setupTest template * update version
1 parent 7665b7c commit e2eb3f2

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cloudquery/plugin-config-ui-lib",
33
"description": "Plugin configuration UI library for CloudQuery Cloud App",
4-
"version": "11.3.1",
4+
"version": "11.4.0",
55
"private": false,
66
"main": "dist/index.cjs.js",
77
"module": "dist/index.esm.js",

src/configs/vite.config.app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,11 @@ export default {
8080
globals: true,
8181
setupFiles: './src/tests/setupTests.ts',
8282
include: ['src/tests/**/*.test.ts', 'src/tests/**/*.test.tsx'],
83+
alias: [
84+
{
85+
find: /^monaco-editor$/,
86+
replacement: __dirname + '/node_modules/monaco-editor/esm/vs/editor/editor.api',
87+
},
88+
],
8389
},
8490
};

src/template/src/tests/setupTests.ts.hbs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import '@testing-library/jest-dom';
22
import { vi } from 'vitest';
33

4-
if (typeof window !== 'undefined') {
5-
Element.prototype.scrollIntoView = vi.fn();
6-
}
4+
5+
// Ensure window is always available
6+
Object.defineProperty(globalThis, 'window', {
7+
value: globalThis,
8+
writable: true,
9+
});
10+
11+
Element.prototype.scrollIntoView = vi.fn();
12+
13+
window.addEventListener('unhandledrejection', (event) => {
14+
console.warn('Unhandled promise rejection:', event.reason);
15+
event.preventDefault();
16+
});
717

818
process.env.REACT_APP_PLUGIN_TEAM = '{{pluginTeam}}';
919
process.env.REACT_APP_PLUGIN_KIND = '{{pluginKind}}';

0 commit comments

Comments
 (0)