-
-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR tests are run in JSDOM env and rely on document #1577
Comments
it would be great if import { hydrate } from 'inferno-hydrate';
import jsdom from 'jsdom'
const dom = new jsdom.JSDOM(
'<!DOCTYPE html><body><div></div></body>')
hydrate(
createElement('div', { className: 'test' }, "I'm a child!"),
dom.window.document.body.firstChild,
dom // optional, configurable dom definition
); This would allow import { hydrate } from 'inferno-hydrate';
import jsdom from 'jsdom'
const dom = new jsdom.JSDOM(
'<!DOCTYPE html><body><div></div></body>')
global.window = dom.window
global.document = dom.window.document
hydrate(
createElement('div', { className: 'test' }, "I'm a child!"),
dom.window.document.body.firstChild); |
Good idea. Do you want to submit a PR for it? |
This could probably be a inferno-wide option to set the DOM. |
thanks for the welcoming reply I will think about it |
Observed Behaviour
All server rendering tests are run with JSDOM-environment exposing
document
which isn't available in node during SSR.Expected Current Behaviour
We should run *.spec.server.jsx with separate config file and
testEnvironment: "node"
The text was updated successfully, but these errors were encountered: