React-Testing-Webpack-Tape
React-Testing-Webpack-Tape copied to clipboard
Never ending tests just hang
This is really a bug somewhere between tape/webpack, but since you're putting this out there as a template for people to build on I think it makes sense to document this as a known issue.
// src/__test__/index.spec.js
var test = require('tape');
// Add this broken test
test('never ending', function(t) {
t.comment('This test executes')
// There is no `t.plan` or `t.end` here. No failures will be reported, this
// will just be the last test executed
})
test('basic arithmetic', function(t) {
With the broken test in place this is all you ever get out of the browser.
You get the same thing out of node build/test.js
TAP version 13
# never ending
# This test executes
Here is what you get if you don't use webpack. This isn't really an option in my project because I depend on webpack for require('./whatever.css')
.
node src/__test__/index.spec.js
TAP version 13
# never ending
# This test executes
not ok 1 test exited without ending
---
operator: fail
...
not ok 2 test exited without ending
---
operator: fail
...
1..2
# tests 2
# pass 0
# fail 2
I just figured out that if I use target: "node",
in my webpack configuration it fixes node build/test.js
. It's not a complete solution, this gives me Node+Webpack, but now I can't use testem to run any tests in a browser.
Hi @AsaAyers thanks for spotting that, I've been quite slack with this repo and not even updated the React version!! And thank you for the PR I've now merged it. :smile: