Files
jasmine/lib/jasmine-core/boot/boot.js
Davis W. Frank & Rajan Agaskar a526ebf261 Re-add async support (achieved via done callbacks)
- TODO: pull out queueRunner into a new object.
2012-12-07 16:36:24 -08:00

75 lines
1.7 KiB
JavaScript

(function() {
var env = jasmine.getEnv();
var jasmineInterface = {
describe: function(description, specDefinitions) {
return env.describe(description, specDefinitions);
},
xdescribe: function(description, specDefinitions) {
return env.xdescribe(description, specDefinitions);
},
it: function(desc, func) {
return env.it(desc, func);
},
xit: function(desc, func) {
return env.xit(desc, func);
},
beforeEach: function(beforeEachFunction) {
return env.beforeEach(beforeEachFunction);
},
afterEach: function(afterEachFunction) {
return env.afterEach(afterEachFunction);
},
expect: function(actual) {
return env.expect(actual);
},
addMatchers: function(matchers) {
return env.addMatchers(matchers);
},
spyOn: function(obj, methodName) {
return env.spyOn(obj, methodName);
},
clock: env.clock,
setTimeout: env.clock.setTimeout,
clearTimeout: env.clock.clearTimeout,
setInterval: env.clock.setInterval,
clearInterval: env.clock.clearInterval,
jsApiReporter: new jasmine.JsApiReporter(jasmine)
};
if (typeof window == "undefined" && typeof exports == "object") {
jasmine.util.extend(exports, jasmineInterface);
} else {
jasmine.util.extend(window, jasmineInterface);
}
var htmlReporter = new jasmine.HtmlReporter(null, jasmine);
env.addReporter(jasmineInterface.jsApiReporter);
env.addReporter(htmlReporter);
env.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
env.execute();
};
}());