mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
9382f38c7c
Original: 5ef42ece7d
26 lines
811 B
TypeScript
26 lines
811 B
TypeScript
// 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);
|
|
});
|