tape-results
Get the tap output from the browser to your console, and exit with an appropriate exit code
Last updated 5 years ago by artskydj .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tape-results 
SYNC missed versions from official npm registry.

tape-results

Get the tap output from the browser to your console, and exit with an appropriate exit code

Build Status Dependency Status devDependency Status

Like smokestack but it allows you to write your own server code.

example

browser-test.js

var test = require('tape')
var results = require('tape-results')

results(test)

test('thing', function (t) {
	t.pass('hi')
	t.end()
})

server.js

var results = require('tape-results')
var ecstatic = require('ecstatic')

var server = results()
var requestHandler = ecstatic(__dirname + '/public' )
server.on('request', requestHandler)

var addr = server.address()
console.log('Server listening on ' + addr.address + ':' addr.port)

api

var results = require('tape-results')

results(tape) (Client-side)

Just pass it test from var test = require('tape').

results([server]) (Server-side)

If you don't supply a server, it will create a server on a random port, and return it.

The server object returned is an http.Server instance.

When tape is finished on the browser, server.close() and process.exit() are called.

travis

When using with travis, you have to use firefox and xvfb.

Add this to your .travis.yml file:

before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

Then, in your server code, add this:

var launch  = require('opener')

launch('http://localhost:' + port + '/')

install

With npm do:

npm install tape-results

license

VOL

Current Tags

  • 0.2.2                                ...           latest (5 years ago)

5 Versions

  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |