mirror of
https://github.com/gundb/panic-server.git
synced 2026-05-07 03:00:26 -04:00
Add UID to each test, save test name when available
Each test now has a unique ID to reference by. This will be useful for reporters and tracking of "done" events. Also, each test now saves the name it's been given.
This commit is contained in:
@@ -14,7 +14,6 @@ function done() {
|
||||
}
|
||||
|
||||
function Test(name, cb, time) {
|
||||
var ctx;
|
||||
if (!(this instanceof Test)) {
|
||||
return new Test(name, cb);
|
||||
}
|
||||
@@ -22,7 +21,11 @@ function Test(name, cb, time) {
|
||||
cb = name;
|
||||
}
|
||||
|
||||
ctx = new Context(this);
|
||||
if (typeof name === 'string') {
|
||||
this.description = name;
|
||||
}
|
||||
|
||||
var ctx = new Context(this);
|
||||
stack.push(ctx);
|
||||
cb.call(ctx, ctx);
|
||||
bump(ctx, done);
|
||||
|
||||
Reference in New Issue
Block a user