Open daguar opened 11 years ago
+1. I'll look into it.
FWIW, we used Jasmine for our original Louisville project. Feel free to reference and steal from https://github.com/codeforamerica/hermes-be/tree/master/spec/lib.
Shaunak
Do I want to use this? https://github.com/mhevery/jasmine-node
I may need some help with figuring out how you get it to test against the server.
Correct. Specifically:
package.json
file, add a section that looks like this:"devDependencies": {
"jasmine-node": "1.8.x"
}
(You might want to check the latest major version of jasmine-node
on http://npmjs.org at the time of actually working on this issue).
This says that only in development environments (such as your laptop), download and install jasmine-node
as a dependency of this project whenever npm install
is run.
spec
in the base directory of your project and add your test files to it. Make sure to end your test filenames in .spec.js
or else Jasmine won't detect them as test files.jasmine-node spec
.Hope that helps. Let me know if you more questions.
Thanks @ycombinator. That definitely got me started. I've got a basic suite of tests up there at https://github.com/louh/naics-api/blob/master/spec/query.spec.js, that definitely doesn't cover all the possible results but I think it's a good enough start and to make sure I'm not doing anything wrong. There's also a test in there that was deliberately meant to fail because it's functionality that should be present but isn't.
Jasmine is a nice little Javascript behavior-testing framework (similar to RSpec in Ruby) that lets you describe your code in very human-readable terms.
http://pivotal.github.io/jasmine/
Given a lot of the structure of issues I've seen so far, I think it'd be a great enhancement to add tests that cover these features using Jasmine.