Skip to content

Commit

Permalink
#279 default json compare (no instance)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Hoyer committed Aug 20, 2024
1 parent 819f9aa commit f1e2391
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/com/xceptance/neodymium/util/JsonAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ private static String htmlScript(String expectedJson, String actualJson)
+ "<script type=\"module\">"
+ "import * as jsondiffpatch from 'https://esm.sh/[email protected]';"
+ "import * as htmlFormatter from 'https://esm.sh/[email protected]/formatters/html';"

+ "const jsondiffpatchInstance = jsondiffpatch.create({"
+ "objectHash: function (obj) {return obj._id || obj.id;},"
+ "arrays: {detectMove: false}"
+ "});"

+ "const left = " + expectedJson + ";"
+ "const right = " + actualJson + ";"
+ "const delta = jsondiffpatchInstance.diff(left, right);"
+ "const delta = jsondiffpatch.diff(left, right);"
+ "document.getElementById('visual').innerHTML = htmlFormatter.format(delta, left);"
+ "</script>"
+ "<script>"
Expand Down

0 comments on commit f1e2391

Please sign in to comment.