mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
Fix: ensure string authvalues, string header processing (#7646)
* feat: add helper to ensure string conversion for non-string values in Postman to Bruno conversion - Introduced `ensureString` function to convert numeric and non-string values to strings, defaulting null/undefined to an empty string. - Updated request handling in `importPostmanV2CollectionItem` to utilize `ensureString` for headers, parameters, and body fields. - Added tests to verify correct conversion of numeric values to strings in headers, query parameters, and body fields. * test: add test for numeric value conversion in Postman to Bruno transformation - Implemented a new test case to verify that numeric values in example request and response fields are correctly converted to strings during the Postman to Bruno conversion process. - The test checks various components including request headers, query parameters, path parameters, and body fields to ensure proper string conversion. * test: add multipart form value test for numeric conversion in Postman to Bruno transformation - Added a new test case to verify that numeric values in multipart form data are correctly converted to strings during the Postman to Bruno conversion process. - The test checks the conversion of numeric values in the request body to ensure proper handling in the transformation. * feat: enhance header parsing in Postman to Bruno conversion - Added `parseStringHeader` and `normalizeHeaders` functions to handle various header formats, including string headers and concatenated strings. - Updated the request and response handling in `importPostmanV2CollectionItem` to utilize the new header normalization logic. - Introduced tests to verify correct parsing of string headers, including cases with no values and concatenated headers. * refactor: enhance ensureString function for flexible fallback values - Updated the `ensureString` function to accept a fallback parameter, allowing for customizable default values instead of a fixed empty string for null/undefined inputs. - Modified the usage of `ensureString` in the `processAuth` function to utilize the new fallback feature for various authentication fields, improving the handling of optional values. * refactor: update ensureString function to handle empty values - Modified the `ensureString` function to return the fallback for null, undefined, or empty string values, enhancing its flexibility in handling various input scenarios. * chore: update ESLint configuration and enhance Postman to Bruno conversion tests - Added 'no-case-declarations' rule to ESLint configuration to enforce stricter coding standards. - Modified the `processAuth` function to ensure proper block scoping for OAuth2 case handling. - Improved header parsing logic to check for string type in content-type header. - Added new tests to verify conversion of numeric authentication values to strings in both array-backed and object-backed formats during Postman to Bruno transformation. * chore: update ESLint configuration to enforce stricter rules - Added 'no-case-declarations' rule to ESLint configuration to enhance code quality. - Adjusted existing rules for consistency and clarity in the configuration. --------- Co-authored-by: Bijin A B <bijin@usebruno.com>
This commit is contained in:
@@ -178,7 +178,8 @@ module.exports = runESMImports().then(() => defineConfig([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'no-undef': 'error'
|
'no-undef': 'error',
|
||||||
|
'no-case-declarations': 'error'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,15 +77,52 @@ const isItemAFolder = (item) => {
|
|||||||
/**
|
/**
|
||||||
* Postman allows non-string values (e.g. numbers) in fields like header values,
|
* Postman allows non-string values (e.g. numbers) in fields like header values,
|
||||||
* query param values, etc. Bruno expects these to be strings.
|
* query param values, etc. Bruno expects these to be strings.
|
||||||
* This helper converts non-null values to strings, defaulting null/undefined to ''.
|
* Converts non-null/non-empty values to strings, returns fallback for null/undefined/empty.
|
||||||
*/
|
*/
|
||||||
const ensureString = (value) => {
|
const ensureString = (value, fallback = '') => {
|
||||||
if (value == null) return '';
|
if (value == null || value === '') return fallback;
|
||||||
if (typeof value === 'string') return value;
|
if (typeof value === 'string') return value;
|
||||||
if (typeof value === 'object') return JSON.stringify(value);
|
if (typeof value === 'object') return JSON.stringify(value);
|
||||||
return String(value);
|
return String(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Postman's schema allows headers as strings in the format "Key: Value".
|
||||||
|
* This parses a single string header into an object.
|
||||||
|
*/
|
||||||
|
const parseStringHeader = (header) => {
|
||||||
|
const colonIndex = header.indexOf(':');
|
||||||
|
if (colonIndex === -1) return { key: header.trim(), value: '' };
|
||||||
|
return {
|
||||||
|
key: header.substring(0, colonIndex).trim(),
|
||||||
|
value: header.substring(colonIndex + 1).trim()
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Postman's schema allows the header field to be:
|
||||||
|
* 1. An array of objects (most common)
|
||||||
|
* 2. An array with mixed string and object items
|
||||||
|
* 3. A single concatenated string (e.g. "Key1: Value1\r\nKey2: Value2")
|
||||||
|
* 4. null
|
||||||
|
*
|
||||||
|
* This normalizes all forms into an array of header objects.
|
||||||
|
*/
|
||||||
|
const normalizeHeaders = (headers) => {
|
||||||
|
if (!headers) return [];
|
||||||
|
|
||||||
|
if (typeof headers === 'string') {
|
||||||
|
return headers.split(/\r?\n/).filter(Boolean).map(parseStringHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Array.isArray(headers)) return [];
|
||||||
|
|
||||||
|
return headers.map((header) => {
|
||||||
|
if (typeof header === 'string') return parseStringHeader(header);
|
||||||
|
return header;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const convertV21Auth = (array) => {
|
const convertV21Auth = (array) => {
|
||||||
return array.reduce((accumulator, currentValue) => {
|
return array.reduce((accumulator, currentValue) => {
|
||||||
accumulator[currentValue.key] = currentValue.value;
|
accumulator[currentValue.key] = currentValue.value;
|
||||||
@@ -207,59 +244,59 @@ export const processAuth = (auth, requestObject, isCollection = false) => {
|
|||||||
switch (auth.type) {
|
switch (auth.type) {
|
||||||
case AUTH_TYPES.BASIC:
|
case AUTH_TYPES.BASIC:
|
||||||
requestObject.auth.basic = {
|
requestObject.auth.basic = {
|
||||||
username: authValues.username || '',
|
username: ensureString(authValues.username),
|
||||||
password: authValues.password || ''
|
password: ensureString(authValues.password)
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.BEARER:
|
case AUTH_TYPES.BEARER:
|
||||||
requestObject.auth.bearer = {
|
requestObject.auth.bearer = {
|
||||||
token: authValues.token || ''
|
token: ensureString(authValues.token)
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.AWSV4:
|
case AUTH_TYPES.AWSV4:
|
||||||
requestObject.auth.awsv4 = {
|
requestObject.auth.awsv4 = {
|
||||||
accessKeyId: authValues.accessKey || '',
|
accessKeyId: ensureString(authValues.accessKey),
|
||||||
secretAccessKey: authValues.secretKey || '',
|
secretAccessKey: ensureString(authValues.secretKey),
|
||||||
sessionToken: authValues.sessionToken || '',
|
sessionToken: ensureString(authValues.sessionToken),
|
||||||
service: authValues.service || '',
|
service: ensureString(authValues.service),
|
||||||
region: authValues.region || '',
|
region: ensureString(authValues.region),
|
||||||
profileName: ''
|
profileName: ''
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.APIKEY:
|
case AUTH_TYPES.APIKEY:
|
||||||
requestObject.auth.apikey = {
|
requestObject.auth.apikey = {
|
||||||
key: authValues.key || '',
|
key: ensureString(authValues.key),
|
||||||
value: authValues.value?.toString() || '', // Convert the value to a string as Postman's schema does not rigidly define the type of it,
|
value: ensureString(authValues.value),
|
||||||
placement: 'header' // By default we are placing the apikey values in headers!
|
placement: 'header' // By default we are placing the apikey values in headers!
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.DIGEST:
|
case AUTH_TYPES.DIGEST:
|
||||||
requestObject.auth.digest = {
|
requestObject.auth.digest = {
|
||||||
username: authValues.username || '',
|
username: ensureString(authValues.username),
|
||||||
password: authValues.password || ''
|
password: ensureString(authValues.password)
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.OAUTH1:
|
case AUTH_TYPES.OAUTH1:
|
||||||
requestObject.auth.oauth1 = {
|
requestObject.auth.oauth1 = {
|
||||||
consumerKey: authValues.consumerKey || '',
|
consumerKey: ensureString(authValues.consumerKey),
|
||||||
consumerSecret: authValues.consumerSecret || '',
|
consumerSecret: ensureString(authValues.consumerSecret),
|
||||||
accessToken: authValues.token || '',
|
accessToken: ensureString(authValues.token),
|
||||||
accessTokenSecret: authValues.tokenSecret || '',
|
accessTokenSecret: ensureString(authValues.tokenSecret),
|
||||||
callbackUrl: authValues.callback || null,
|
callbackUrl: ensureString(authValues.callback, null),
|
||||||
verifier: authValues.verifier || null,
|
verifier: ensureString(authValues.verifier, null),
|
||||||
signatureMethod: authValues.signatureMethod || 'HMAC-SHA1',
|
signatureMethod: ensureString(authValues.signatureMethod, 'HMAC-SHA1'),
|
||||||
privateKey: authValues.privateKey || null,
|
privateKey: ensureString(authValues.privateKey, null),
|
||||||
privateKeyType: 'text',
|
privateKeyType: 'text',
|
||||||
timestamp: authValues.timestamp || null,
|
timestamp: ensureString(authValues.timestamp, null),
|
||||||
nonce: authValues.nonce || null,
|
nonce: ensureString(authValues.nonce, null),
|
||||||
version: authValues.version || '1.0',
|
version: ensureString(authValues.version, '1.0'),
|
||||||
realm: authValues.realm || null,
|
realm: ensureString(authValues.realm, null),
|
||||||
placement: authValues.addParamsToHeader === false ? 'query' : 'header',
|
placement: authValues.addParamsToHeader === false ? 'query' : 'header',
|
||||||
includeBodyHash: authValues.includeBodyHash || false
|
includeBodyHash: authValues.includeBodyHash || false
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case AUTH_TYPES.OAUTH2:
|
case AUTH_TYPES.OAUTH2: {
|
||||||
const findValueUsingKey = (key) => authValues[key] || '';
|
const findValueUsingKey = (key) => ensureString(authValues[key]);
|
||||||
|
|
||||||
// Maps Postman's grant_type to the Bruno's grantType string expected in the target object
|
// Maps Postman's grant_type to the Bruno's grantType string expected in the target object
|
||||||
const oauth2GrantTypeMaps = {
|
const oauth2GrantTypeMaps = {
|
||||||
@@ -318,6 +355,7 @@ export const processAuth = (auth, requestObject, isCollection = false) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
requestObject.auth.mode = AUTH_TYPES.NONE;
|
requestObject.auth.mode = AUTH_TYPES.NONE;
|
||||||
console.warn('Unexpected auth.type:', auth.type, '- Mode set, but no specific config generated.');
|
console.warn('Unexpected auth.type:', auth.type, '- Mode set, but no specific config generated.');
|
||||||
@@ -556,7 +594,7 @@ const importPostmanV2CollectionItem = (brunoParent, item, { useWorkers = false }
|
|||||||
brunoRequestItem.request.body.graphql = parseGraphQLRequest(i.request.body.graphql);
|
brunoRequestItem.request.body.graphql = parseGraphQLRequest(i.request.body.graphql);
|
||||||
}
|
}
|
||||||
|
|
||||||
each(i.request.header, (header) => {
|
each(normalizeHeaders(i.request.header), (header) => {
|
||||||
if (header.key == null && header.value == null) return;
|
if (header.key == null && header.value == null) return;
|
||||||
brunoRequestItem.request.headers.push({
|
brunoRequestItem.request.headers.push({
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
@@ -645,8 +683,8 @@ const importPostmanV2CollectionItem = (brunoParent, item, { useWorkers = false }
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Convert original request headers
|
// Convert original request headers
|
||||||
if (originalRequest.header && Array.isArray(originalRequest.header)) {
|
if (originalRequest.header) {
|
||||||
originalRequest.header.forEach((header) => {
|
normalizeHeaders(originalRequest.header).forEach((header) => {
|
||||||
if (header.key == null && header.value == null) return;
|
if (header.key == null && header.value == null) return;
|
||||||
example.request.headers.push({
|
example.request.headers.push({
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
@@ -746,8 +784,8 @@ const importPostmanV2CollectionItem = (brunoParent, item, { useWorkers = false }
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert response headers
|
// Convert response headers
|
||||||
if (response.header && Array.isArray(response.header)) {
|
if (response.header) {
|
||||||
response.header.forEach((header) => {
|
normalizeHeaders(response.header).forEach((header) => {
|
||||||
if (header.key == null && header.value == null) return;
|
if (header.key == null && header.value == null) return;
|
||||||
example.response.headers.push({
|
example.response.headers.push({
|
||||||
uid: uuid(),
|
uid: uuid(),
|
||||||
@@ -770,8 +808,8 @@ const importPostmanV2CollectionItem = (brunoParent, item, { useWorkers = false }
|
|||||||
|
|
||||||
const searchLanguageByHeader = (headers) => {
|
const searchLanguageByHeader = (headers) => {
|
||||||
let contentType;
|
let contentType;
|
||||||
each(headers, (header) => {
|
each(normalizeHeaders(headers), (header) => {
|
||||||
if (header.key.toLowerCase() === 'content-type' && !header.disabled) {
|
if (header.key?.toLowerCase() === 'content-type' && !header.disabled) {
|
||||||
if (typeof header.value == 'string' && /^[\w\-]+\/([\w\-]+\+)?json/.test(header.value)) {
|
if (typeof header.value == 'string' && /^[\w\-]+\/([\w\-]+\+)?json/.test(header.value)) {
|
||||||
contentType = 'json';
|
contentType = 'json';
|
||||||
} else if (typeof header.value == 'string' && /^[\w\-]+\/([\w\-]+\+)?xml/.test(header.value)) {
|
} else if (typeof header.value == 'string' && /^[\w\-]+\/([\w\-]+\+)?xml/.test(header.value)) {
|
||||||
@@ -784,14 +822,14 @@ const searchLanguageByHeader = (headers) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getBodyTypeFromContentTypeHeader = (headers) => {
|
const getBodyTypeFromContentTypeHeader = (headers) => {
|
||||||
// Check if headers is null, undefined, or not an array
|
const normalizedHeaders = normalizeHeaders(headers);
|
||||||
if (!headers || !Array.isArray(headers)) {
|
if (!normalizedHeaders.length) {
|
||||||
return 'text';
|
return 'text';
|
||||||
}
|
}
|
||||||
|
|
||||||
const contentTypeHeader = headers.find((header) => header.key.toLowerCase() === 'content-type');
|
const contentTypeHeader = normalizedHeaders.find((header) => header.key?.toLowerCase() === 'content-type');
|
||||||
if (contentTypeHeader) {
|
if (contentTypeHeader && typeof contentTypeHeader.value === 'string') {
|
||||||
const contentType = contentTypeHeader.value?.toLowerCase();
|
const contentType = contentTypeHeader.value.toLowerCase();
|
||||||
if (contentType?.includes('application/json')) {
|
if (contentType?.includes('application/json')) {
|
||||||
return 'json';
|
return 'json';
|
||||||
} else if (contentType?.includes('application/xml') || contentType?.includes('text/xml')) {
|
} else if (contentType?.includes('application/xml') || contentType?.includes('text/xml')) {
|
||||||
|
|||||||
@@ -970,6 +970,182 @@ describe('postman-collection', () => {
|
|||||||
// Example response headers
|
// Example response headers
|
||||||
expect(example.response.headers[0].value).toBe('0');
|
expect(example.response.headers[0].value).toBe('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should convert numeric auth values to strings (array-backed v2.1 format)', async () => {
|
||||||
|
const collectionWithNumericAuth = {
|
||||||
|
info: {
|
||||||
|
_postman_id: 'test-numeric-auth',
|
||||||
|
name: 'collection with numeric auth values',
|
||||||
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
||||||
|
},
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
name: 'request with numeric bearer token',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: [],
|
||||||
|
url: { raw: 'https://example.com/api' },
|
||||||
|
auth: {
|
||||||
|
type: 'bearer',
|
||||||
|
bearer: [
|
||||||
|
{ key: 'token', value: 123 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'request with numeric apikey values',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: [],
|
||||||
|
url: { raw: 'https://example.com/api' },
|
||||||
|
auth: {
|
||||||
|
type: 'apikey',
|
||||||
|
apikey: [
|
||||||
|
{ key: 'key', value: 456 },
|
||||||
|
{ key: 'value', value: 789 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const brunoCollection = await postmanToBruno(collectionWithNumericAuth);
|
||||||
|
|
||||||
|
// Bearer token should be stringified
|
||||||
|
expect(brunoCollection.items[0].request.auth.mode).toBe('bearer');
|
||||||
|
expect(brunoCollection.items[0].request.auth.bearer.token).toBe('123');
|
||||||
|
|
||||||
|
// API key fields should be stringified
|
||||||
|
expect(brunoCollection.items[1].request.auth.mode).toBe('apikey');
|
||||||
|
expect(brunoCollection.items[1].request.auth.apikey.key).toBe('456');
|
||||||
|
expect(brunoCollection.items[1].request.auth.apikey.value).toBe('789');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should convert numeric auth values to strings (object-backed format)', async () => {
|
||||||
|
const collectionWithObjectAuth = {
|
||||||
|
info: {
|
||||||
|
_postman_id: 'test-object-auth',
|
||||||
|
name: 'collection with object-backed auth',
|
||||||
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
||||||
|
},
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
name: 'request with object-backed basic auth',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: [],
|
||||||
|
url: { raw: 'https://example.com/api' },
|
||||||
|
auth: {
|
||||||
|
type: 'basic',
|
||||||
|
basic: {
|
||||||
|
username: 12345,
|
||||||
|
password: 67890
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const brunoCollection = await postmanToBruno(collectionWithObjectAuth);
|
||||||
|
|
||||||
|
expect(brunoCollection.items[0].request.auth.mode).toBe('basic');
|
||||||
|
expect(brunoCollection.items[0].request.auth.basic.username).toBe('12345');
|
||||||
|
expect(brunoCollection.items[0].request.auth.basic.password).toBe('67890');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should parse string headers in request header arrays', async () => {
|
||||||
|
const collectionWithStringHeaders = {
|
||||||
|
info: {
|
||||||
|
_postman_id: 'test-string-headers',
|
||||||
|
name: 'collection with string headers',
|
||||||
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
||||||
|
},
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
name: 'request with string headers',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: [
|
||||||
|
'Content-Type: application/json',
|
||||||
|
{ key: 'X-Custom', value: 'test' },
|
||||||
|
'Authorization: Bearer token123'
|
||||||
|
],
|
||||||
|
url: { raw: 'https://example.com/api' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const brunoCollection = await postmanToBruno(collectionWithStringHeaders);
|
||||||
|
const headers = brunoCollection.items[0].request.headers;
|
||||||
|
|
||||||
|
expect(headers).toHaveLength(3);
|
||||||
|
expect(headers[0].name).toBe('Content-Type');
|
||||||
|
expect(headers[0].value).toBe('application/json');
|
||||||
|
expect(headers[1].name).toBe('X-Custom');
|
||||||
|
expect(headers[1].value).toBe('test');
|
||||||
|
expect(headers[2].name).toBe('Authorization');
|
||||||
|
expect(headers[2].value).toBe('Bearer token123');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should parse a single concatenated string as the header field', async () => {
|
||||||
|
const collectionWithConcatenatedHeaders = {
|
||||||
|
info: {
|
||||||
|
_postman_id: 'test-concat-headers',
|
||||||
|
name: 'collection with concatenated header string',
|
||||||
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
||||||
|
},
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
name: 'request with concatenated header',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: 'Content-Type: application/json\r\nHost: example.com',
|
||||||
|
url: { raw: 'https://example.com/api' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const brunoCollection = await postmanToBruno(collectionWithConcatenatedHeaders);
|
||||||
|
const headers = brunoCollection.items[0].request.headers;
|
||||||
|
|
||||||
|
expect(headers).toHaveLength(2);
|
||||||
|
expect(headers[0].name).toBe('Content-Type');
|
||||||
|
expect(headers[0].value).toBe('application/json');
|
||||||
|
expect(headers[1].name).toBe('Host');
|
||||||
|
expect(headers[1].value).toBe('example.com');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle string headers with no value', async () => {
|
||||||
|
const collectionWithNoValueHeader = {
|
||||||
|
info: {
|
||||||
|
_postman_id: 'test-no-value-header',
|
||||||
|
name: 'collection with no-value string header',
|
||||||
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
||||||
|
},
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
name: 'request with no-value header',
|
||||||
|
request: {
|
||||||
|
method: 'GET',
|
||||||
|
header: ['X-No-Value'],
|
||||||
|
url: { raw: 'https://example.com/api' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const brunoCollection = await postmanToBruno(collectionWithNoValueHeader);
|
||||||
|
const headers = brunoCollection.items[0].request.headers;
|
||||||
|
|
||||||
|
expect(headers).toHaveLength(1);
|
||||||
|
expect(headers[0].name).toBe('X-No-Value');
|
||||||
|
expect(headers[0].value).toBe('');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Simple Collection (postman)
|
// Simple Collection (postman)
|
||||||
|
|||||||
Reference in New Issue
Block a user