From bce0ecbdb8af0d6f5c089c7f2139b58ff2f60624 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 28 May 2018 14:06:25 -0400 Subject: [PATCH] Move testdata/fetch.ts to tests.ts --- testdata/fetch.ts | 12 ------------ testdata/fetch.ts.out | 2 -- tests.ts | 6 ++++++ 3 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 testdata/fetch.ts delete mode 100644 testdata/fetch.ts.out diff --git a/testdata/fetch.ts b/testdata/fetch.ts deleted file mode 100644 index 24d4139039..0000000000 --- a/testdata/fetch.ts +++ /dev/null @@ -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"); diff --git a/testdata/fetch.ts.out b/testdata/fetch.ts.out deleted file mode 100644 index b8ca9c5982..0000000000 --- a/testdata/fetch.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -fetch started -expect deno: deno diff --git a/tests.ts b/tests.ts index 59aeafcf83..702f6406d4 100644 --- a/tests.ts +++ b/tests.ts @@ -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"); +});