Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/contextProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @param {Spec} [spec]
*/
function ContextProxy(spec) {
this.spec = spec;
this.spec = spec || {};
this.config = {};
}

Expand Down
7 changes: 7 additions & 0 deletions lib/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ function patchIt(specs) {

var spec = {
name: name,
title: name,
titlePath: function() {
return this.title;
},
fullTitle: function() {
return this.title;
},
getPromise: function() {
var start = Date.now();
return createWrapper(fn, spec.ctx)().then(function(duration) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mocha.parallel",
"version": "0.15.6",
"version": "0.15.7",
"description": "Run async mocha specs in parallel",
"main": "lib/parallel.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions spec/fixtures/contextProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ parallel('suite', function() {
it('test4', function(done) {
setTimeout(done, 2500);
});

it('test5', function(done) {
assert.strictEqual('test5', this.spec.title);
assert.strictEqual('test5', this.spec.fullTitle());
assert.strictEqual('test5', this.spec.name);
assert.strictEqual('test5', this.spec.titlePath());
done();
});
});
3 changes: 2 additions & 1 deletion spec/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,13 @@ describe('parallel', function() {
stdout = stdout.replace(/\n\s+/g, ' '); // remove new lines
assert(err);
assert(!stderr.length);
assert(stdout.indexOf('2 passing') !== -1);
assert(stdout.indexOf('3 passing') !== -1);
assert(stdout.indexOf('1 pending') !== -1);
assert(stdout.indexOf('1 failing') !== -1);
assert(stdout.indexOf('1) suite test1:') !== -1);
assert(stdout.indexOf('timeout of 100ms exceeded') !== -1);


done();
});
});
Expand Down