Currently issueCommand always outputs to stdout here: https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L25. This is great but when writing tests for actions it quickly fills up the logs:
> @ test /Users/njero/Code/Examples/example-github-action-typescript
> jest
PASS .github/actions/debug-action/__tests__/debug.test.ts
debug action debug messages
✓ outputs a debug message (5ms)
##[debug]👋 Hello! You are an amazing person! 🙌
##[debug]👋 Hello! You are an amazing person! 🙌
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.423s
Ran all test suites.
If the output was wrapped in a call on the Command object itself then it could be mocked in the jest setup. Additionally this might pave the way for alternate logging outputs down the road.
Currently
issueCommandalways outputs tostdouthere: https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L25. This is great but when writing tests for actions it quickly fills up the logs:If the output was wrapped in a call on the
Commandobject itself then it could be mocked in the jest setup. Additionally this might pave the way for alternate logging outputs down the road.