react-lru
Version:
Least recently used (LRU) cache algorithm rendering of React roots
8 lines (6 loc) • 315 B
JavaScript
import jsdom from 'jsdom';
// A super simple DOM ready for React to render into
// Store this DOM and the window in global scope ready for React to access
global.document = jsdom.jsdom('<html><body></body></html>');
global.window = document.defaultView;
global.navigator = { userAgent: 'node.js' };