2018-08-23 19:47:43 -04:00
|
|
|
#!/usr/bin/env python
|
2019-01-21 14:03:30 -05:00
|
|
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-08-23 19:47:43 -04:00
|
|
|
import sys
|
2018-10-11 16:56:50 -04:00
|
|
|
import subprocess
|
|
|
|
|
2019-05-30 16:40:40 -04:00
|
|
|
from http_server import spawn
|
|
|
|
from util import DenoTestCase, test_main
|
2018-10-15 16:46:42 -04:00
|
|
|
|
2019-05-08 19:15:24 -04:00
|
|
|
|
2019-05-30 16:40:40 -04:00
|
|
|
class JsUnitTests(DenoTestCase):
|
|
|
|
def test_unit_test_runner(self):
|
|
|
|
cmd = [
|
|
|
|
self.deno_exe, "run", "--reload", "--allow-run",
|
|
|
|
"js/unit_test_runner.ts"
|
|
|
|
]
|
|
|
|
process = subprocess.Popen(
|
|
|
|
cmd, bufsize=1, universal_newlines=True, stderr=subprocess.STDOUT)
|
2018-08-23 19:47:43 -04:00
|
|
|
|
2019-05-30 16:40:40 -04:00
|
|
|
process.wait()
|
|
|
|
errcode = process.returncode
|
|
|
|
if errcode != 0:
|
|
|
|
raise AssertionError(
|
|
|
|
"js/unit_test_runner.ts exited with exit code %s" % errcode)
|
2018-10-15 16:46:42 -04:00
|
|
|
|
2019-05-08 19:15:24 -04:00
|
|
|
|
2019-05-30 16:40:40 -04:00
|
|
|
if __name__ == '__main__':
|
|
|
|
with spawn():
|
|
|
|
test_main()
|