diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-02-08 22:13:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-08 22:13:04 -0500 |
commit | 526497bc29faaf99354ee5d1628e8681d6604736 (patch) | |
tree | fb1168018acbc594cc6df0e9e2dc9e9929c01aa0 /tools/test.py | |
parent | 4c869dc8851527756b774e3ea202529aa2b3ae1e (diff) |
Adds deno.noColor (#1716)
Diffstat (limited to 'tools/test.py')
-rwxr-xr-x | tools/test.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/test.py b/tools/test.py index 246b094b7..0fe1d6a23 100755 --- a/tools/test.py +++ b/tools/test.py @@ -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)) |