From c11a979423ea30fd72da5c74d8172d59488edaa5 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Mon, 22 Jun 2020 14:39:49 +0100 Subject: [PATCH] [issue-#3-hooks] Fixed tests --- mod.ts | 12 ++++++++++++ tests/integration/basic_test.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mod.ts b/mod.ts index f7a2ec98..e38c2eac 100644 --- a/mod.ts +++ b/mod.ts @@ -242,6 +242,7 @@ export class RhumRunner { public run(): void { const tc = new TestCase(this.plan); tc.run(); + this.deconstruct() } // FILE MARKER - METHODS - PROTECTED ///////////////////////////////////////// @@ -280,6 +281,17 @@ export class RhumRunner { return newName; } + + /** + * 'Empty' this object. After calling this, Rhum should be ready for another Plan + */ + protected deconstruct (): void { + this.passed_in_test_suite = "" + this.passed_in_test_plan = "" + this.test_plan_in_progress = "" + this.test_suite_in_progress = "" + this.plan = { suites: {} } + } } export const Rhum = new RhumRunner(); diff --git a/tests/integration/basic_test.ts b/tests/integration/basic_test.ts index 09adedda..839c4698 100644 --- a/tests/integration/basic_test.ts +++ b/tests/integration/basic_test.ts @@ -11,7 +11,7 @@ Deno.test({ async fn(): Promise { const p = await Deno.run({ cmd: [ - "deno cache example_tests/basic/tests_pass.ts && deno test --allow-run example_tests/basic/tests_pass.ts", + "deno test --allow-run example_tests/basic/tests_pass.ts", ], stdout: "piped", stderr: "piped",