How can I include utility functions from another file into a Sproutcore unit test file?

Posted by Lauri on Stack Overflow See other posts from Stack Overflow or by Lauri
Published on 2010-04-01T12:05:53Z Indexed on 2010/04/02 8:13 UTC
Read the original article Hit count: 229

Lets say I have a few utility functions in file tests/utils/functions.js. I would like to use these functions from several unit test files.

However, I'm not able to use them as the Sproutcore build system does not include any external files into the html page used to run the unit tests. Only application code and the code from the unit tests to be run are included.

So is it possible to somehow include Javascript files to be used in unit test files in Sproutcore?

I could add the functions.js file into some other directory inside my application to be able to use them. However, this is not what I want to do as the utility functions are useless in final production build and would only make my application larger.

© Stack Overflow or respective owner

Related posts about sproutcore

Related posts about JavaScript