Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/task-manager/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
preload = ["./test-setup.ts"]
1 change: 1 addition & 0 deletions examples/task-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@playwright/test": "^1.58.2",
"@vertz/ui-compiler": "workspace:*",
"bun-types": "^1.3.9",
"happy-dom": "^20.6.1",
"typescript": "^5.8.0",
"vite": "^6.0.0"
}
Expand Down
34 changes: 34 additions & 0 deletions examples/task-manager/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Test setup for bun test with happy-dom
*/
import { GlobalWindow } from 'happy-dom';

// Create a happy-dom window and inject globals
const window = new GlobalWindow();
const document = window.document;

// Inject DOM globals into the global scope for bun test
// @ts-expect-error - Injecting DOM globals
globalThis.window = window;
// @ts-expect-error - Injecting DOM globals
globalThis.document = document;
// @ts-expect-error - Injecting DOM globals
globalThis.HTMLElement = window.HTMLElement;
// @ts-expect-error - Injecting DOM globals
globalThis.Element = window.Element;
// @ts-expect-error - Injecting DOM globals
globalThis.Node = window.Node;
// @ts-expect-error - Injecting DOM globals
globalThis.NodeList = window.NodeList;
// @ts-expect-error - Injecting DOM globals
globalThis.NodeFilter = window.NodeFilter;
// @ts-expect-error - Injecting DOM globals
globalThis.MouseEvent = window.MouseEvent;
// @ts-expect-error - Injecting DOM globals
globalThis.KeyboardEvent = window.KeyboardEvent;
// @ts-expect-error - Injecting DOM globals
globalThis.Event = window.Event;
// @ts-expect-error - Injecting DOM globals
globalThis.navigator = window.navigator;
// @ts-expect-error - Injecting DOM globals
globalThis.location = window.location;
Loading