@eduardoeb3/espree-logging-module-eduardoeb3
Version:
[](https://code.visualstudio.com/) [](https://ull-esit-pl-2021.github.io/espree-logging-module-Eduar
18 lines (17 loc) • 926 B
JavaScript
var should = require('chai').should(),
packpage = require('../lib/addLogging'),
addLogging = packpage.addLogging;
describe('Probando distintas funciones', function () {
it('Primera función', function () {
addLogging('let x = function () {}').should.equal('let x = function () {\n console.log(`Entering <anonymous function>() at line 0`);\n};');
})
it('Segunda función', function () {
addLogging('let x = function (a,b) {a*b}').should.equal('let x = function (a, b) {\n console.log(`Entering <anonymous function>(${ a }, ${ b }) at line 0`);\n a * b;\n};');
})
it('Tercera función', function () {
addLogging('let z = (e => { return e + 1 })(4)').should.equal('let z = (e => {\n console.log(`Entering <anonymous function>(${ e }) at line 0`);\n return e + 1;\n})(4);');
})
it('Cuarta función', function () {
addLogging('let x = tutu').should.equal('let x = tutu;');
})
});