forked from PluralFlux/PluralFlux
removing then/catch from messageHelper.test.js
This commit is contained in:
@@ -3,9 +3,11 @@ env.config();
|
|||||||
|
|
||||||
|
|
||||||
jest.mock('../../src/helpers/memberHelper.js', () => {
|
jest.mock('../../src/helpers/memberHelper.js', () => {
|
||||||
return {memberHelper: {
|
return {
|
||||||
getMembersByAuthor: jest.fn()
|
memberHelper: {
|
||||||
}}
|
getMembersByAuthor: jest.fn()
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const {memberHelper} = require("../../src/helpers/memberHelper.js");
|
const {memberHelper} = require("../../src/helpers/memberHelper.js");
|
||||||
@@ -72,17 +74,16 @@ describe('messageHelper', () => {
|
|||||||
['2', 'hello', null, undefined],
|
['2', 'hello', null, undefined],
|
||||||
['2', '--hello', null, undefined],
|
['2', '--hello', null, undefined],
|
||||||
['2', 'hello', attachmentUrl, undefined],
|
['2', 'hello', attachmentUrl, undefined],
|
||||||
['2', '--hello', attachmentUrl,undefined],
|
['2', '--hello', attachmentUrl, undefined],
|
||||||
['3', 'hello', null, {}],
|
['3', 'hello', null, {}],
|
||||||
['3', '--hello', null, {}],
|
['3', '--hello', null, {}],
|
||||||
['3', 'hello', attachmentUrl, {}],
|
['3', 'hello', attachmentUrl, {}],
|
||||||
['3', '--hello', attachmentUrl,{}],
|
['3', '--hello', attachmentUrl, {}],
|
||||||
])('ID %s with string %s returns correct proxy', async(specificAuthorId, content, attachmentUrl, expected) => {
|
])('ID %s with string %s returns correct proxy', async (specificAuthorId, content, attachmentUrl, expected) => {
|
||||||
// Act
|
// Act
|
||||||
return messageHelper.parseProxyTags(specificAuthorId, content, attachmentUrl).then((res) => {
|
const res = await messageHelper.parseProxyTags(specificAuthorId, content, attachmentUrl);
|
||||||
// Assert
|
// Assert
|
||||||
expect(res).toEqual(expected);
|
expect(res).toEqual(expected);
|
||||||
})
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user