tests: Update JS Node tests to support TypeScript.

Currently, the `test-js-with-node` tests append ".js" to filenames
without an extension. Since Typescript is now also supported, it can
produce results such as "dict.ts.js". To remedy this, check for ".ts"
files as well.
This commit is contained in:
Marco Burstein 2019-03-28 10:13:06 -07:00 committed by Tim Abbott
parent bafcf3c664
commit 57ffc3fe74
1 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,9 @@ INDEX_JS = 'frontend_tests/zjsunit/index.js'
# Add ".js" to the end of all the file arguments, so index.js
# can actually verify if the file exists or not.
for index, arg in enumerate(options.args):
if not arg.endswith('.js'):
if not arg.endswith('.js') and not arg.endswith('.ts'):
# If it doesn't end with ".js" or ".ts", assume it is a JS file,
# since most files are currently JS files.
options.args[index] = arg + '.js'
individual_files = options.args