1c19b8e38a
- Jasmine gem allows us to specify a path to jasmine.yml via ENV [finish #58126010]
14 lines
319 B
JavaScript
14 lines
319 B
JavaScript
describe("Timer", function() {
|
|
it("reports the time elapsed", function() {
|
|
var fakeNow = jasmine.createSpy('fake Date.now'),
|
|
timer = new j$.Timer({now: fakeNow});
|
|
|
|
fakeNow.and.returnValue(100);
|
|
timer.start();
|
|
|
|
fakeNow.and.returnValue(200);
|
|
|
|
expect(timer.elapsed()).toEqual(100);
|
|
});
|
|
});
|