Skip to content

Commit

Permalink
allow others to update URL.revokeObjectURL property if needed (elas…
Browse files Browse the repository at this point in the history
…tic#73639)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored and mistic committed Jul 29, 2020
1 parent cde5e2e commit ab5096b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ describe('GetCsvReportPanelAction', () => {

beforeAll(() => {
if (typeof window.URL.revokeObjectURL === 'undefined') {
Object.defineProperty(window.URL, 'revokeObjectURL', { value: () => {} });
Object.defineProperty(window.URL, 'revokeObjectURL', {
configurable: true,
writable: true,
value: () => {},
});
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { AutoDownload } from './auto_download';

describe('AutoDownload', () => {
beforeEach(() => {
// our DOM environment lacks this function that our component needs
Object.defineProperty(globalNode.window.URL, 'revokeObjectURL', {
configurable: true,
writable: true,
value: jest.fn(),
});
Expand Down

0 comments on commit ab5096b

Please sign in to comment.