Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node-tests: Log file name and test label on failure.

Rohitt Vashishtha4a62cae0b727
diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js
index 239c365ef2d..e4eeb22d7f7 100644
--- a/frontend_tests/zjsunit/index.js
+++ b/frontend_tests/zjsunit/index.js
@@ -89,8 +89,11 @@ function short_tb(tb) {
// Set up markdown comparison helper
global.markdown_assert = require('./markdown_assert.js');
+let current_file_name;
+
function run_one_module(file) {
console.info('running tests for ' + file.name);
+ current_file_name = file.name;
require(file.full_name);
}
@@ -98,7 +101,14 @@ global.run_test = (label, f) => {
if (files.length === 1) {
console.info(' test: ' + label);
}
- f();
+ try {
+ f();
+ } catch (error) {
+ console.info('-'.repeat(50));
+ console.info(`test failed: ${current_file_name} > ${label}`);
+ console.info();
+ throw error;
+ }
// defensively reset blueslip after each test.
blueslip.reset();
};