mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Fix tests
This commit is contained in:
parent
8be0f36c71
commit
5cd80bbb2c
@ -22,6 +22,7 @@ describe('init()', () => {
|
||||
expect(Object.keys(result)).toEqual(['request']);
|
||||
expect(Object.keys(result.request).sort()).toEqual([
|
||||
'addHeader',
|
||||
'getBodyText',
|
||||
'getEnvironment',
|
||||
'getEnvironmentVariable',
|
||||
'getHeader',
|
||||
@ -32,6 +33,7 @@ describe('init()', () => {
|
||||
'getUrl',
|
||||
'hasHeader',
|
||||
'removeHeader',
|
||||
'setBodyText',
|
||||
'setCookie',
|
||||
'setHeader',
|
||||
'settingDisableRenderRequestBody',
|
||||
@ -55,6 +57,7 @@ describe('request.*', () => {
|
||||
_id: 'req_1',
|
||||
parentId: 'wrk_1',
|
||||
name: 'My Request',
|
||||
body: {text: 'body'},
|
||||
headers: [
|
||||
{name: 'hello', value: 'world'},
|
||||
{name: 'Content-Type', value: 'application/json'}
|
||||
@ -68,6 +71,7 @@ describe('request.*', () => {
|
||||
expect(result.request.getName()).toBe('My Request');
|
||||
expect(result.request.getUrl()).toBe('');
|
||||
expect(result.request.getMethod()).toBe('GET');
|
||||
expect(result.request.getBodyText()).toBe('body');
|
||||
});
|
||||
|
||||
it('works for headers', async () => {
|
||||
|
@ -16,7 +16,7 @@ export function init (
|
||||
return renderedRequest._id;
|
||||
},
|
||||
getBodyText (): string {
|
||||
return renderedRequest.body.text;
|
||||
return renderedRequest.body.text || '';
|
||||
},
|
||||
getName (): string {
|
||||
return renderedRequest.name;
|
||||
|
Loading…
Reference in New Issue
Block a user