Comparing version 0.5.5 to 0.5.6
@@ -33,2 +33,3 @@ var events = require('events'), | ||
b.vows.forEach(function (vow) { vow.status = null }); | ||
b.teardowns = []; | ||
}); | ||
@@ -48,3 +49,4 @@ }; | ||
pending: 0, | ||
total: 0 | ||
total: 0, | ||
teardowns: [] | ||
}); | ||
@@ -167,3 +169,3 @@ return this; | ||
}); | ||
topic.setMaxListeners(Infinity); | ||
if (topic.setMaxListeners) { topic.setMaxListeners(Infinity) } | ||
@@ -213,7 +215,5 @@ // Now run the tests, or sub-contexts | ||
// Teardown | ||
topic.on("success", function () { | ||
if (ctx.tests.teardown) { | ||
ctx.tests.teardown.apply(ctx.env, ctx.topics); | ||
} | ||
}); | ||
if (ctx.tests.teardown) { | ||
batch.teardowns.push(ctx); | ||
} | ||
if (! ctx.tests._skip) { | ||
@@ -313,2 +313,10 @@ batch.remaining --; | ||
// Run teardowns | ||
if (batch.teardowns) { | ||
for (var i = batch.teardowns.length - 1, ctx; i >= 0; i--) { | ||
ctx = batch.teardowns[i]; | ||
ctx.tests.teardown.apply(ctx.env, ctx.topics); | ||
} | ||
} | ||
batch.status = 'end'; | ||
@@ -315,0 +323,0 @@ batch.suite.report(['end']); |
@@ -12,4 +12,4 @@ { | ||
"directories" : { "test": "./test" }, | ||
"version" : "0.5.5", | ||
"engines" : {"node": ">=0.3.6"} | ||
"version" : "0.5.6", | ||
"engines" : {"node": ">=0.2.6"} | ||
} |
@@ -339,2 +339,13 @@ var path = require('path'); | ||
topic.flag = false; | ||
}, | ||
"with a subcontext" : { | ||
topic: function (topic) { | ||
var that = this; | ||
process.nextTick(function () { | ||
that.callback(null, topic); | ||
}); | ||
}, | ||
"Waits for the subcontext before teardown" : function(topic) { | ||
assert.isTrue(topic.flag); | ||
} | ||
} | ||
@@ -341,0 +352,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
66602
20
1457
0