From ad7721505205be39fdefe22a154a71033002016d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 23 Feb 2019 17:18:43 +0100 Subject: Add runIfMain method (denoland/deno_std#215) Original: https://github.com/denoland/deno_std/commit/817a0fb439ff92cd67da8d4f1dae12a2a08121e1 --- testing/mod.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testing/mod.ts') diff --git a/testing/mod.ts b/testing/mod.ts index e8e00ca74..45a38919a 100644 --- a/testing/mod.ts +++ b/testing/mod.ts @@ -290,3 +290,9 @@ export async function runTests() { }, 0); } } + +export async function runIfMain(meta: ImportMeta) { + if (window.location.toString() === meta.url) { + runTests(); + } +} -- cgit v1.2.3