https://github.com/redsift/tape-reel
https://github.com/redsift/tape-reel
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/redsift/tape-reel
- Owner: redsift
- License: mit
- Created: 2016-05-11T15:22:06.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T13:16:11.000Z (over 7 years ago)
- Last Synced: 2025-01-29T18:03:03.418Z (over 1 year ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 19
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tape-reel
[](https://circleci.com/gh/redsift/tape-reel)
[](https://www.npmjs.com/package/@redsift/tape-reel)
[](https://raw.githubusercontent.com/redsift/tape-reel/master/LICENSE)
Simple [tape](https://github.com/substack/tape) wrapper to better integrate server side JSDOM testing and CircleCI.
## Usage
Where you typically use Tape e.g.
var tape = require("tape");
Simply
var tape = require("@redsift/tape-reel")("
");
The HTML sets the JSDOM for environment for each test invocation. This document is provided in the global scope for easy integration with browser JavaScript components and passed as the second parameter to the function under test.
## Features
Compared to a naked Tape setup, this wrapper provides the following pre-configurations:
1. Setup and teardown a fresh JSDOM for each test.
1. When run on CircleCI, produce a JUnit.xml compatible output in `$CIRCLE_TEST_REPORTS/junit/junit.xml`.
1. When not run on CircleCI, pretty print with tap-diff and dump the DOM for failing tests. You may manually get a string representation of the DOM using `tape.dumpJSDOM(document)`.
## Options
var tape = require("@redsift/tape-reel")(JSDOM-HTML, SUPRESS-DOM, REPORT-NAME);
Parameter|Purpose|Default
---------|-------|-------
`JSDOM-HTML`|May be null if no JSDOM environment is required|`null`
`SUPRESS-DOM`|By default, a failing test will dump the state of the DOM|`false`
`REPORT-NAME`|Names the test report when generating `junit.xml` files on CircleCI|`junit`
## Known Issues
Currently, `REPORT-NAME` does not produce multiple junit.xml files due to a bug in the imported `tap-xunit` module.