0.2.0 • Published 5 years ago

gravy-tap v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

gravy-tap

Tap runner for Sauce Labs.

npm.io

GitHub license Build Status npm Project Status

Usage

gravyTap works by taking raw, tap-producing javascript code as a string, running it in real browser via SauceLabs, and providing a summary of the results.

import gravyTap from 'gravy-tap';
import { readFileSync } from 'fs';
import { resolve } from 'path';

const src = readFileSync(resolve(__dirname, 'test/bundle.js'));

gravyTap(src)
  .then(results => {
    // results include information about the parsed tap output
    // see below for explanation
  })
  .catch(err => {
    // if the code lands here, there were probably uncaught errors in the code
    // sent to the sauce labs runner
  });

API

gravyTap(src, [options])

src is your raw, tap-producing javascript code, read from a file or otherwise passed in as a string. options is an object, described below.

Options

gravyTap also takes a second parameter that is an object of options. The available options are:

OptionDefaultDescription
rejectOnErrorstrueIf there are errors in the tap output, reject the promise
capabilitiesAn object of SauceLabs capabilities
sauceThe SauceLabs user and key values, as an object ({ user: '...', key: '...' }); can also be set using SAUCE_USER and SAUCE_KEY environment variables

Results

The results object can be used to check the results of the test run.

PropertyDescription
results.outputFull tap output produced by src
results.testsNumber of tests executed
results.passedNumber of tests that passed
results.failedNumber of tests that failed
results.errorsAn array of all the failed tests, as objects (see below)

This library uses simple-tap-parser to parse the tap output, see that module for more information.

The objects inside the results.errors array have the following properties:

PropertyDescription
lineThe failing line's summary
detailsThe entire failure message

License

MIT © w33ble

Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

Testing Provided by Sauce Labs