diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 380ea99..aed693a 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -23,8 +23,10 @@ jobs: id: version - name: Install dependencies run: bun install - - name: Test project - run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' + - name: Test UserScript version + run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=1 --define __ENV_WEBEXTENSION=0 + - name: Test WebExtension version + run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=0 --define __ENV_WEBEXTENSION=1 - name: Build project run: bun run build - name: Archive production artifacts diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index a6cfd0b..adff067 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -19,8 +19,10 @@ jobs: id: version - name: Install dependencies run: bun install - - name: Test project - run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' + - name: Test UserScript version + run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=1 --define __ENV_WEBEXTENSION=0 + - name: Test WebExtension version + run: bun test --define __VERSION__='${{ steps.version.outputs.version }}' --define __EXTENSION_NAME='"tf2wikipricing"' --define __ENV_USERSCRIPT=0 --define __ENV_WEBEXTENSION=1 - name: Build project run: bun run build --mode production - name: Archive production artifacts diff --git a/bun.lockb b/bun.lockb index a4c615f..c4e438a 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/happydom.ts b/happydom.ts index 9cae201..a51cee6 100644 --- a/happydom.ts +++ b/happydom.ts @@ -1,3 +1,4 @@ import { GlobalRegistrator } from "@happy-dom/global-registrator"; -GlobalRegistrator.register(); \ No newline at end of file +GlobalRegistrator.register(); +Object.assign(global, require('jest-chrome')) \ No newline at end of file diff --git a/package.json b/package.json index 9e9db52..e83fc63 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "css-loader": "^7.1.2", "css-to-string-loader": "^0.1.3", "extract-loader": "^5.1.0", + "jest-chrome": "^0.8.0", "jsonc-loader": "^0.1.1", "mini-css-extract-plugin": "^2.9.2", "postcss-loader": "^8.1.1",