Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: setup workerd isolate tests #311

Merged
merged 8 commits into from
Oct 7, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- run: pnpm lint
- run: pnpm test:types
- run: pnpm test:node
- run: pnpm test:workerd
- run: pnpm build
- name: nightly release
if: |
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
"test": "pnpm lint && pnpm test:types && pnpm test:node",
"test:cf": "pnpm jiti test/cloudflare.ts",
"test:deno": "NODE_NO_WARNINGS=1 pnpm jiti test/deno.ts",
"test:node-coverage": "node test/node-coverage.mjs",
"test:node": "node --test --import jiti/register ./test/node/test-*",
"test:node-coverage": "node test/node-coverage.mjs",
"test:node:watch": "node --test --watch --import jiti/register ./test/node/test-*",
"test:types": "tsc --noEmit",
"test:vc": "pnpm jiti test/vercel.ts"
"test:vc": "pnpm jiti test/vercel.ts",
"test:workerd": "node test/workerd/main.mjs"
},
"dependencies": {
"defu": "^6.1.4",
Expand All @@ -47,16 +48,19 @@
"ufo": "^1.5.4"
},
"devDependencies": {
"@parcel/watcher": "^2.4.1",
"@types/node": "^22.7.4",
"automd": "^0.3.10",
"changelogen": "^0.5.7",
"consola": "^3.2.3",
"esbuild": "^0.24.0",
"eslint": "^9.12.0",
"eslint-config-unjs": "^0.4.1",
"jiti": "^2.3.3",
"prettier": "^3.3.3",
"typescript": "^5.6.2",
"unbuild": "^2.0.0",
"workerd": "^1.20241004.0",
"wrangler": "^3.80.0"
},
"packageManager": "[email protected]"
Expand Down
67 changes: 67 additions & 0 deletions pnpm-lock.yaml

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

16 changes: 16 additions & 0 deletions test/workerd/config.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Workerd = import "../../node_modules/workerd/workerd.capnp";

const unitTests :Workerd.Config = (
services = [
(name = "tests", worker = .testsWorker),
],
);

const testsWorker :Workerd.Worker = (
modules = [
(name = "tests", esModule = embed "./tests.mjs")
],
compatibilityDate = "2024-09-01",
compatibilityFlags = ["nodejs_compat"],
moduleFallback = "localhost:8888",
);
Loading