Merge pull request #8375 from DenisPostu/master

Added missing 'returnValue' to jasmine.CallInfo
This commit is contained in:
Masahiro Wakame
2016-03-04 23:01:43 +09:00
2 changed files with 5 additions and 3 deletions

View File

@@ -512,21 +512,21 @@ describe("A spy", function () {
it("can provide the context and arguments to all calls", function () {
foo.setBar(123);
expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123] }]);
expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]);
});
it("has a shortcut to the most recent call", function () {
foo.setBar(123);
foo.setBar(456, "baz");
expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"] });
expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined });
});
it("has a shortcut to the first call", function () {
foo.setBar(123);
foo.setBar(456, "baz");
expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123] });
expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined });
});
it("can be reset", function () {

View File

@@ -456,6 +456,8 @@ declare module jasmine {
object: any;
/** All arguments passed to the call */
args: any[];
/** The return value of the call */
returnValue: any;
}
interface Util {