If you really don't want to expose them, you could put them into a separate 
file and export them there. Then require that file with the tests and with 
the main module.

On Thursday, May 3, 2012 8:04:47 PM UTC-7, P. Douglas Reeder wrote:
>
> Writing functional tests for the functions exposed by a module is 
> straightforward, using any of the many TDD framework for Node. 
>
> However, it's not clear what the best approach is, to writing unit 
> tests for functions that are not exposed by a module. 
>
> One possibility is to write unit tests as part of the module and 
> expose one or more test methods.  However, it's not clear how unit 
> tests could then be excluded from a production module. 
>
> What is the usual approach? is it possible to write a test submodule 
> and cleanly exclude it from a production module?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to