Jest Reporter for uploading test runs to Test Hut.
https://test-hut.tobiaslindstrom.se/
Install:
npm install --save-dev jest-test-hut-reporter
Configuration in package.json
:
{
"jest": {
"reporters": ["default", "jest-test-hut-reporter"]
}
}
Use the function addImage
to add images to be viewable in Test Hut.
It will automatically be connected to the file and line number the function is run at.
const { addImage } = require('jest-test-hut-reporter')
it('Test', async () => {
const base64Image = await screenshotApp()
await addImage(base64Image)
})
Run Jest with the argument --testLocationInResults
to get line numbers for the test cases.
-
TEST_HUT_KEY
API key for the project shown in Test Hut.
-
TEST_INGESTER_URL
Used to override the URL to send the test runs to.