Skip to content

Commit 293acf2

Browse files
committed
Merge pull request #251 from jamestalmage/remove-context-on-before-after-hooks
context should not exist on before/after tests.
2 parents 2185921 + f0109e2 commit 293acf2

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
// test type, can be: test, hook, eachHook
3231
this.type = '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.addBeforeHook(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.addAfterHook(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)