mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Merge the --recompile and --reload flags (#2003)
This commit is contained in:
parent
51abcd6147
commit
c25e262b04
15 changed files with 188 additions and 194 deletions
|
@ -4,6 +4,7 @@ import os
|
|||
import sys
|
||||
from util import mkdtemp, root_path, tests_path, run, green_ok
|
||||
import shutil
|
||||
import json
|
||||
|
||||
|
||||
def fmt_test(deno_exe):
|
||||
|
@ -18,13 +19,17 @@ def fmt_test(deno_exe):
|
|||
# Set DENO_DIR to //js/ so we don't have to rely on an intenet
|
||||
# connection to download https://deno.land/std/prettier/main.ts
|
||||
deno_dir = os.path.join(root_path, "js")
|
||||
run([deno_exe, dst, "--fmt", "--allow-read"],
|
||||
merge_env={"DENO_DIR": deno_dir})
|
||||
run([deno_exe, dst, "--fmt"], merge_env={"DENO_DIR": deno_dir})
|
||||
with open(fixed_filename) as f:
|
||||
expected = f.read()
|
||||
with open(dst) as f:
|
||||
actual = f.read()
|
||||
assert expected == actual
|
||||
if expected != actual:
|
||||
print "Expected didn't match actual."
|
||||
print "expected: ", json.dumps(expected)
|
||||
print "actual: ", json.dumps(actual)
|
||||
sys.exit(1)
|
||||
|
||||
finally:
|
||||
shutil.rmtree(d)
|
||||
print green_ok()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue