1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Move testdata/fetch.ts to tests.ts

This commit is contained in:
Ryan Dahl 2018-05-28 14:06:25 -04:00
parent 33f488354c
commit bce0ecbdb8
3 changed files with 6 additions and 14 deletions

12
testdata/fetch.ts vendored
View file

@ -1,12 +0,0 @@
const request = async () => {
const response = await fetch('http://localhost:4545/package.json');
const json = await response.json();
console.log("expect deno:", json.name);
if (json.name !== "deno") {
throw Error("bad value" + json.name);
}
}
request();
console.log("fetch started");

View file

@ -1,2 +0,0 @@
fetch started
expect deno: deno

View file

@ -20,3 +20,9 @@ test(async function tests_readFileSync() {
const pkg = JSON.parse(json);
assertEqual(pkg.name, "deno");
});
test(async function tests_fetch() {
const response = await fetch('http://localhost:4545/package.json');
const json = await response.json();
assertEqual(json.name, "deno");
});