Currently, the workflow for releasing a new version is owned by the Speakeasy workflow setup. A new version of @styra/opa is released whenever the PR that the "Generate" workflow creates is merged. Those PRs are generated when a change to the code generation tooling occurrs, when the OpenAPI spec changes, or when it's forced through the GitHub Workflow UI.
To create a release that's not tied to a change in SE or the OpenAPI spec, go
to this workflow
and choose "Run workflow" with branch main
and force enabled.
The Publish workflow that runs after the resulting PR was merged will take care of:
- building and pushing the NPM package (secrets are set up in the repo)
- building and pushing the typedoc docs to gh-pages.
For testing, we use NodeJS' builtin test runner together with testcontainers-node.
The tests are defined in a TS file, tests/authorizer.test.ts
.
Run all tests with
node --import tsx --test tests/**/*.ts
and with testcontainers-node's debug logging:
DEBUG='testcontainers*' node --import tsx --test tests/**/*.ts
Single out a test case by name:
node --import tsx --test-name-pattern="can be called with input==false" --test tests/**/*.ts