Here's what I'm trying to accomplish:
// file: test/runner.js
JS.Packages(function() { with(this) {
autoload(/.*Spec$/, {from: 'test/specs/model' });
autoload(/.*Spec$/, {from: 'test/specs/lib' });
}});
JS.require('JS.Test', function() {
var tests = ['ModelSpec', 'ValidatableSpec', 'ErrorsStackSpec', 'EnvironmentSpec'];
tests.push(JS.Test.method('autorun'));
JS.require.apply(JS, tests);
});
The result is this: Cannot find module './test/specs/model/environment_spec'
If I comment out the first autoload and remove everything except EnvironmentSpec from the tests array, it works - but obviously only running EnvironmentSpec.
So it looks like JS.require is only talking the first autoload seriously. Not sure what's going on.