Background
I'm writing unit tests with node js using mocha, should, hippie, request, and a few other modules. I inherited this project from someone else. We are currently running all tests using mocha commands in powershell. We want to convert this to a web client based testing suite so that one or two people can write the unit tests and everyone else can simply work on the database/api and test without having to know javascript/node/mocha etc. Unfortunately, the person I inherited this from never intended for that to happen.
What I've Tried
In my attempts at converting to a client side testing suite I have tried both browserify and RequireJS. Browserify ran in to problems with the file system (fs) and RequireJS ran in to problems with hippie (REST api calls) and module/exports calls. I also tried node-webkit (now NW.js) but that seemed like too much work for what should be much simpler. I feel like node modules should be enough.
What Should I Try?
I am about to rewrite our entire setup with express based on this post. Before I go about rewriting the testing suite (don't worry we only have about 15 unit tests, we were just getting started anyways) is there something I'm missing here? What is the best way (or some good ways) to unit test a REST API using javascript in the browser? Or, what am I doing wrong with what I've been trying?
Thanks, toshiomagic
I apologize if this question is in appropriate or I've done something wrong. This is my first post ever on stack overflow.
EDIT: I am not asking for opinions. I am asking about what you have seen work in the past and why it would be simple and useful for this application.
Aucun commentaire:
Enregistrer un commentaire