@contract-case/case-plugin-base
Version:
Plugin framework for writing plugins for the ContractCase test framework
22 lines • 832 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorLocationString = void 0;
const locationString_1 = require("../../context/locationString");
/**
* Constructs a string for reporting where an error happened
*
* @internal
* @param matchContext - the context for logging
* @returns
*/
const errorLocationString = (matchContext) => {
if (matchContext['_case:currentRun:context:location'].length === 0 ||
(matchContext['_case:currentRun:context:location'].length === 1 &&
matchContext['_case:currentRun:context:location'][0] === '')) {
// Hack to prevent empty locations
return '';
}
return ` (at ${(0, locationString_1.locationString)(matchContext)})`;
};
exports.errorLocationString = errorLocationString;
//# sourceMappingURL=location.js.map