chore(operators-js): Fix getFromObject mock for _global.

This commit is contained in:
Gervwyk 2022-01-04 14:40:43 +02:00
parent c6fcbc865d
commit 8b74f68397

View File

@ -14,10 +14,11 @@
limitations under the License.
*/
import global from './global.js';
jest.mock('@lowdefy/operators');
let lowdefyOperators;
let global;
const input = {
arrayIndices: [0],
location: 'location',
@ -25,8 +26,12 @@ const input = {
params: 'params',
};
test('global calls getFromObject', () => {
const lowdefyOperators = import('@lowdefy/operators');
beforeEach(async () => {
lowdefyOperators = await import('@lowdefy/operators');
global = (await import('./global.js')).default;
});
test('global calls getFromObject', async () => {
global(input);
expect(lowdefyOperators.getFromObject.mock.calls).toEqual([
[