@shelex/cypress-allure-plugin
Version:
allure reporting plugin for cypress
28 lines (23 loc) • 652 B
JavaScript
const logger = require('../reporter/debug');
const clearEmptyHookSteps = (test) => {
if (!test.steps.length) {
return test;
}
test.steps = test.steps.reduce((steps, step) => {
if (
['"before each" hook', '"after each" hook'].includes(step.name) &&
step.steps.length === 0
) {
logger.writer(
'removing empty step "%s" from test "%s"',
step.name,
test.uuid
);
return steps;
}
steps.push(step);
return steps;
}, []);
return test;
};
module.exports = { clearEmptyHookSteps };