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