IE doesn't support .name on a function

This commit is contained in:
Gregg Van Hove
2018-05-03 17:34:15 -07:00
parent 01a1113387
commit f7097281c9

View File

@@ -24,7 +24,12 @@ describe('Spies', function () {
var fn = function test() {};
var spy = env.createSpy(fn);
expect(spy.and.identity).toEqual("test");
// IE doesn't do `.name`
if (fn.name === "test") {
expect(spy.and.identity).toEqual("test");
} else {
expect(spy.and.identity).toEqual("unknown");
}
})
it("warns the user that we intend to overwrite an existing property", function() {