mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-13 02:01:01 +01:00
45ff36d394
* [Feature] : Settings on folder level (#1334) * feat(folder_settings): enable settings tab from folder, currently not using folder.bru * feat(folder_settings): read and write in folder settings only in headers, ignore folder.bru file il requests list * feat(folder_settings): merge collection and folder settings when sending network request * feat(folder_settings): remove console, testing headers merging working fine * feat(folder_settings): add missing endl for prettier check, remove redundant imports --------- Co-authored-by: Baptiste POULAIN <baptistepoulain@MAC882.local> Co-authored-by: Anoop M D <anoop.md1421@gmail.com> * feat: folder level scripts and tests * feat: folder level variables (#2530) --------- Co-authored-by: Baptiste Poulain <64689165+bpoulaindev@users.noreply.github.com> Co-authored-by: Baptiste POULAIN <baptistepoulain@MAC882.local> Co-authored-by: lohit <lohit.jiddimani@gmail.com>
22 lines
858 B
JavaScript
22 lines
858 B
JavaScript
const { describe, it, expect } = require('@jest/globals');
|
|
|
|
const prepareRequest = require('../../src/ipc/network/prepare-request');
|
|
|
|
describe('prepare-request: prepareRequest', () => {
|
|
describe('Decomments request body', () => {
|
|
it('If request body is valid JSON', async () => {
|
|
const body = { mode: 'json', json: '{\n"test": "{{someVar}}" // comment\n}' };
|
|
const expected = { test: '{{someVar}}' };
|
|
const result = prepareRequest({ request: { body } }, {});
|
|
expect(result.data).toEqual(expected);
|
|
});
|
|
|
|
it('If request body is not valid JSON', async () => {
|
|
const body = { mode: 'json', json: '{\n"test": {{someVar}} // comment\n}' };
|
|
const expected = '{\n"test": {{someVar}} \n}';
|
|
const result = prepareRequest({ request: { body } }, {});
|
|
expect(result.data).toEqual(expected);
|
|
});
|
|
});
|
|
});
|