Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Aug 18, 2022
1 parent 8a36da8 commit 27617ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
if (typeof vnode !== 'object') {
return encodeEntities(vnode);
}

vnode[PARENT] = parent;
if (options[DIFF]) options[DIFF](vnode);
if (options[DIFF]) options[DIFF](vnode);

if (isArray(vnode)) {
let rendered = '';
Expand Down
6 changes: 4 additions & 2 deletions test/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,9 @@ describe('render', () => {
return children;
}

let divVnode;
function Component2() {
return <div />;
return (divVnode = <div />);
}

const vnode2 = <Component2>1</Component2>;
Expand All @@ -1213,10 +1214,11 @@ describe('render', () => {
['_diff', [vnode2]],
['_render', [vnode2]],
['diffed', [vnode2]],
['_diff', [divVnode]],
['_commit', [vnode1, []]]
]);

expect(calls.length).to.equal(7);
expect(calls.length).to.equal(8);

options.__b = oldDiff;
options.__r = oldRender;
Expand Down

0 comments on commit 27617ab

Please sign in to comment.