summaryrefslogtreecommitdiff
path: root/testing/runner_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-08-30 19:43:32 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-08-30 13:43:32 -0400
commit9382f38c7c43698e95f61e1394217480f4df46ad (patch)
tree9fe1c11c115e35d940aca335417e36d4a08ccc23 /testing/runner_test.ts
parentfa790e8b528fa86c5e8fb621c6e06bdeaa64199b (diff)
fix: better paths handling in test runner (denoland/deno_std#574)
Original: https://github.com/denoland/deno_std/commit/5ef42ece7dfc314dbc5f4ecd30bdecdec4ee4336
Diffstat (limited to 'testing/runner_test.ts')
-rw-r--r--testing/runner_test.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/runner_test.ts b/testing/runner_test.ts
new file mode 100644
index 000000000..9a2f433e1
--- /dev/null
+++ b/testing/runner_test.ts
@@ -0,0 +1,26 @@
+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+import { test } from "./mod.ts";
+import { assertEquals } from "../testing/asserts.ts";
+import { getMatchingUrls } from "./runner.ts";
+
+const fileName = window.location.href;
+const TEST_ROOT_PATH = fileName.slice(7, fileName.indexOf("testing")) + "fmt";
+
+test(async function getMatchingUrlsRemote(): Promise<void> {
+ const matches = [
+ "https://deno.land/std/fmt/colors_test.ts",
+ "http://deno.land/std/fmt/printf_test.ts"
+ ];
+
+ const urls = await getMatchingUrls(matches, [], TEST_ROOT_PATH);
+ assertEquals(urls, matches);
+});
+
+test(async function getMatchingUrlsLocal(): Promise<void> {
+ const urls = await getMatchingUrls(
+ ["fmt/*_test.ts"],
+ ["colors*"],
+ TEST_ROOT_PATH
+ );
+ assertEquals(urls.length, 1);
+});