diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteer index f22bec9569..91fe2e5676 100755 --- a/tools/test-js-with-puppeteer +++ b/tools/test-js-with-puppeteer @@ -111,9 +111,12 @@ def run_tests(files: Iterable[str], external_host: str, loop: int = 1) -> None: response = input('Press Enter to run tests, "q" to quit: ') ret = 1 failed_test_num = 0 - while response != "q" and failed_test_num != -1: + while response != "q": ret, failed_test_num = run_tests(failed_test_num) - if ret != 0: + if ret == 0: + failed_test_num = 0 + response = input('Tests succeeded. Press Enter to re-run tests, "q" to quit: ') + else: response = input('Tests failed. Press Enter to re-run tests, "q" to quit: ') else: ret = 1