We put our required 3rd-party libs in a 'unit/stubs' folder. Any mocks/stubs from our internal app go there as well. Load order can get tricky so we name the explicitly name the files to load in the order we want, like this: a1-jquery.min.js
, a2-bootstrap-mocks.js
.
We're still using a very early version of RTD but here's the relevant karma conf:
// list of files / patterns to load in the browser
files = [
JASMINE,
JASMINE_ADAPTER,
// stubs come first so they can be available when all the units need them
'test/rtd/lib/*-stubs.js',
'test/unit/stubs/*.js',
// simulate loading order of meteor folder structure
'app/lib/**/*.js',
'app/server/lib/**/*.js',
'app/client/lib/**/*.js',
// now all the dependencies have been sorted, the app code can be loaded
'app/**/*.js',
'test/unit/**/*.js'
];
// list of files to exclude
exclude = [
'app/lib/3rd/**/*.js',
'**/istanbul-middleware-port/**/*',
'karma.conf.js',
'app/.meteor/local'
];