2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-11 16:42:21 +00:00
nativefier/src/options/asyncConfig.test.js

19 lines
460 B
JavaScript
Raw Normal View History

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);
});
});