From 57ffc3fe746c41b2093bc97358e05f584b790ab1 Mon Sep 17 00:00:00 2001 From: Marco Burstein Date: Thu, 28 Mar 2019 10:13:06 -0700 Subject: [PATCH] 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. --- tools/test-js-with-node | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 4999a75517..80d740c4d2 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -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