From a0a316b60e797f6593281ecc39481c76fbd96844 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sun, 30 Sep 2018 16:56:02 +0200 Subject: [PATCH] :white_check_mark: Updated tests for hooks workaround --- tests/hooks.test.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/hooks.test.js b/tests/hooks.test.js index 88c117488af..5011a7107ab 100644 --- a/tests/hooks.test.js +++ b/tests/hooks.test.js @@ -42,16 +42,12 @@ let count = 0; let pre = function() { count += 5; }; -let post = function() { - count = count * -1; -}; it("Should attach the preDraft & postDraft hooks", () => { count = 0; let obj = { draft: function() {}, - pre: pre, - post: post + pre: pre }; h._hooks = { preDraft: [ @@ -70,15 +66,14 @@ it("Should attach the preDraft & postDraft hooks", () => { expect(count).to.equal(5); expect(h.attach("postDraft", obj)).to.equal(undefined); obj.draft(); - expect(count).to.equal(-5); + expect(count).to.equal(10); }); it("Should attach the preSample & postSample hooks", () => { count = 0; let obj = { sampleOption: function() {}, - pre: pre, - post: post + pre: pre }; h._hooks = { preSample: [ @@ -94,18 +89,17 @@ it("Should attach the preSample & postSample hooks", () => { }; expect(h.attach("preSample", obj)).to.equal(undefined); obj.sampleOption(); - expect(count).to.equal(15); + expect(count).to.equal(5); expect(h.attach("postSample", obj)).to.equal(undefined); obj.sampleOption(); - expect(count).to.equal(-15); + expect(count).to.equal(10); }); it("Should attach the debug hook", () => { count = 0; let obj = { debug: function() {}, - pre: pre, - post: post + pre: pre }; h._hooks = { debug: [