happy-dom
happy-dom copied to clipboard
innerHTML and outterHTML case that differs from browser behavior
Code
test('mytest', () => {
const div = document.createElement('div')
div.innerText = '<b>a</b>'
expect(div.innerHTML).toBe('<b>a</b>')
expect(div.outerHTML).toBe('<div><b>a</b></div>')
})
Expected behavior In a typical browser environment, this test case should pass. But it didn't.
AssertionError: expected '<b>a</b>' to be '<b>a</b>' // Object.is equality
- Expected
+ Received
- <b>a</b>
+ <b>a</b>
Device
happy-dom
version: 14.12.3