Skip to content

Commit b4d19ab

Browse files
authored
fix: push event only if exec has content (usebruno#6121)
1 parent 0cedf48 commit b4d19ab

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/bruno-converters/src/postman/bruno-to-postman.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,18 @@ export const brunoToPostman = (collection) => {
178178
exec.push(...testsBlock.split('\n'));
179179
}
180180

181-
eventArray.push({
182-
listen: 'test',
183-
script: {
184-
type: 'text/javascript',
185-
packages: {},
186-
requests: {},
187-
exec: exec
188-
}
189-
});
181+
// Only push the event if exec has content
182+
if (exec.length > 0) {
183+
eventArray.push({
184+
listen: 'test',
185+
script: {
186+
type: 'text/javascript',
187+
packages: {},
188+
requests: {},
189+
exec: exec
190+
}
191+
});
192+
}
190193
}
191194
return eventArray;
192195
};

0 commit comments

Comments
 (0)