TDD Workflow
GJSify welcomes contributions! This page describes how we port new Node.js or Web APIs to GJS — a strict test-driven workflow that keeps both Node.js and GJS implementations honest.
If you have not set up the monorepo yet, start with Development Setup.
TDD Workflow
Section titled “TDD Workflow”GJSify follows a test-driven development approach:
- Study the API — read
refs/node/lib/<name>.jsfor the canonical Node.js implementation (or the relevantrefs/deno/ext/…file for Web APIs) - Port tests — write tests in
*.spec.tsusing@gjsify/unit - Verify on Node.js —
yarn test:node— tests should pass against the real Node.js implementation first - Test on GJS —
yarn test:gjs— expect failures, then fix the GJSify implementation - Implement — use
@girs/*types, consultrefs/{deno,bun,quickjs,workerd}/for reference - Iterate — until both platforms pass
Testing Rules
Section titled “Testing Rules”- Tests must pass on both Node.js and GJS
- Never weaken tests to accommodate GJS limitations — fix the implementation instead
- Use the
node:prefix for all Node.js imports in tests - Use
@gjsify/unitas the test framework; shared matchers:toBe,toEqual,toBeTruthy,toBeFalsy,toContain,toMatch,toThrow - Platform-specific test logic belongs in a separate
*.gjs.spec.tsfile or inside anon('Gjs', …)block — not sprinkled through the shared spec
Full Validation
Section titled “Full Validation”Before opening a pull request, run the full validation sequence:
yarn install && yarn clear && yarn build && yarn check && yarn testThis mirrors what CI does and catches most integration issues before review.
Where to start
Section titled “Where to start”- Browse the Packages Overview for modules that are still Partial or Stub
- Check open issues on GitHub
- Improve documentation — this very site is in
website/src/content/docs/