Code coverage for a CanJS app using Testee


#1
project_root$ testee test/index_cli.test.html --coverage --config=testee.json

Failed to parse file: /test/index_cli.js

Contents of testee.json:

{
  "coverage": {
    "dir": "coverage/",
    "reporters": ["text", "html"],
    "ignore": ["node_modules"]
  },
  "browsers": ["phantom"]
}

/test/index_cli.js is included by test/index_cli.test.html and is the main JS file which loads all components.

However after building the project using steal-build and everything works.

  • Is there a way to know what the exact error while parsing index_cli.js
  • Why doesn’t the parsing error appear when using steal-build
project_root$ testee dist/bundles/test/index.html --coverage


  ․․․․․․,․․,,,,․․․․․․․,,,,,․,․․,․․․․․․․․․․․․․․,․․․․․,․․․,,,,,,,,,,․․,․,,,,,,,,,

------------------------------------|----------|----------|----------|----------|----------------|
File                                |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------------------------------|----------|----------|----------|----------|----------------|
 dist/bundles/test/                 |    52.48 |    33.66 |    49.35 |     52.5 |                |
  index_cli.js                      |    52.48 |    33.66 |    49.35 |     52.5 |... 8656,118657 |

#2

@Nithanaroy you can try adding DEBUG=testee:* before your testee command. That should print out a lot of debug info and could help track down the problem.

Do you always run your tests against the built version of your code? It will make the coverage info a lot easier to use if you run it against the development files.


#3

Thanks @phillipskevin, enabling DEBUG to testee surfaced the problem that it is failing while instrumenting the code. I suspect that unbuilt CanJS JavaScript file is failing due to import statements. Here is the stack trace from testee DEBUG where testee.json is the same as above,

my_project$ 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 +6ms
  testee:main starting Testee server { coverage: true,
  browsers: [ 'phantom' ],
  port: 3996,
  root: '/my_project/',
  reporter: 'Dot',
  adapter: '/testee/',
  timeout: 120,
  delay: 1000,
  tunnel: { type: 'local', port: 3996 },
  launch: { type: 'local' } } +2ms
  testee:server initializing Feathers API +1ms
  testee:hosting setting up code coverage true +32ms
  testee:hosting intializing static file server /my_project/ +0ms
  testee:main testee server started and listening +12ms
  testee:main hooking up services to Mocha reporter +0ms
  testee:reporter setting up Mocha command line reporter +1ms
  testee:reporter start +0ms

  testee:main starting up localhost tunnel { type: 'local', port: 3996 } +0ms
  testee:main localhost tunnel started on http://localhost:3996 +1ms
  testee:main using browser launcher local { type: 'local' } +0ms
  testee:main browser launcher initialized +1ms
  testee:main setting up test runner +0ms
  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=dc9fa6 { browser: 'phantom' } +3ms
  testee:runner browser instance started { browser: 'phantom' } +6ms
  testee:runner tracking test run http://localhost:3996/test/index_cli.test.html?__token=dc9fa6 { browser: 'phantom' } +1ms
  testee:html-injector injecting scripts into file /test/index_cli.test.html?__token=dc9fa6 +1s
  testee:coverage instrumenting js file for code coverage /test/index_cli.js +21ms
Failed to parse file: /test/index_cli.js
  testee:coverage instrumenting js file for code coverage /node_modules/chai/chai.js +14ms
  testee:coverage instrumenting js file for code coverage /node_modules/mocha/mocha.js +206ms
  testee:runner test http://localhost:3996/test/index_cli.test.html?__token=dc9fa6 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:43:42)
    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:43:42)\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=dc9fa6 on {"browser":"phantom"}' } +12ms
  testee:main shutting down reporter +1ms
  testee:reporter end +0ms
  testee:reporter reportErrors 1 +0ms
  testee:reporter starting run { id: 'f323c21e-459b-4f03-b469-ae28382a2393',
  title: 'General error' } +1ms
  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:43:42)
    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:43:42)\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=dc9fa6 on {"browser":"phantom"}' } +1ms
  testee:reporter starting test { id: 'ee7fd541-487f-41dc-8326-ffbf9c091c1f',
  parent: 'f323c21e-459b-4f03-b469-ae28382a2393',
  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:43:42)
       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:43:42)\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=dc9fa6 on {"browser":"phantom"}' },
  title: 'http://localhost:3996/test/index_cli.test.html?__token=dc9fa6 on {"browser":"phantom"}' } +0ms
  testee:reporter updating test { id: 'ee7fd541-487f-41dc-8326-ffbf9c091c1f',
  parent: 'f323c21e-459b-4f03-b469-ae28382a2393',
  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:43:42)
       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:43:42)\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=dc9fa6 on {"browser":"phantom"}' },
  title: 'http://localhost:3996/test/index_cli.test.html?__token=dc9fa6 on {"browser":"phantom"}' } +9ms

  !  testee:reporter updating run { status: 'finished',
  id: 'f323c21e-459b-4f03-b469-ae28382a2393',
  title: 'General error' } +1ms


  0 passing (2m)
  1 failing

  1) General error http://localhost:3996/test/index_cli.test.html?__token=dc9fa6 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:43:42)
      at ontimeout (timers.js:365:14)
      at tryOnTimeout (timers.js:237:5)
      at Timer.listOnTimeout (timers.js:207:5)



  testee:main closing server +2ms

If a raw CanJS JavaScript file (before build) cannot be instrumented, how can we run testee using development files like you suggested?


#4

A couple questions:

  • what version of testee are you using? ES6 support was added in v0.4.0.
  • have you tried increasing the timeout? With such large files, it might take > 2 mins for the instrumentation to run.

#5

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');

#6

@Nithanaroy would it be possible to push a simplified version of your project to github so we can investigate the error?


#7

Thanks @phillipskevin. I tried running the testee script again and it successfully instrumented this time but is timing out even after 2400s (default was 120).

$ DEBUG=testee:*  testee test/index_cli.test.html --coverage --config=testee.json
  testee:main running test for [ 'test/index_cli.test.html' ] [ 'phantom' ] { timeout: 2400, coverage: true, browsers: [ 'phantom' ] } +0ms
  testee:main bootstrapping Testee +4ms
  testee:main starting testee server { timeout: 2400,
  coverage: true,
  browsers: [ 'phantom' ],
  port: 3996,
  root: '/myproject',
  reporter: 'Dot',
  adapter: '/testee/',
  delay: 1000,
  tunnel: { type: 'local', port: 3996 },
  launch: { type: 'local' } } +1ms
  testee:server initializing Feathers API +0ms
  testee:hosting setting up code coverage true +32ms
  testee:hosting intializing static file server /myproject +0ms
  testee:main testee server started and listening on port 3996 +25ms
  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 +0ms
  testee:main server bootstrapped, running tests. +1ms
  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=kfc0g6 { browser: 'phantom' } +3ms
  testee:runner browser instance started { browser: 'phantom' } +15ms
  testee:runner tracking test run http://localhost:3996/test/index_cli.test.html?__token=kfc0g6 { browser: 'phantom' } +1ms
  testee:html-injector injecting scripts into file /test/index_cli.test.html?__token=kfc0g6 +957ms
  testee:coverage should instrument /node_modules/mocha/mocha.js +12ms
  testee:coverage should instrument /node_modules/chai/chai.js +3ms
  testee:coverage instrumented /myproject/node_modules/chai/chai.js +1s
  testee:coverage instrumented /myproject/node_modules/mocha/mocha.js +2s
  testee:html-injector injecting scripts into file /test/config.json +55ms
  testee:runner test http://localhost:3996/test/index_cli.test.html?__token=kfc0g6 timed out +40m
  testee:runner stopping browser instance { browser: 'phantom' } +1ms
  testee:reporter adding error to reporter { Error: Browser timed out within 2400 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 2400 seconds',
  stack: 'Error: Browser timed out within 2400 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=kfc0g6 on {"browser":"phantom"}' } +18ms
  testee:main shutting down reporter +0ms
  testee:reporter end +0ms
  testee:reporter reportErrors 1 +1ms
  testee:reporter starting run { id: 'b2d79beb-ebab-4dc9-902f-09579f22b658',
  title: 'General error' } +0ms
  testee:reporter reporting error { Error: Browser timed out within 2400 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 2400 seconds',
  stack: 'Error: Browser timed out within 2400 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=kfc0g6 on {"browser":"phantom"}' } +1ms
  testee:reporter starting test { id: '50a2f0bc-bbe1-4c35-ae6e-4ad460afdfa1',
  parent: 'b2d79beb-ebab-4dc9-902f-09579f22b658',
  status: 'failed',
  state: 'failed',
  err: 
   { Error: Browser timed out within 2400 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 2400 seconds',
     stack: 'Error: Browser timed out within 2400 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=kfc0g6 on {"browser":"phantom"}' },
  title: 'http://localhost:3996/test/index_cli.test.html?__token=kfc0g6 on {"browser":"phantom"}' } +0ms
  testee:reporter updating test { id: '50a2f0bc-bbe1-4c35-ae6e-4ad460afdfa1',
  parent: 'b2d79beb-ebab-4dc9-902f-09579f22b658',
  status: 'failed',
  state: 'failed',
  err: 
   { Error: Browser timed out within 2400 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 2400 seconds',
     stack: 'Error: Browser timed out within 2400 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=kfc0g6 on {"browser":"phantom"}' },
  title: 'http://localhost:3996/test/index_cli.test.html?__token=kfc0g6 on {"browser":"phantom"}' } +4ms

  !  testee:reporter updating run { status: 'finished',
  id: 'b2d79beb-ebab-4dc9-902f-09579f22b658',
  title: 'General error' } +1ms


  0 passing (40m)
  1 failing

  1) General error http://localhost:3996/test/index_cli.test.html?__token=kfc0g6 on {"browser":"phantom"}:
     Error: Browser timed out within 2400 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

#8

@Nithanaroy if you use the --server flag with testee and then open your test page in a regular browser (Chrome, Firefox, etc), do you see any errors? (it will use port 3996, just like when you don’t use --server).

That might give you some useful insight into what’s happening. Also, I haven’t used phantomjs in a long time, so I’m not sure how well it works.

One last thing, it looks like it’s not ignoring your node_modules folder like you had in your original config. You might want to go back to using that config instead of just coverage: true. Sometimes instrumenting dependencies can cause problems.