From f0109e29babc7b15ed65e56caacb90772890dab9 Mon Sep 17 00:00:00 2001 From: James Talmage Date: Sat, 21 Nov 2015 17:38:23 -0500 Subject: [PATCH] context should not exist on before/after tests. (cherry picked from commit f298d72) --- lib/test.js | 1 - test/hooks.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/test.js b/lib/test.js index 60c410b1a..a5bb9ac25 100644 --- a/lib/test.js +++ b/lib/test.js @@ -26,7 +26,6 @@ function Test(title, fn) { this.assertCount = 0; this.planCount = null; this.duration = null; - this.context = {}; // test type, can be: test, hook, eachHook this.type = 'test'; diff --git a/test/hooks.js b/test/hooks.js index 7a1d3b5c5..ddfc16096 100644 --- a/test/hooks.js +++ b/test/hooks.js @@ -273,13 +273,13 @@ test('shared context', function (t) { var runner = new Runner(); runner.addBeforeHook(function (a) { - a.is(a.context.arr, undefined); - a.context.arr = []; + a.is(a.context, undefined); + a.context = {arr: []}; a.end(); }); runner.addAfterHook(function (a) { - a.is(a.context.arr, undefined); + a.is(a.context, undefined); a.end(); });