jupiter / simple-mock

Super simple stubs and spies with 1-step sandbox restore
MIT License
87 stars 12 forks source link

TypeError: Invalid calling object on IE11 #2

Closed gcedo closed 9 years ago

gcedo commented 9 years ago

I am using simple mock (awesome work!) with mocha and karma. My tests run just fine with Chrome, Firefox and Safari. On IE11 instead I get this error: TypeError: Invalid calling object in three tests. Looking at the stack trace, two of them are caused by the following line:

simple.mock(PageHelper, 'getSymbol', function () { return SYMBOL; });

and the third one fails because of this line

simple.mock($.lh.$observer, 'trigger', function () {});

If you need any info about the versions, here from package.json:

"karma": "^0.12.21",
"mocha": "^1.21.4",
"simple-mock": "^0.2.9"

and the stack trace

TypeError: Invalid calling object
           at isFunction (C:/Users/ecolombo/AppData/Local/Temp/958a899b009cd84df5a260401ac40d005a185a6b.browserify:42054:3 <- d:/stash_migration/lufthansa-nui/cui_lh/src/main/node_modules/simple-mock/index.js:169:0)
           at simple.mock (C:/Users/ecolombo/AppData/Local/Temp/958a899b009cd84df5a260401ac40d005a185a6b.browserify:41916:10 <- d:/stash_migration/lufthansa-nui/cui_lh/src/main/node_modules/simple-mock/index.js:31:0)

Edit: I think it could be related to this issue http://stackoverflow.com/questions/19321938/invalid-calling-object-error-in-ie

gcedo commented 9 years ago

Opened pull request https://github.com/jupiter/node-simple-mock/pull/3

jupiter commented 9 years ago

Merged your PR. Thanks.