From 72c35888193e0240962162fe2b2d275647ee69fc Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Sat, 27 Jan 2018 00:26:12 -0800 Subject: [PATCH] fix: always reset full context when retrying --- src/base.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/base.ts b/src/base.ts index 4437f90..bcce928 100644 --- a/src/base.ts +++ b/src/base.ts @@ -14,15 +14,14 @@ const context: Types.Context = { const base = (context: I): Types.Base => { const end = (arg1: any, cb: Types.MochaCallback) => { - context = assignWithProps({}, context) + const originalContext = context if (_.isFunction(arg1)) { cb = arg1 arg1 = undefined } if (!arg1) arg1 = context.expectation || 'test' async function run(this: mocha.ITestCallbackContext, done?: Types.MochaDone) { - // reset error if retrying - delete context.error + context = assignWithProps({}, originalContext) if (context.retries) this.retries(context.retries) if (cb) { context.chain = [...context.chain, {