UNPKG

@shelex/cypress-allure-plugin

Version:
28 lines (23 loc) 652 B
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 };