Skip to content

Commit 1e48742

Browse files
improve Ops testing to support older versions and log data for updating tests with
1 parent dcd2f11 commit 1e48742

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/lib/utilities.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function assertOps(before, after, expectedOps) {
9494
let ops = [];
9595
let initial = make(before);
9696
let final = make(after);
97+
let finalCopy = document.importNode(final, true);
9798
Idiomorph.morph(initial, final, {
9899
callbacks: {
99100
beforeNodeMorphed: (oldNode, newNode) => {
@@ -114,7 +115,13 @@ function assertOps(before, after, expectedOps) {
114115
},
115116
},
116117
});
117-
initial.outerHTML.should.equal(final.outerHTML);
118+
if (JSON.stringify(ops) != JSON.stringify(expectedOps)) {
119+
console.log('test expected Operations is:');
120+
console.log(expectedOps);
121+
console.log('test failing Operations is:');
122+
console.log(ops);
123+
}
124+
initial.outerHTML.should.equal(finalCopy.outerHTML);
118125
ops.should.eql(expectedOps);
119126
}
120127

0 commit comments

Comments
 (0)