unmock-core
Version:
[][npmjs] [](https://circleci.com/gh/unmock/unmock-js) [](h
24 lines • 841 B
JavaScript
;
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