Files
create-github-app-token/tests
Parker BrownandCopilot f24bbd8964 fix: validate private-key input (#376)
## Summary

When `private-key` resolves to an empty value, the action currently lets
Octokit fail with `[@octokit/auth-app] privateKey option is required`,
which points at an implementation detail instead of the action input.
This adds action-level validation so users get the same non-empty input
guidance used for missing `client-id` or `app-id`.

- Validate `private-key` before creating app auth
- Add a regression test and snapshot for the missing private key path
- Leave valid private key handling unchanged, including escaped newlines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-12 16:05:46 -07:00
..

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.