1
0
mirror of https://github.com/jiahaog/Nativefier synced 2024-06-26 07:38:59 +02:00
Nativefier/src/options/asyncConfig.test.js
2018-05-24 22:46:49 -07:00

19 lines
462 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', async () => {
const param = { another: 'field', someField: 'oldValue' };
const expected = { another: 'field', someField: 'newValue' };
const result = await asyncConfig(param);
expect(result).toEqual(expected);
});