UNPKG

jest-prettyhtml-matchers

Version:

Custom Jest snapshot matchers that use prettyhtml to format strings.

19 lines 821 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createToMatchPrettyHtmlSnapshot = void 0; const jest_snapshot_1 = require("jest-snapshot"); const create_formatter_1 = require("./create-formatter"); const createToMatchPrettyHtmlSnapshot = (format) => function toMatchPrettyHtmlSnapshot(received, options, hint) { if (typeof options === 'object') { format = (0, create_formatter_1.createFormatter)(options); } else { hint = options; } if (hint) { return jest_snapshot_1.toMatchSnapshot.call(this, format(received), hint); } return jest_snapshot_1.toMatchSnapshot.call(this, format(received)); }; exports.createToMatchPrettyHtmlSnapshot = createToMatchPrettyHtmlSnapshot; //# sourceMappingURL=create-to-match-prettyhtml-snapshot.js.map