From f7097281c92ff6eaa544f56d7ba368c4029e64d1 Mon Sep 17 00:00:00 2001 From: Gregg Van Hove Date: Thu, 3 May 2018 17:34:15 -0700 Subject: [PATCH] IE doesn't support `.name` on a function --- spec/core/SpySpec.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/core/SpySpec.js b/spec/core/SpySpec.js index 55adb7c7..18c6b762 100644 --- a/spec/core/SpySpec.js +++ b/spec/core/SpySpec.js @@ -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() {