From 6a0e32dc35dd27807f4b95556ddb8c1fe26fae89 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 24 Jan 2019 16:25:13 -0500 Subject: [PATCH] testing: Don't automatically run on import (denoland/deno_std#129) Original: https://github.com/denoland/deno_std/commit/ec1675a8cad2b9044ac8cf205920c0f230127133 --- test.ts | 2 ++ testing/main.ts | 3 +++ testing/mod.ts | 4 +--- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 testing/main.ts diff --git a/test.ts b/test.ts index b9fcd74e08..6850fc5af2 100755 --- a/test.ts +++ b/test.ts @@ -23,3 +23,5 @@ import "testing/test.ts"; import "textproto/test.ts"; import "ws/sha1_test.ts"; import "ws/test.ts"; + +import "testing/main.ts"; diff --git a/testing/main.ts b/testing/main.ts new file mode 100644 index 0000000000..d7e7036976 --- /dev/null +++ b/testing/main.ts @@ -0,0 +1,3 @@ +// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +import { runTests } from "mod.ts"; +runTests(); diff --git a/testing/mod.ts b/testing/mod.ts index 42f3939c53..762d37c48a 100644 --- a/testing/mod.ts +++ b/testing/mod.ts @@ -238,7 +238,7 @@ function green_ok() { return FG_GREEN + "ok" + RESET; } -async function runTests() { +export async function runTests() { let passed = 0; let failed = 0; @@ -283,5 +283,3 @@ async function runTests() { }, 0); } } - -setTimeout(runTests, 0);