mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-25 21:55:49 +00:00
Merge pull request #6162 from bijin-bruno/fix/bruno-to-postman-converter
fix: sync bruno to postman converter with enterprise edition
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user