Skip to content

Commit

Permalink
✅ Make mock serialize script behave as intended
Browse files Browse the repository at this point in the history
The serialize method can accept falsey values as the options argument and ignore it rather than
throw a type error.
  • Loading branch information
wwilsman committed Oct 19, 2020
1 parent 591cee2 commit acc3867
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sdk-utils/test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const sdk = {};

// mock serialization script
const serializeDOM = (options) => {
let doc = (options.dom || document).documentElement;
if (options.domTransformation) options.domTransformation(doc);
let { dom = document, domTransformation } = options || {};
let doc = (dom || document).documentElement;
if (domTransformation) domTransformation(doc);
return doc.outerHTML;
};

Expand Down

0 comments on commit acc3867

Please sign in to comment.