-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(time): report correct time since Jasmine v2.9.0 #197
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,14 @@ describe('jasmine adapter', function () { | |
it('should report time for every spec', function () { | ||
var counter = 3 | ||
|
||
function copySpecResult() { | ||
var copy = {} | ||
for(var i in spec.result) { | ||
copy[i] = spec.result[i] | ||
} | ||
return copy | ||
} | ||
|
||
spyOn(Date.prototype, 'getTime').and.callFake(function () { | ||
counter += 1 | ||
return counter | ||
|
@@ -262,8 +270,8 @@ describe('jasmine adapter', function () { | |
expect(result.time).toBe(1) // 4 - 3 | ||
}) | ||
|
||
reporter.specStarted(spec.result) | ||
reporter.specDone(spec.result) | ||
reporter.specStarted(copySpecResult()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will that work? We could do something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! I've changed it: reporter.specStarted(Object.assign({}, spec.result))
reporter.specDone(Object.assign({}, spec.result)) |
||
reporter.specDone(copySpecResult()) | ||
|
||
expect(karma.result).toHaveBeenCalled() | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can just be
But in any case pass the
spec
as an arg to make it clearer.