busca-palabras
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "busca-palabras", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "./src/buscapalabrasengine.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "nyc mocha" | ||
}, | ||
@@ -18,4 +18,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"mocha": "^9.2.0" | ||
"mocha": "^9.2.0", | ||
"nyc": "^15.1.0" | ||
} | ||
} |
@@ -15,14 +15,15 @@ class BuscaPalabrasEngine { | ||
output(){ | ||
console.log('parcial:') | ||
output(log){ | ||
log = log || console.log; | ||
log('parcial:') | ||
for ( let linea of this.parcial ){ | ||
let lineStr = linea.map(i=>i===null?'_':i).join(' '); | ||
console.log(lineStr); | ||
log(lineStr); | ||
} | ||
console.log('\ncompleto:') | ||
log('\ncompleto:') | ||
for ( let linea of this.completo ){ | ||
let lineStr = linea.map(i=>i===null?'_':i).join(' '); | ||
console.log(lineStr); | ||
log(lineStr); | ||
} | ||
console.log(`\nsolucion:\n ${JSON.stringify(this.solucion)}`); | ||
log(`\nsolucion:\n ${JSON.stringify(this.solucion)}`); | ||
} | ||
@@ -29,0 +30,0 @@ |
@@ -205,2 +205,12 @@ let assert = require('assert'); | ||
}); | ||
it ('prueba el output',()=>{ | ||
let cuadrado = new BuscaPalabrasEngine(['uno','dos']); | ||
cuadrado.genera(); | ||
let result = ''; | ||
cuadrado.output(str=>result+=str); | ||
assert.strictEqual(result.includes('parcial:'),true); | ||
assert.strictEqual(result.includes('completo:'),true); | ||
assert.strictEqual(result.includes('solucion:'),true); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
423
16120
2
4