juliangruber / browser-run

Run code inside a browser from the command line
447 stars 62 forks source link

browser-run 2.6.1 broken #33

Closed patrickarlt closed 9 years ago

patrickarlt commented 9 years ago

Given the following file:

import test from 'tape';

test('teardown', function (t) {
  window.close();
  t.end();
});

and this test command browserify ./test/index.js -t [ babelify ] | browser-run

browser-run 2.6.0 produces the following output:

TAP version 13
# teardown

1..0
# tests 0
# pass  0

# ok

but browser run 2.6.1 produces this:

TAP version 13
# teardown

1..0
# tests 0
# pass  0

# ok

TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909
  http://localhost:60578/reporter.js:5909 in _onXHRProgress
  http://localhost:60578/reporter.js:5694 in _onXHRProgress
  http://localhost:60578/reporter.js:5644 in onreadystatechange
TypeError: Type error
TypeError: Type error

  http://localhost:60578/reporter.js:29
TypeError: Type error

  http://localhost:60578/reporter.js:5909

and then proceeds to hang.

juliangruber commented 9 years ago

try window.close() after t.end()

juliangruber commented 9 years ago

also, you don't need to use window.close() with tape, just pipe into tape-run and that will take care of it

juliangruber commented 9 years ago

the new version using electron fixes a lot of issues, this should be gone