Adds deno.noColor (#1716)

This commit is contained in:
Ryan Dahl 2019-02-08 22:13:04 -05:00 committed by GitHub
parent 4c869dc885
commit 526497bc29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 9 deletions

View file

@ -8,6 +8,7 @@ from integration_tests import integration_tests
from deno_dir_test import deno_dir_test
from setup_test import setup_test
from util import build_path, enable_ansi_colors, executable_suffix, run, rmtree
from util import run_output, tests_path, green_ok
from unit_tests import unit_tests
from util_test import util_test
from benchmark_test import benchmark_test
@ -25,6 +26,19 @@ def check_exists(filename):
sys.exit(1)
def test_no_color(deno_exe):
sys.stdout.write("no_color test...")
sys.stdout.flush()
t = os.path.join(tests_path, "no_color.js")
output = run_output([deno_exe, t], merge_env={"NO_COLOR": "1"})
assert output.strip() == "noColor true"
t = os.path.join(tests_path, "no_color.js")
output = run_output([deno_exe, t])
assert output.strip() == "noColor false"
print green_ok()
def main(argv):
if len(argv) == 2:
build_dir = sys.argv[1]
@ -81,6 +95,8 @@ def main(argv):
deno_dir_test(deno_exe, deno_dir)
test_no_color(deno_exe)
if __name__ == '__main__':
sys.exit(main(sys.argv))