Closed brianschrameck closed 2 years ago
Hey @brianschrameck this looks good! Can you please add a test? Please add it here https://github.com/twilio/twilio-video-processors.js/blob/master/tests/unit/spec/utils/support.ts#L4
Here's my suggestion for the test:
describe('For server side rendering', () => {
let originalWindow: any;
before(() => {
originalWindow = root.window;
delete root.window;
});
after(() => {
root.window = originalWindow;
});
it('should return false', () => {
assert.strictEqual(isBrowserSupported(), false);
});
});
Good call, @charliesantos. Should be all set now!
Contributing to Twilio
Pull Request Details
Description
Wraps usage of window in a typeof check to avoid trying to use window when using server-side rendering in Next.js. See #32 for more details
Burndown
Before review
npm test