Skip to content

Jest Reporter for uploading test runs to Test Hut.

License

Notifications You must be signed in to change notification settings

TobiasL/jest-test-hut-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest Test Hut reporter

Build Status Available on NPM

Jest Reporter for uploading test runs to Test Hut.

https://test-hut.tobiaslindstrom.se/

API

Installation and Jest configuration

Install:

npm install --save-dev jest-test-hut-reporter

Configuration in package.json:

{
  "jest": {
    "reporters": ["default", "jest-test-hut-reporter"]
  }
}

Add image to be viewable in Test Hut

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)
})

Jest --testLocationInResults

Run Jest with the argument --testLocationInResults to get line numbers for the test cases.

Environment variables

Required

  • TEST_HUT_KEY API key for the project shown in Test Hut.

Optional

  • TEST_INGESTER_URL Used to override the URL to send the test runs to.