Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('putout: run-plugins: template: log: object', (t) => {
const namespace = stub();
assign(namespace, {
enabled: true,
});
const debug = stub().returns(namespace);
mockRequire('debug', debug);
const log = reRequire('./log');
log(Identifier('hello'), Identifier('world'));
const expected = `Identifier: "hello" = Identifier: "world"`;
t.ok(namespace.calledWith(expected));
t.end();
});
module.exports.fix = (path) => {
const id = Identifier(path.node.arguments[0].value);
path.replaceWith(path.node.callee);
path.property.replaceWith(id);
};
module.exports.fix = ({path, calleePath}) => {
calleePath.node.property = Identifier('noTransformCode');
path.node.arguments.pop();
};