Skip to content

Commit f298d72

Browse files
committed
context should not exist on before/after tests.
1 parent 65c1ce3 commit f298d72

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function Test(title, fn) {
2626
this.assertCount = 0;
2727
this.planCount = null;
2828
this.duration = null;
29-
this.context = {};
3029

3130
// store the time point before test execution
3231
// to calculate the total time spent in test

test/hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ test('shared context', function (t) {
273273
var runner = new Runner();
274274

275275
runner.before(function (a) {
276-
a.is(a.context.arr, undefined);
277-
a.context.arr = [];
276+
a.is(a.context, undefined);
277+
a.context = {arr: []};
278278
a.end();
279279
});
280280

281281
runner.after(function (a) {
282-
a.is(a.context.arr, undefined);
282+
a.is(a.context, undefined);
283283
a.end();
284284
});
285285

0 commit comments

Comments
 (0)