Socket
Socket
Sign inDemoInstall

@saucelabs/sauce-json-reporter

Package Overview
Dependencies
Maintainers
32
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saucelabs/sauce-json-reporter

A javascript library for creating Sauce Labs JSON test results.


Version published
Weekly downloads
7.7K
decreased by-27.41%
Maintainers
32
Weekly downloads
 
Created
Source

sauce-json-reporter-js

A javascript library for creating Sauce Labs JSON test results.

Examples

const { TestRun, Status } = require('@saucelabs/sauce-json-reporter');

let r = new TestRun()
const s1 = r.withSuite('somegroup')
const s2 = s1.withSuite('somefile.test.js')
s2.withTest('yay', {
  status: Status.Passed,
  duration: 123,
})
s2.withTest('nay', {
  status: Status.Failed,
  duration: 123,
})

r.stringify() // returns a JSON string representing the entire test run
// or
r.toFile('myreport.json') // writes the JSON to a file instead

The resulting JSON of the above example is:

{
  "status": "failed",
  "attachments": [],
  "suites": [
    {
      "name": "somegroup",
      "status": "failed",
      "suites": [
        {
          "name": "somefile.test.js",
          "status": "failed",
          "suites": [],
          "attachments": [],
          "tests": [
            {
              "name": "yay",
              "status": "passed",
              "startTime": "2021-11-09T21:10:59.550Z",
              "duration": 123,
              "attachments": []
            },
            {
              "name": "nay",
              "status": "failed",
              "startTime": "2021-11-09T21:10:59.550Z",
              "duration": 123,
              "attachments": []
            }
          ]
        }
      ],
      "attachments": [],
      "tests": []
    }
  ]
}

FAQs

Package last updated on 08 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc