Testing server-side code

9 views
Skip to first unread message

Kevin Dente

unread,
Dec 20, 2011, 3:19:06 PM12/20/11
to RailwayJS
I'm trying to write some tests for server side objects (model objects
currently, though more will come). However, I'd like to use Mocha
instead of NodeUnit. Is there any information about how to set up a
test environment so I can do this? I looked through the generated
test_helper.js file for some ideas, but it's hard to figure out what's
relevant and what isn't.

As an example issue i'm hitting, I'm using custom schemas with
Mongoose (non-juggling). I can't create models in my tests because the
"customSchema" function that schema.js calls isn't available.
Presumably there's some bootstrap code that needs to be run first, but
it's not clear to me what that is or how to run it.

Gelnior

unread,
Mar 29, 2012, 10:52:56 AM3/29/12
to rail...@googlegroups.com
Hi all,

+1 with this post. I would like to use Mocha to test my railway app. It requires that I deal a little bit with schema to run my tests. But Mocha does not have access to it. Is there any simple way to bring my Mocha tests in railway environment ?

I use Moongoose too through Juggling DB.

Reply all
Reply to author
Forward
0 new messages