Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lsmith/187868 to your computer and use it in GitHub Desktop.
Save lsmith/187868 to your computer and use it in GitHub Desktop.
// This assumes the file names are directly mappable to the module names declared
// in the YUI.add() calls inside those files.
YUI({
modules: {
'myapp.tests.core': { fullpath: '/path/to/core.js' }
}
}).use('myapp.tests.core', function (Y) {
var tests = [ '0001','0002', ... ],
i, len;
for (i = 0, len = tests.length; i < len; ++i) {
Y.config.modules[tests[i]] = { fullpath: '/standard/path/'+tests[i]+'.js' };
}
tests.push(function (Y) { // this will become the use callback
/* all tests are available here */
});
Y.use.apply(Y, tests); // loads all test modules and executes the callback above
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment