mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
Move testdata/fetch.ts to tests.ts
This commit is contained in:
parent
33f488354c
commit
bce0ecbdb8
3 changed files with 6 additions and 14 deletions
12
testdata/fetch.ts
vendored
12
testdata/fetch.ts
vendored
|
@ -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");
|
2
testdata/fetch.ts.out
vendored
2
testdata/fetch.ts.out
vendored
|
@ -1,2 +0,0 @@
|
|||
fetch started
|
||||
expect deno: deno
|
6
tests.ts
6
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");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue