unit test methods

This commit is contained in:
Leifer Mendez
2022-10-29 18:11:55 +02:00
parent 96b8a7626c
commit 3e2869b54a
5 changed files with 226 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
const { generateRef } = require('../utils')
const addAnswer = (inCtx) => (message, options) => {
const addAnswer = (inCtx) => (answer, options) => {
const lastCtx = inCtx.hasOwnProperty('ctx') ? inCtx.ctx : inCtx
const ctxAnswer = () => {
const ref = generateRef()
@@ -8,7 +8,7 @@ const addAnswer = (inCtx) => (message, options) => {
* Se guarda en db
*/
return { ...lastCtx, ref, message }
return { ...lastCtx, ref, answer }
}
const ctx = ctxAnswer()