mocha tests breaking after upgrade to v0.10.0?

80 views
Skip to first unread message

Tristan Slominski

unread,
Mar 12, 2013, 6:43:56 PM3/12/13
to nod...@googlegroups.com
Has anyone had their mocha tests break after upgrading to v0.10.0? I'm not sure where to start

Here's what replicates problem on my machine (MacOSX):

mocha: "1.7.4"

// canary.test.js
"use strict";

var assert = require('assert'),
    http = require('http');

var test = function test(req, res) {
  res.writeHead(200);
  res.end();
};

describe( 'canary', function () {
  let OPTIONS, SERVER, TEST_HARNESS;

  beforeEach(function(done) {
    OPTIONS = {
      hostname : 'localhost',
      port : 10211,
      path : '/',
      method : 'GET'
    };

    SERVER = {};

    TEST_HARNESS = http.createServer(test.bind(SERVER));
    TEST_HARNESS.listen(10211, function() {
      done();
    });
  });

  afterEach(function(done) {
    TEST_HARNESS.close(function() {
      done();
    });
  });

  it('should return 200', function(done) {
    let req = http.request(OPTIONS, function(response) {
      assert.equal(response.statusCode, 200);
      done();
    });
    req.end();
  });
});

When I run it under node v0.8.22, I get:

./node_modules/.bin/mocha --harmony canary.test.js

  1 test complete (10 ms)

When I run it under node v0.10.0, I get:

./node_modules/.bin/mocha --harmony canary.test.js

  ✖ 1 of 1 test failed:

  1) canary "after each" hook:
     Error: timeout of 2000ms exceeded
      at null.<anonymous> (/blah/blah/node_modules/mocha/lib/runnable.js:167:14)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Tristan Slominski

unread,
Mar 12, 2013, 6:49:49 PM3/12/13
to nod...@googlegroups.com
I just upgraded to mo...@1.8.2 , the problem persists.
Reply all
Reply to author
Forward
0 new messages