bkad / prat

group chat with markdown served over websockets
11 stars 6 forks source link

Need tests #27

Open cespare opened 12 years ago

cespare commented 12 years ago

This project needs tests. Right now, they would be valuable for the webserver code. The client code will likely become complex enough that you'll want coffeescript tests as well.

It sucks to work on a project when it's complex enough that you have no way of knowing that you're not breaking stuff.

bkad commented 12 years ago

yup, agreed

mdietz commented 11 years ago

This is becoming more of an issue. I'm starting to really worry about regression errors every time I push code to the master branch.

bkad commented 11 years ago

Not sure what to do about automatic testing of the frontend JS (where half the code and most of the complexity lives).

I can, however, write some integration tests using a websocket client (perfect opportunity to introduce a new language to the prat stack!!) that assumes a running server and makes assertions against sending and receiving messages.

cespare commented 11 years ago

JS unit tests?

mdietz commented 11 years ago

http://effectif.com/coffeescript/qunit-boilerplate ?

bkad commented 11 years ago

I like unit tests for complex logic with defined sets of inputs and outputs. Most of the JS functions we have don't return anything, their correctness is defined by whether or not the right side effects happened. Tests that check for side effects tend to be fragile and hard to get right.