mirror of https://github.com/zulip/zulip.git
node-tests: Log file name and test label on failure.
This commit is contained in:
parent
1d3234b6c6
commit
4a62cae0b7
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue