-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add testing #19
Comments
@audy may look into this during the sprint |
Mocha: http://mochajs.org/ |
We'll also need to mock HTTP responses somehow. Is there a node.js thing for that? Google-first-hit says http://sinonjs.org/. |
@aid29 I added Mocha over on here https://github.com/audy/PaperBadger/tree/add-test-framework. It's only a few lines of code so I won't be heartbroken if you don't use it. |
If you need to mock HTTP/API responses, you might want to check out: |
Thanks @ibjhb -- helpful :) |
@aid29 I'm working on this but the internet says there are a thousand different ways. Frequently, I see people running the server and sending it HTTP requests with superagent. This is different from what I'm used to with Ruby (you test the HTTP methods without running the actual HTTP server). Would you recommend this approach? |
I need to do some restructuring so I can unit test methods inside of This is my idea:
I need to rewrite instead of module.exports = function(config) {
function foo(bar) {
return 'baz';
};
}; I would need to write module.exports = function(config) {
foo: function(bar) {
return "baz";
};
}; So that I am able to access these functions from my tests. Or is there another way? How about I send a PR for the basic testing skeleton w/o any tests, then work on what I have just proposed in another branch, then start adding actual tests after the first two things are done? |
added basic API testing with supertest for #19
Good place for "golden" data https://github.com/mozilla/badgekit-api-client/tree/master/docs |
So.. that got outdated quickly |
@audy Nice job for the setup and init tests ;) |
Hey @aid29! Did you run |
I forgot it :p |
It happens :) |
Use Mocha!
The text was updated successfully, but these errors were encountered: