Skip to content

Commit

Permalink
test: Include navigator global for render test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed Dec 14, 2024
1 parent 9420194 commit 3d213a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/vgplot/test/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,29 @@ beforeEach(() => {
{ pretendToBeVisual: true }
);

// emulate browser environment globals
globalThis.window = dom.window;
globalThis.document = dom.window.document;
globalThis.navigator ??= dom.window.navigator;
globalThis.requestAnimationFrame = window.requestAnimationFrame;
});

afterEach(() => {
// remove browser environment globals
delete globalThis.window;
delete globalThis.document;
delete globalThis.requestAnimationFrame;
if (globalThis.navigator === globalThis.window.navigator) {
delete globalThis.navigator;
}
delete globalThis.document;
delete globalThis.window;
});

describe('render', () => {
it('should render the density1d spec', () => {
return renderTest('density1d');
}, 10_000);
});
it('should render the airline-travelers spec', () => {
return renderTest('airline-travelers');
}, 10_000);
});
});

async function renderTest(name) {
Expand Down

0 comments on commit 3d213a7

Please sign in to comment.