UNPKG

approvals

Version:

Approval Tests Library - Capturing Human Intelligence

24 lines (23 loc) 976 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const AUtils_1 = require("../../AUtils"); const GenericDiffReporterBase_1 = require("../GenericDiffReporterBase"); class GitDiffReporter extends GenericDiffReporterBase_1.GenericDiffReporterBase { constructor() { super("GitDiff"); this.exePath = (0, AUtils_1.searchForExecutable)("Git/cmd", "git"); } report(approved, received, options) { options = options || {}; (0, AUtils_1.createEmptyFileIfNotExists)(approved); console.log(this.exePath); options.cmdArgs = ["diff", "--no-index", "--", received, approved]; // force gitdiff to run synchronously so our console output // stays in order of test execution. const newOptions = Object.assign({}, options, { blockUntilReporterExits: true, }); return super.report(approved, received, newOptions); } } exports.default = GitDiffReporter;