Rename deno prefetch to deno fetch (#2210)

This commit is contained in:
Bartek Iwańczuk 2019-04-25 19:47:33 +02:00 committed by Ryan Dahl
parent 098d6fffab
commit b7d8a0c6f6
5 changed files with 14 additions and 14 deletions

30
tools/fetch_test.py Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import os
import sys
from util import mkdtemp, tests_path, run_output, green_ok
import shutil
def fetch_test(deno_exe):
sys.stdout.write("fetch_test...")
sys.stdout.flush()
deno_dir = mkdtemp()
try:
t = os.path.join(tests_path, "006_url_imports.ts")
output = run_output([deno_exe, "fetch", t],
merge_env={"DENO_DIR": deno_dir})
assert output == ""
# Check that we actually did the prefetch.
os.path.exists(
os.path.join(deno_dir,
"deps/http/localhost_PORT4545/tests/subdir/mod2.ts"))
finally:
shutil.rmtree(deno_dir)
print green_ok()
if __name__ == "__main__":
fetch_test(sys.argv[1])