mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
Adds deno.noColor (#1716)
This commit is contained in:
parent
4c869dc885
commit
526497bc29
8 changed files with 45 additions and 9 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue