Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mutation observer polyfill for jest test env #20996

Merged
merged 8 commits into from
Jul 30, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,6 @@ test('renders ControlsTab', () => {
});

describe('behavior', () => {
// Mock MutationObserver used in EuiAccordion
beforeAll(() => {
global.MutationObserver = class {
constructor() {}
disconnect() {}
observe() {}
};
});

afterAll(() => {
delete global.MutationObserver;
});

test('add control button', () => {
const component = mount(<ControlsTab
Expand Down
1 change: 1 addition & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default {
},
setupFiles: [
'<rootDir>/src/dev/jest/setup/babel_polyfill.js',
'<rootDir>/src/dev/jest/setup/polyfills.js',
'<rootDir>/src/dev/jest/setup/enzyme.js',
'<rootDir>/src/dev/jest/setup/throw_on_console_error.js',
],
Expand Down
Loading