Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,44 @@ Four different parts of this exercise. You can look at the documentation, and co

This is a straightforward one. We'll just take a simple function and test the hell outta it. Hey, you always want to make sure the code you wrote works!

* [Function code](http://conancat.github.com/node-test-examples/helpers.html)
* [Test code](http://conancat.github.com/node-test-examples/helpers.test.html)
* [Function code](http://conancat.github.io/node-test-examples/helpers.html)
* [Test code](http://conancat.github.io/node-test-examples/helpers.test.html)

### Database testing

We have two simple functions that interact with the database -- `get` and `createOrUpdate`. Let's setup and create mocks, run tests to make sure things are working properly, and nicely clean things up after we're done.

* [Function code](http://conancat.github.com/node-test-examples/users.html)
* [Test code](http://conancat.github.com/node-test-examples/users.test.html)
* [Function code](http://conancat.github.io/node-test-examples/users.html)
* [Test code](http://conancat.github.io/node-test-examples/users.test.html)

### API Testing

So we have REST api and we want to make sure it works. Let's start a server, make calls to it and check if it returns the desired results!

* [Function code](http://conancat.github.com/node-test-examples/submit.html)
* [Test code](http://conancat.github.com/node-test-examples/api.test.html)
* [Function code](http://conancat.github.io/node-test-examples/submit.html)
* [Test code](http://conancat.github.io/node-test-examples/api.test.html)

### Headless Browser Testing

Sometimes it's too slow to need to open every single page on your website every single time you want to deploy a site, just to see if everything is working. Let's start a server, get a headless zombie ghost phantom tester thing to go through the site and see if things are working!

* [Test code](http://conancat.github.com/node-test-examples/browser.test.html)
* [Test code](http://conancat.github.io/node-test-examples/browser.test.html)

Remember to start the server yourself at least once to go through and see what's happening on the site, before we try to emulate things with our little phantom!

### Little extras

* Writing a [configuration file](http://conancat.github.com/node-test.examples/conf.html)
* Some [test helpers](http://conancat.github.com/node-test.examples/testHelpers.html)
* Writing a [configuration file](http://conancat.github.io/node-test.examples/conf.html)
* Some [test helpers](http://conancat.github.io/node-test.examples/testHelpers.html)


## Tools that we'll need

* [Mocha](http://visionmedia.github.com/mocha/), our testing framework of choice
* [Mocha](http://visionmedia.github.io/mocha/), our testing framework of choice
* [Chai](http://chaijs.com/) as our assertion library
* [PhantomJS](http://phantomjs.org/) as our ghostly, headless browser testing tool

And of course, I'd assume that you already have some prior experience with awesome tools like [Express](http://expressjs.com/), [Request](https://github.com/mikeal/request), [Async](https://github.com/caolan/async) and so forth. If you haven't, go check it out!
And of course, I'd assume that you already have some prior experience with awesome tools like [Express](http://expressjs.com/), [Request](https://github.com/request/request), [Async](https://github.com/caolan/async) and so forth. If you haven't, go check it out!

This project is written in [CoffeeScript](http://coffeescript.org/), but the concepts presented are absolutely the same with what you're going to do with JavaScript. As long as you understand what's happening, you can apply it anywhere!

Expand Down Expand Up @@ -103,4 +103,4 @@ You can type `cake` in the root folder to see more details.


## Contact Me
If you have any questions, you can also find me on [Twitter](http://twitter.com/conancat) or email me at conancat@gmail.com. I won't bite, I promise!
If you have any questions, you can also find me on [Twitter](https://twitter.com/conancat) or email me at conancat@gmail.com. I won't bite, I promise!