Move mediaDevices
mock out of setupManualMocks
(#11413)
* Move `mediaDevices` mock out of `setupManualMocks` This doesn't work well in test suites with multiple tests, because the `mockReturnValue` is reset for subsequent tests. In any case, having it mocked out automagically is *magical*. Let's make it opt-in. * clarify ts-ignore
This commit is contained in:
parent
d569ba0cfe
commit
3fda0299a5
9 changed files with 34 additions and 15 deletions
|
@ -91,11 +91,3 @@ window.fetch = fetchMock.sandbox();
|
|||
|
||||
// @ts-ignore
|
||||
window.Response = Response;
|
||||
|
||||
// set up mediaDevices mock
|
||||
Object.defineProperty(navigator, "mediaDevices", {
|
||||
value: {
|
||||
enumerateDevices: jest.fn().mockResolvedValue([]),
|
||||
getUserMedia: jest.fn(),
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue