mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-29 23:54:24 +00:00
* fix: only get the values if the settings exist * Apply suggestion from @Copilot * refactor: move status line to the query bar --------- Co-authored-by: Bijin A B <bijin@usebruno.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
42 lines
731 B
JavaScript
42 lines
731 B
JavaScript
const parser = require('../src/bruToJson');
|
|
|
|
describe('bruToJson parser', () => {
|
|
describe('body:ws', () => {
|
|
it('infers message and settings | smoke', () => {
|
|
const input = `
|
|
body:ws {
|
|
type: json
|
|
name: message 1
|
|
content: '''
|
|
{"foo":"bar"}
|
|
'''
|
|
}
|
|
|
|
settings {
|
|
timeout: 30
|
|
}
|
|
`;
|
|
|
|
const expected = {
|
|
body: {
|
|
mode: 'ws',
|
|
ws: [
|
|
{
|
|
content: '{"foo":"bar"}',
|
|
name: 'message 1',
|
|
type: 'json'
|
|
}
|
|
]
|
|
},
|
|
settings: {
|
|
encodeUrl: false,
|
|
timeout: 30
|
|
}
|
|
};
|
|
|
|
const output = parser(input);
|
|
expect(output).toEqual(expected);
|
|
});
|
|
});
|
|
});
|