fix: push event only if exec has content (#6121)

This commit is contained in:
Pragadesh-45
2025-11-19 12:09:18 +05:30
committed by GitHub
parent 0cedf48e68
commit b4d19ab8ca

View File

@@ -178,15 +178,18 @@ export const brunoToPostman = (collection) => {
exec.push(...testsBlock.split('\n'));
}
eventArray.push({
listen: 'test',
script: {
type: 'text/javascript',
packages: {},
requests: {},
exec: exec
}
});
// Only push the event if exec has content
if (exec.length > 0) {
eventArray.push({
listen: 'test',
script: {
type: 'text/javascript',
packages: {},
requests: {},
exec: exec
}
});
}
}
return eventArray;
};