diff --git a/packages/bruno-converters/src/postman/bruno-to-postman.js b/packages/bruno-converters/src/postman/bruno-to-postman.js index 3ee944719..42f1e8e1a 100644 --- a/packages/bruno-converters/src/postman/bruno-to-postman.js +++ b/packages/bruno-converters/src/postman/bruno-to-postman.js @@ -1,5 +1,5 @@ import map from 'lodash/map'; -import { deleteSecretsInEnvs, deleteUidsInEnvs, deleteUidsInItems } from '../common'; +import { deleteSecretsInEnvs, deleteUidsInEnvs, deleteUidsInItems, isItemARequest } from '../common'; /** * Transforms a given URL string into an object representing the protocol, host, path, query, and variables. @@ -467,7 +467,7 @@ export const brunoToPostman = (collection) => { item: generateItemSection(item.items), ...(folderEvents.length ? { event: folderEvents } : {}) }; - } else { + } else if (isItemARequest(item)) { const requestEvents = generateEventSection(item.request); const postmanItem = { name: item.name || 'Untitled Request', @@ -482,7 +482,8 @@ export const brunoToPostman = (collection) => { return postmanItem; } - }); + return null; + }).filter(Boolean); }; const collectionToExport = {}; collectionToExport.info = generateInfoSection(); diff --git a/packages/bruno-converters/tests/bruno/bruno-to-postman-with-tests.spec.js b/packages/bruno-converters/tests/bruno/bruno-to-postman-with-tests.spec.js index 30bf33466..e8d91e053 100644 --- a/packages/bruno-converters/tests/bruno/bruno-to-postman-with-tests.spec.js +++ b/packages/bruno-converters/tests/bruno/bruno-to-postman-with-tests.spec.js @@ -7,7 +7,7 @@ describe('Bruno to Postman Converter with Tests and Scripts', () => { items: [ { name: 'Request With Scripts and Tests', - type: 'http', + type: 'http-request', filename: 'request-with-scripts.bru', seq: 1, settings: {