xolvio / rtd

DEPRECATED: The Test Runner for Meteor
164 stars 37 forks source link

How to use underscore in the unit tests? #144

Closed AdrienLemaire closed 10 years ago

AdrienLemaire commented 10 years ago

I tried without success to set a path in karma files to one of the numerous underscore.js files available in RTD nodemodules, but everytime I run my tests, the underscore functions (eg `.isNumber,_.clone`) are undefined.

Here are example:

error

Am I missing something? How do you get underscore to work in the unit tests?

AdrienLemaire commented 10 years ago

bump on this issue

JustinSGray commented 10 years ago

I'm having a similar problem, but with a package installed via from Meteorite

geekyme commented 10 years ago

store your underscore.js library inside test/lib

then within your karma.conf.js file, add 'test/lib/*/.js' just under the stubs:

// list of files / patterns to load in the browser
        files : [
            // stubs come first so they can be available when all the units need them
            'test/rtd/lib/*-stubs.js',
            'test/rtd/lib/*-stubs.coffee',
            'test/lib/**/*.js',