-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
Commonjs-ified sinon.spy #920
Conversation
* commonjs-ified sinon.format
* sinon/core.format is the last non-cjs piece
@@ -14,6 +14,8 @@ module.exports = exports = require("./sinon/util/core"); | |||
|
|||
exports.extend = require("./sinon/extend"); | |||
exports.match = match; | |||
exports.spy = require("./sinon/spy"); | |||
exports.spyCall = require("./sinon/call"); |
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.
Exposed solely for testing purposes? It seems like an internal tool only though.
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.
I think this was used internally. I think it can be removed since it would be released with a major. @cjohansen do you recall?
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.
Not a part of the external API at least.
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's exposed publicly, because that's how it is tested (see call-test.js
).
Just rerunning the tests. 😉 |
@fearphage this is a very nice pull request. I love how easy it is to follow along, when there are separate commits for each step. 👍 |
@mroderick Thank you. I appreciate it. |
Very nice, indeed. Are you intending to clear up the "format coupling" within this pull request or is this going to happen separately? |
I think the tests need to be refactored in a big way to fix the call+format tests. I think this code is good to merge. I wasn't planning on decoupling them in this PR. I'm always open to suggestions though. |
So what's the word, folks? |
Sorry for keeping you waiting. Very nice work, indeed. |
FYI, you can now import this separately from everything else. $ node
> var foo = require('sinon/lib/sinon/spy')();
> foo.callCount
1 I haven't used it, but I know it can be included at least. I was wondering if anyone considered pulling out the separate pieces into different repos or at least different npm targets. Imagine Thanks everyone. |
Awesome! That's definitely something I've thought about more than once. |
Updated
sinon.spy
to make use of cjs'd modules and to export itself using commonjs styling.Notable changes
sinon.format
to core in the process. Core seems like a placeholder that will one day go awaysinon/core
include fromspy
(related tosinon.format
)