Hi,
There's a few things you might want to change for this to run properly, especially through the server for your CI environment. The require call in the test is not recommended as it's going to be entirely random whether or not Buster will pick up your tests. The correct way to define an asynchronous test case is the following:
buster.testCase("View tests", function (run) {
require(['module/view'], function(View) {
"use strict";
run(function () {
return {
"subview rendered?": function () {
}
};
});
});
});
Now, I realise that this is not the most sexy layout, you've got a lot of indents here. That's why the buster-amd[1] extension was developed. Unfortunately, I think buster-amd is temporarily out of commission due to a change in the latest buster release. It also does not yet work with the static html page. So for now, I'd recommend the above, possibly wrapped in a simple abstraction:
function asyncTestCase(name, dependencies, callback) {
buster.testCase(name, function (run) {
require(dependencies, function () {
var deps = arguments;
run(function () { callback.apply(this, deps); });
});
});
}
So your tests will look like:
asyncTestCase("View tests", ["modules/view"], function (View) {
return {
"something something": function () {}
});
You don't need the spec directory when you already have the test directory. Just put buster.js configuration in test/buster.js.
The static file can be generated for you from buster.js by using `buster static`, but then you'd have to install buster.
Regarding your CI environment, at the moment you cannot auto-run browsers, although it is an issue we intend to fix. The best you can do is:
buster server
Open browser at
http://localhost:1111/capture, which will auto-capture it.
buster test
Hope this helps.
Christian
--
MVH
Christian