test: fix unit tests on windows machines (#3678)

This commit is contained in:
Erez Rokah
2020-04-30 15:27:44 +03:00
committed by GitHub
parent 3e5ff71846
commit 02f3cdd102
2 changed files with 17 additions and 9 deletions

View File

@ -4,6 +4,13 @@ import fetch from 'node-fetch';
import * as emotion from 'emotion';
import { createSerializer } from 'jest-emotion';
jest.mock('path', () => {
const actual = jest.requireActual('path');
return {
...actual.posix,
};
});
window.fetch = fetch;
window.URL.createObjectURL = jest.fn();
expect.addSnapshotSerializer(createSerializer(emotion));