0

I am working on a node.js + express application.

And what I am trying to do is defining a strong test base to work with.

So I read this really nice article which explains how to develop a simple application with ruby on rails.

And I read the following lines of code which inspired me a lot :

visit signup_path
fill_in "Name",         with: "Example User"
fill_in "Email",        with: "user@example.com"
fill_in "Password",     with: "foobar"
fill_in "Confirmation", with: "foobar"
click_button "Create my account"

So here I come to the point. Is there a way to write a similar piece of code using node.js and its dependencies ?

I am currently using mocha 1.x, should 1.2.x and supertest 0.6.x but they didn't seems to fit my needs.

Manuel Leduc
  • 1,849
  • 3
  • 23
  • 39

3 Answers3

2

What you are looking for is something like zombie.js or selenium (js-webdriver) which test your code from the browsers pov. I recommend taking a look at zombie.js first.

Chris
  • 4,204
  • 1
  • 25
  • 30
  • And it seems to be well integrated with mocha (another related question here : http://stackoverflow.com/a/9444550/657524). – Manuel Leduc May 29 '13 at 11:32
1

Have you looked at Jasmine. Nettut's has a great tutorial http://net.tutsplus.com/tutorials/javascript-ajax/testing-your-javascript-with-jasmine/

Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
0

Mocha.js is a popular choice as well, especially if you're into Coffeescript

Sagish
  • 1,065
  • 8
  • 13