New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for tap(e) tests #5
Comments
How do you determine the result of your tests when using tape? Looking at the console? |
Exactly. That's what is already doing testem https://github.com/airportyh/testem/blob/master/views/taprunner.mustache |
Maybe I should link to this https://github.com/airportyh/testem/blob/master/tests/fixtures/tape/public/tap_adapter.js |
I came up with a way to make this work. If you don't have function setupSaucieReporter(tape) {
// Force tape to create the harness now with the default stream
tape.getHarness()
// Now create a 2nd stream (1st is created inside getHarness)
const stream = tape.createStream({ objectMode: true })
let tests = 0
let fail = 0
let pass = 0
stream.on('data', function (row) {
if (row.ok != null) {
tests++
if (row.ok) {
pass++
} else {
fail++
}
}
})
return function() {
return {
passed: ( fail == 0 ),
// I don't know what I should add for custom-data
}
}
}
// I think this should be run as early as possible.
global.JSTestingReporterSL = setupSaucieReporter(require('tape')) |
That would be cool.
Any idea how we can do that ?
I see that for other frameworks you use a global var, but tape don't have any (commonjs like code via browserify or webpack).
I would really like to use saucie with tape tests.
The text was updated successfully, but these errors were encountered: