summaryrefslogtreecommitdiff
path: root/testing/runner_test.ts
blob: 9a2f433e113396cd57838c3cb66c1205bf516da9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
});