jest-codemods
Version:
Codemods for migrating test files to Jest
14 lines (13 loc) • 704 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = logWarning;
var chalk_1 = __importDefault(require("chalk"));
function logWarning(fileInfo, msg, node) {
// If the node has been previously modified by the codemod (for instance, when using
// destructuring) the node doesn't have a loc anymore
var lineInfo = node && node.value.loc ? " line ".concat(node.value.loc.start.line) : '';
console.warn(chalk_1.default.red("jest-codemods warning: (".concat(fileInfo.path).concat(lineInfo, ") ").concat(msg)));
}
;