UNPKG

unmock-core

Version:

[![npm](https://img.shields.io/npm/v/unmock-core.svg)][npmjs] [![CircleCI](https://circleci.com/gh/unmock/unmock-js.svg?style=svg)](https://circleci.com/gh/unmock/unmock-js) [![codecov](https://codecov.io/gh/unmock/unmock-js/branch/dev/graph/badge.svg)](h

24 lines 841 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = require("debug"); const expect = require("expect"); const debugLog = debug_1.default("unmock:snapshotter:expect-extend"); const MATCHER_PASS = { pass: true }; exports.unmockSnapshot = (writer) => { return function (obj) { const snapshotInput = { testPath: this.testPath || "", currentTestName: this.currentTestName || "", data: obj, timestamp: new Date(), }; debugLog(`Snapshotting: ${JSON.stringify(snapshotInput)}`); writer.write(snapshotInput); return MATCHER_PASS; }; }; expect.addSnapshotSerializer({ print: (val) => JSON.stringify(val, undefined, 2), test: (val) => val.req && val.req.method, }); //# sourceMappingURL=expect-extend.js.map