mojito start loads tests from addons #50

Closed
add0n opened this Issue Mar 30, 2012 · 0 comments

Comments

Projects
None yet
2 participants
Contributor

add0n commented Mar 30, 2012

We made an addon and put it on app/addons/ac/

A test for it located on the sub-directory app/addons/ac/tests/ is successfully loaded and executed with the "mojito test" command.

But when the file is left on the app/addons/ac/tests/ directory, the "mojito start" command throws an error on server load:

YUI-INFO get: Loaded:
/home/julionn/host/mib/todo/addons/ac/tests/featureflipper.common-tests.js
ERROR nodejsYUI3:

ERROR nodejsYUI3: TypeError: undefined is not a function
ERROR nodejsYUI3: at CALL_NON_FUNCTION_AS_CONSTRUCTOR
(native)
ERROR nodejsYUI3: at Object.fn
(/home/julionn/host/mib/todo/addons/ac/tests/featureflipper.common-tests.js:7:17)
ERROR nodejsYUI3: at [object Object]._attach
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:7:5240)
ERROR nodejsYUI3: at [object Object]._use
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:2078)
ERROR nodejsYUI3: at [object Object].
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:8:693)
ERROR nodejsYUI3: at Object._finish
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:13:2497)
ERROR nodejsYUI3: at Object._onSuccess
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:13:2997)
ERROR nodejsYUI3: at Object.loadNext
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:14:654)
ERROR nodejsYUI3: at [object Object].
(/home/y/share/node/yui3/node_modules/yui3-core/build/yui/yui-min.js:13:4529)
ERROR nodejsYUI3: at
/home/y/share/node/yui3/lib/node-yui3.js:837:30
ERROR nodejsYUI3:

DEBUG Mojito HTTP Server initialized in 1293ms.

When the file is on the directory app/tests/, it is successfully loaded both on "test" and "start" commands. But its placement is odd: ac addons tests should be on the addons/ac/ directory, and not somewhere else.

Our suggestion is to make "mojito start" ignore either files on tests/ directories or ending with -tests.js, or both.

drewfish closed this Aug 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment