-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests (#18) and mocking NCBI API #21
Conversation
This allows to record http request response into fixtures files and later use those to mock the external API (NCBI) so that tests don't break all the time due to NCBI side changes rather than ours
9c1c852
to
9a38f26
Compare
cli.js
Outdated
@@ -46,8 +46,8 @@ if (command === 'link') { | |||
var arg2 = argv._[2] | |||
var arg3 = argv._[3] | |||
} else { | |||
var arg2 = argv._.slice(2).join(' ') | |||
var arg3 = null | |||
arg2 = argv._.slice(2).join(' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables aren't declared if command !== 'link'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are declared because JavaScript doesn't have block scope, only function scope, so they get hoisted. However, this might be confusing so I'll fix it. Thanks for noticing it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Tests should no longer break often due to NCBI changes and we can once in a while update the mock data automatically to make sure our code is still relevant.