JKHeadley / rest-hapi

🚀 A RESTful API generator for Node.js

Home Page:https://resthapi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Log.warning is not a function" after #177

sanzoghenzo opened this issue · comments

Describe the bug
Please bear with me as I'm quite new to nodejs. Maybe this issues is due to some mess I did while upgrading my project packages to fix some vulnerability warnings...
anyway, I'm trying to make some jest unit tests, and I incurred in this problem.

PR #177 uses "Log.warning" to log warning messages, but loggin only has "warn" method.
This results in:

..\..\node_modules\rest-hapi\utilities\rest-helper-factory.js:133:16 api — Error: TypeError: Log.warning is not a function

To Reproduce
Steps to reproduce the behavior:

  1. create a jest test suite;
describe('Tunnel Rings Creation', () => {
  let server

  beforeAll(async () => {
    const Glue = require('glue')
    const RestHapi = require('rest-hapi')
    const Manifest = require('../../config/manifest.conf')
    const composeOptions = { relativeTo: '../../' }
    const manifest = Manifest.get('/')
    server = await Glue.compose(manifest, composeOptions)
  })
  [...unit tests here...]
})
  1. run jest

Expected behavior
beforeAll function passing without problems

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
I saw in #177 that the test coverage doesn't reach the Log calls.
Changing the Log.warning to Log.warn solved the problem.