Move clock from global to jasmine; provide a function to access the clock.

This commit is contained in:
Davis W. Frank
2013-10-10 16:24:58 -07:00
parent c28c124f58
commit 5aaafed4d8
5 changed files with 42 additions and 19 deletions

View File

@@ -41,20 +41,10 @@ var jasmineInterface = {
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({
timer: new jasmine.Timer()
})
@@ -67,6 +57,18 @@ function extend(destination, source) {
return destination;
}
jasmine.addCustomEqualityTester = function(tester) {
env.addCustomEqualityTester(tester);
};
jasmine.addMatchers = function(matchers) {
return env.addMatchers(matchers);
};
jasmine.clock = function() {
return env.clock;
};
// Jasmine "runner"
function executeSpecs(specs, done, isVerbose, showColors) {
global.jasmine = jasmine;