redom / nodom

fake DOM for RE:DOM
ISC License
150 stars 13 forks source link

Attributes not attached to the nodes #20

Open jmaguirrei opened 5 years ago

jmaguirrei commented 5 years ago

I found HTML not generating the attributes, for example:

This:

mount(document.body, el('h1', { id: 'x', style: 'cursor: pointer;' }, 'Hello world!'));
console.log(document.body.outerHTML);

Give me this output

<body><h1>Hello world!</h1></body>

Initialized as

const { Document, SVGElement } = require('nodom');
global.document = new Document();
global.SVGElement = SVGElement;

JSDOM seems to do the same job correctly.