0.1.0 • Published 2 years ago

jest-test-hut-reporter v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.
0.1.0

2 years ago

0.0.2

2 years ago