I just upgraded my jovo-framework from 2.2.25 and 2.2.29 and now my unit tests are not passing.
One way that we have extended Jovo is by adding functions on the main Jovo object:
// app.js
Jovo.prototype.log = require('./jovo-ext/log.js');
//log.js
'use strict';
const logLevel = process.env.LOG_LEVEL;
const log = require('console-log-level')({ level: logLevel });
module.exports = log;
And then using it in a handler:
// handler.js
NEW_USER() {
this.log.info('newUserHandler ---> NEW_USER');
The error that I am getting in the handler is:
Cannot read property ‘info’ of undefined
What changed in the framework that would cause this?
What is the recommended way to do what I am doing?
I have 6 functions that I am adding to the root Jovo object for easy access in handler.
Thanks!