-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathssr.test.js
More file actions
34 lines (28 loc) · 1.07 KB
/
ssr.test.js
File metadata and controls
34 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @jest-environment node
*/
// #251 - Test SSR compatibility where Element is not defined
describe('SSR compatibility', () => {
test('propTypes.js can be imported in Node.js environment without Element global', () => {
// In Node.js environment (jest-environment: node), Element is not defined
expect(typeof Element).toBe('undefined');
// This should not throw ReferenceError: Element is not defined
expect(() => {
require('../lib/propTypes');
}).not.toThrow();
});
test('Resizable.js can be imported in Node.js environment without Element global', () => {
expect(typeof Element).toBe('undefined');
// This should not throw ReferenceError: Element is not defined
expect(() => {
require('../lib/Resizable');
}).not.toThrow();
});
test('ResizableBox.js can be imported in Node.js environment without Element global', () => {
expect(typeof Element).toBe('undefined');
// This should not throw ReferenceError: Element is not defined
expect(() => {
require('../lib/ResizableBox');
}).not.toThrow();
});
});