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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
docs
docs-typescript-project: docs/tsconfig.json
renovate-sync: false
cache-paths: .antelope/cache
cache-key-files: |
src/antelope.test.ts
antelope-lock/**
test-job: true
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The AntelopeJS interface for token authentication, published as `@antelopejs/int

## Tests

- `pnpm test` builds `dist`, then runs `ajs module test .`. `src/antelope.test.ts` (`antelopeJs.test` in `package.json`) describes the test project: it loads `@antelopejs/auth-jwt` (a devDependency, as a local module), installs `@antelopejs/api` from npm at a pinned version, because `auth-jwt` declares `@antelopejs/interface-api`, and runs the compiled suites in `dist/tests`. The suites are written in `src/tests`. `pnpm-workspace.yaml` overrides the `@antelopejs/interface-auth` dependency of `@antelopejs/auth-jwt` with a link to this package, and the suites import the code under test by relative path, so they exercise the local build: without the override they would test the published copy the implementer installs. Do not import `@antelopejs/interface-auth` by name in a suite.
- `pnpm test` builds `dist`, then runs `ajs module test .`. `src/antelope.test.ts` (`antelopeJs.test` in `package.json`) describes the test project: it loads `@antelopejs/auth-jwt` (a devDependency, as a local module), installs `@antelopejs/api` from npm at a pinned version, because `auth-jwt` declares `@antelopejs/interface-api`, and runs the compiled suites in `dist/tests`. The suites are written in `src/tests`. `antelope-lock/` records the lockfile each npm module installed with, and `ajs module test` installs from it, so every run tests the same dependencies; commit it when it changes, and refresh it by deleting the module's record and `.antelope/cache`, then running `pnpm test`. `pnpm-workspace.yaml` overrides the `@antelopejs/interface-auth` dependency of `@antelopejs/auth-jwt` with a link to this package, and the suites import the code under test by relative path, so they exercise the local build: without the override they would test the published copy the implementer installs. Do not import `@antelopejs/interface-auth` by name in a suite.
- The test project serves the API on `127.0.0.1:5010`, so that port must be free.
- `ajs module test` installs the modules with `corepack pnpm@<packageManager>` when corepack is on `PATH`, and with the `pnpm` on `PATH` otherwise. Node 25 and later do not bundle corepack, so there install pnpm 10.6.5 another way.
- `pnpm run checks` does not run the documentation check. CI runs it through the `docs-files` inputs in `.github/workflows/ci.yml`. To run it locally, clone `AntelopeJS/tooling-configs` at `v0.0.9` (the ref ci-node pins), run `npm ci --prefix actions/docs --omit=dev`, then run `node <clone>/actions/docs/check.mjs --files "$(printf 'README.md\ndocs')" --typescript-project docs/tsconfig.json` from this repository.
Expand Down
Loading
Loading