Skip to content

Fixed unit tests - #2

Open
davidsims9t wants to merge 2 commits into
suryajak:masterfrom
davidsims9t:dsims/fix-unit-tests
Open

Fixed unit tests#2
davidsims9t wants to merge 2 commits into
suryajak:masterfrom
davidsims9t:dsims/fix-unit-tests

Conversation

@davidsims9t

@davidsims9t davidsims9t commented Feb 13, 2019

Copy link
Copy Markdown

Requirements

  • Run npm test in core/jazz_logs

Description of the Change

I fixed the four broken unit tests in this branch as well as upgraded sinon to the latest version. I changed the request() call to request.post() so that I could stub this request in the unit test. request() apparently is impossible to stub which you can read about here: https://stackoverflow.com/questions/20050507/creating-request-stub-with-sinon-in-mocha

I replaced sinon.stub(object, "method", func) with sinon.stub(object, "method").callsFake(func) as the first method is deprecated.

I added LOG_LEVELS to the test config JSON file. This is required, otherwise map() blows up and makes the tests fail.

Benefits

The unit tests pass

Possible Drawbacks

I'm not sure if there's any potential issues by using request.post() instead of request(), but there shouldn't be.

Applicable Issues

suryajak pushed a commit that referenced this pull request Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant