mirror of https://github.com/zulip/zulip.git
tests: Make test-js-with-node handling smarter.
Added support for passing a filename without `.js` suffix. This then fixed the issue of no complaints for invalid test files. Now, throws an error for invalid test files. Fixes #8579.
This commit is contained in:
parent
eb0da20b78
commit
ed9eb3bdb5
|
@ -33,7 +33,7 @@ exports.find_files_to_run = function () {
|
|||
}
|
||||
|
||||
testsDifference.forEach(function (filename) {
|
||||
console.log(filename + " does not exist");
|
||||
throw (filename + ".js does not exist");
|
||||
});
|
||||
|
||||
tests.sort();
|
||||
|
|
|
@ -93,6 +93,12 @@ os.environ['TZ'] = 'UTC'
|
|||
|
||||
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'):
|
||||
options.args[index] = arg + '.js'
|
||||
|
||||
# The index.js test runner is the real "driver" here, and we launch
|
||||
# with either istanbul or node, depending on whether we want coverage
|
||||
# reports. Running under istanbul is slower and creates funny
|
||||
|
|
Loading…
Reference in New Issue