diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 0000000..3a3cdf9 --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,2 @@ +[test] +preload = "./test/dom.ts" diff --git a/package.json b/package.json index bcb36b3..c193f44 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "module": "index.ts", "type": "module", "files": ["index.ts"], - + "scripts": { + "test": "bun test" + }, "dependencies": { "jose": "^5.2.3", "log": "^6.3.1", @@ -12,6 +14,8 @@ "zxcvbn": "^4.4.2" }, "devDependencies": { + "@happy-dom/global-registrator": "^14.10.2", + "@types/bun": "^1.1.2", "@types/zxcvbn": "^4.4.4" }, "peerDependencies": { diff --git a/test/dom.ts b/test/dom.ts new file mode 100644 index 0000000..c35cb5a --- /dev/null +++ b/test/dom.ts @@ -0,0 +1,3 @@ +import {GlobalRegistrator} from '@happy-dom/global-registrator' + +GlobalRegistrator.register(); diff --git a/tsconfig.json b/tsconfig.json index de704e7..ba96c23 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "baseUrl": "./src", // Enable latest features - "lib": ["ESNext"], + "lib": ["ESNext","dom"], "target": "ESNext", "module": "ESNext", "moduleDetection": "force",