Great find @phillipskevin. After upgrading to 0.7.0 I get another error in the same domain. The error now is Cant find the variable require
. test/index_cli.test.html
file imports mocha.js and chai.js which have definitions for require
at the beginning of the file and used later. As shared before, steal-build works fine and running testee after build works fine too.
Stacktrace of testee run
myproject$ DEBUG=testee:* testee test/index_cli.test.html --coverage --config=testee.json
testee:main running test for [ 'test/index_cli.test.html' ] [ 'phantom' ] { coverage: true, browsers: [ 'phantom' ] } +0ms
testee:main bootstrapping Testee +5ms
testee:main starting testee server { coverage: true,
browsers: [ 'phantom' ],
port: 3996,
root: '/myproject/',
reporter: 'Dot',
adapter: '/testee/',
timeout: 120,
delay: 1000,
tunnel: { type: 'local', port: 3996 },
launch: { type: 'local' } } +1ms
testee:server initializing Feathers API +1ms
testee:hosting setting up code coverage true +31ms
testee:hosting intializing static file server /myproject/ +0ms
testee:main testee server started and listening on port 3996 +21ms
testee:main hooking up services to Mocha reporter +0ms
testee:reporter setting up Mocha command line reporter +0ms
testee:reporter start +0ms
testee:main starting up localhost tunnel { type: 'local', port: 3996 } +1ms
testee:main localhost tunnel started on http://localhost:3996 +1ms
testee:main using browser launcher local { type: 'local' } +0ms
testee:main browser launcher initialized +0ms
testee:main setting up test runner +1ms
testee:main server bootstrapped, running tests. +0ms
testee:runner running tests for [ 'test/index_cli.test.html' ] [ 'phantom' ] +0ms
testee:runner initializing sequential test runs for browser phantom +0ms
testee:runner running individual test http://localhost:3996/test/index_cli.test.html?__token=od4mmh { browser: 'phantom' } +3ms
testee:runner browser instance started { browser: 'phantom' } +11ms
testee:runner tracking test run http://localhost:3996/test/index_cli.test.html?__token=od4mmh { browser: 'phantom' } +1ms
testee:html-injector injecting scripts into file /test/index_cli.test.html?__token=od4mmh +1s
testee:coverage should instrument /node_modules/mocha/mocha.js +14ms
testee:coverage should instrument /test/index_cli.js +4ms
testee:coverage instrumented /myproject//test/index_cli.js +688ms
testee:coverage should instrument /node_modules/chai/chai.js +1ms
testee:coverage instrumented /myproject//node_modules/chai/chai.js +590ms
testee:coverage instrumented /myproject//node_modules/mocha/mocha.js +2s
testee:runner ERROR: ReferenceError: Can't find variable: require
testee:runner TRACE:
testee:runner -> http://localhost:3996/test/index_cli.js: 1 (in function "global code")
testee:runner
testee:runner http://localhost:3996/test/index_cli.test.html?__token=od4mmh { browser: 'phantom' } +68ms
testee:runner phantomjs://code/phantom.js:19 in onError
testee:runner http://localhost:3996/test/index_cli.test.html?__token=od4mmh { browser: 'phantom' } +0ms
testee:runner test http://localhost:3996/test/index_cli.test.html?__token=od4mmh timed out +2m
testee:runner stopping browser instance { browser: 'phantom' } +1ms
testee:reporter adding error to reporter { Error: Browser timed out within 120 seconds
at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)\n at ontimeout (timers.js:365:14)\n at tryOnTimeout (timers.js:237:5)\n at Timer.listOnTimeout (timers.js:207:5)',
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' } +17ms
testee:main shutting down reporter +1ms
testee:reporter end +0ms
testee:reporter reportErrors 1 +0ms
testee:reporter starting run { id: 'e786e60f-9df2-49e1-9fb7-550f80198e06',
title: 'General error' } +0ms
testee:reporter reporting error { Error: Browser timed out within 120 seconds
at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)\n at ontimeout (timers.js:365:14)\n at tryOnTimeout (timers.js:237:5)\n at Timer.listOnTimeout (timers.js:207:5)',
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' } +1ms
testee:reporter starting test { id: '9d7e9138-4a25-41d4-964a-a7f3f1b40668',
parent: 'e786e60f-9df2-49e1-9fb7-550f80198e06',
status: 'failed',
state: 'failed',
err:
{ Error: Browser timed out within 120 seconds
at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)\n at ontimeout (timers.js:365:14)\n at tryOnTimeout (timers.js:237:5)\n at Timer.listOnTimeout (timers.js:207:5)',
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' },
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' } +0ms
testee:reporter updating test { id: '9d7e9138-4a25-41d4-964a-a7f3f1b40668',
parent: 'e786e60f-9df2-49e1-9fb7-550f80198e06',
status: 'failed',
state: 'failed',
err:
{ Error: Browser timed out within 120 seconds
at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)\n at ontimeout (timers.js:365:14)\n at tryOnTimeout (timers.js:237:5)\n at Timer.listOnTimeout (timers.js:207:5)',
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' },
title: 'http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}' } +2ms
! testee:reporter updating run { status: 'finished',
id: 'e786e60f-9df2-49e1-9fb7-550f80198e06',
title: 'General error' } +1ms
0 passing (2m)
1 failing
1) General error http://localhost:3996/test/index_cli.test.html?__token=od4mmh on {"browser":"phantom"}:
Error: Browser timed out within 120 seconds
at Timeout.testTimedOut [as _onTimeout] (/.nvm/versions/node/v7.2.0/lib/node_modules/testee/lib/runner.js:47:27)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
testee:main closing server +2ms
myproject$ testee -V
0.7.0
First few lines of mocha.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (process,global){
'use strict';
/* eslint no-unused-vars: off */
/* eslint-env commonjs */
/**
* Shim process.stdout.
*/
process.stdout = require('browser-stdout')();
var Mocha = require('./lib/mocha');
First few lines of chai.js
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = require('./lib/chai');
},{"./lib/chai":2}],2:[function(require,module,exports){
/*!
* chai
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed
*/
var used = []
, exports = module.exports = {};
/*!
* Chai version
*/
exports.version = '3.5.0';
/*!
* Assertion Error
*/
exports.AssertionError = require('assertion-error');