-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use Sinon for mocking. Fill a test gap for Linux PATH. Add tests with task runner. #7054
Conversation
I would like for tasks in this repo to be coded the same way since they are reference examples (the reason we open sourced this). I'm trying to discern whether this is a necessity and blocker or whether it's a preference. @madhurig |
@@ -19,6 +19,8 @@ | |||
"devDependencies": { | |||
"@types/mocha": "^2.2.48", | |||
"@types/mockery": "^1.4.29", |
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.
Curious, why do the typing versions not match the package versions?
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.
It looks like the @types
packages are versioned following their corresponding JS packages, but these must be lagging. They're not necessarily maintained by the authors of the JS packages. I haven't noticed any issues.
(The old "typings" files that were checked into source control have been deprecated in favor of just using NPM packages, which is what these @types
packages are.)
While working on the Conda task, it would be useful to introduced a generalized way for mocking dependencies rather than mocking ad-hoc. Sinon.JS looks like a good option here, so I refactored the tests for Use Python Version to use it to give myself a model for how to use it.
Note that this improves test coverage since Sinon will complain if you forget to check an invocation of a test spy. In particular, using Sinon caught the following test gap:
assert(prependPathSafe.calledWithExactly(path.join('findLocalTool', 'bin')));