mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-30 05:09:05 +00:00
19 lines
460 B
JavaScript
19 lines
460 B
JavaScript
|
import asyncConfig from './asyncConfig';
|
||
|
import fields from './fields';
|
||
|
|
||
|
jest.mock('./fields');
|
||
|
|
||
|
fields.mockImplementation(() => [Promise.resolve({
|
||
|
someField: 'newValue',
|
||
|
})]);
|
||
|
|
||
|
test('it should merge the result of the promise', () => {
|
||
|
const param = { another: 'field', someField: 'oldValue' };
|
||
|
const expected = { another: 'field', someField: 'newValue' };
|
||
|
|
||
|
return asyncConfig(param).then((result) => {
|
||
|
expect(result).toEqual(expected);
|
||
|
});
|
||
|
});
|
||
|
|