mirror of
https://github.com/actions/create-github-app-token.git
synced 2026-11-16 19:41:09 +00:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The `integration` check fails on `main` because 10 snapshots include Node.js internal stack frames, and their names changed between Node.js versions. CI installs the latest Node.js that matches `>=24.4.0`, so these snapshots can break without any change to the action. This PR runs each test with `--stack-trace-limit=0`, so error output no longer includes stack traces. Snapshots still capture the error message, any HTTP error details, and the `::error::` output users see. Code coverage is still enforced by `c8 --100`. Without stack traces, `normalizeStderr` is no longer needed, so this removes it. All 120 tests pass with 100% coverage on Node.js 24 and 26. --------- Co-authored-by: Copilot App <[email protected]> Copilot-Session: b91f96b7-a7f3-4ff3-8f52-3a617307ede2 |
||
| .. | ||
| action-deprecated-inputs.test.js | ||
| index.js | ||
| index.js.snapshot | ||
| main-app-id-fallback.test.js | ||
| main-client-id-precedence.test.js | ||
| main-custom-github-api-url.test.js | ||
| main-enterprise-fail-response.test.js | ||
| main-enterprise-installation-not-found.test.js | ||
| main-enterprise-mutual-exclusivity-owner.test.js | ||
| main-enterprise-mutual-exclusivity-repositories.test.js | ||
| main-enterprise-only-success.test.js | ||
| main-enterprise-token-permissions-set.test.js | ||
| main-missing-client-and-app-id.test.js | ||
| main-missing-owner.test.js | ||
| main-missing-private-key.test.js | ||
| main-missing-repository.test.js | ||
| main-private-key-with-escaped-newlines.test.js | ||
| main-proxy-requires-native-support.test.js | ||
| main-repo-skew.test.js | ||
| main-token-get-owner-set-client-error.test.js | ||
| main-token-get-owner-set-fail-response.test.js | ||
| main-token-get-owner-set-repo-fail-response.test.js | ||
| main-token-get-owner-set-repo-full-name.test.js | ||
| main-token-get-owner-set-repo-invalid-format.test.js | ||
| main-token-get-owner-set-repo-network-error.test.js | ||
| main-token-get-owner-set-repo-non-current-full-name.test.js | ||
| main-token-get-owner-set-repo-owner-mismatch.test.js | ||
| main-token-get-owner-set-repo-set-to-many-newline.test.js | ||
| main-token-get-owner-set-repo-set-to-many.test.js | ||
| main-token-get-owner-set-repo-set-to-one.test.js | ||
| main-token-get-owner-set-repo-unset.test.js | ||
| main-token-get-owner-unset-repo-full-name-and-bare.test.js | ||
| main-token-get-owner-unset-repo-owner-mismatch.test.js | ||
| main-token-get-owner-unset-repo-set.test.js | ||
| main-token-get-owner-unset-repo-unset.test.js | ||
| main-token-permissions-set.test.js | ||
| main.js | ||
| mock-agent.js | ||
| post-proxy-requires-native-support.test.js | ||
| post-revoke-token-fail-response.test.js | ||
| post-token-expired.test.js | ||
| post-token-set.test.js | ||
| post-token-skipped.test.js | ||
| post-token-unset.test.js | ||
| README.md | ||
Tests
Add one test file per scenario. You can run them in isolation with:
node tests/post-token-set.test.js
All tests are run together in tests/index.js, which can be executed with Node's built-in test runner
node --test tests/index.js
or with npm
npm test
How the tests work
The output from the tests is captured into a snapshot (tests/index.js.snapshot). It includes all requests sent by our scripts to verify it's working correctly and to prevent regressions.
To update snapshots after an intentional change:
node --test --test-update-snapshots tests/index.js
How to add a new test
We have tests both for the main.js and post.js scripts.
- If you do not expect an error, take main-token-permissions-set.test.js as a starting point.
- If your test has an expected error, take main-missing-client-and-app-id.test.js as a starting point.