forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better paths handling in test runner (denoland/std#574)
Original: denoland/std@5ef42ec
- Loading branch information
1 parent
fa790e8
commit 9382f38
Showing
2 changed files
with
90 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); |