Starting from a simple workflow that runs jest, we want to
jest --json --outputFile tmp/jest.json
will produce Captain-compatible json output in tmp/jest.json
. We get useful
location information if you also include --testLocationInResults
npm test -- --json --testLocationInResults --outputFile tmp/jest.json
Create an Access Token for your organization within Captain (more documentation here).
Add the new token as an action secret to your repository. Conventionally, we call this secret RWX_ACCESS_TOKEN
.
See the full documentation on test suite integration.
- uses: rwx-research/setup-captain@v1
- name: Run tests
run: |
captain run \
--suite-id captain-examples-jest \
--test-results tmp/jest.json \
-- \
npm test -- --json --outputFile=tmp/jest.json --testLocationInResults
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
Take a look at the final workflow!