mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Mock window.scroll - otherwise JSDOM prints a not-implemented error
This commit is contained in:
parent
537c001e2f
commit
5cd7ba5afc
1 changed files with 10 additions and 0 deletions
|
|
@ -15,6 +15,16 @@ const render = (url, context) => {
|
|||
return { head, body };
|
||||
};
|
||||
|
||||
const jsdomScroll = window.scroll;
|
||||
beforeAll(() => {
|
||||
// Mock window.scroll - otherwise, Jest/JSDOM will print a not-implemented error.
|
||||
window.scroll = () => {};
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
window.scroll = jsdomScroll;
|
||||
});
|
||||
|
||||
describe('Application', () => {
|
||||
it('renders in the client without crashing', () => {
|
||||
window.google = { maps: {} };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue