substantial / sinon-stub-promise

Synchronous Promise stubbing for Sinon.JS
MIT License
85 stars 11 forks source link

Changed module loading code to fix issue #14 #15

Closed Astridax closed 8 years ago

Astridax commented 8 years ago

Fixes issue #14

On Karma when running tests under environments such as Nativescript, standard browser variables such as window and self do not exist. In this case adding the library to the 'this' variable which is the global scope is a sensible failsafe which works.

This change does not break any existing tests.

I have included an alternate way of writing the loading code as taken from moment.js. Feel free to choose which you prefer.

a-b-r-o-w-n commented 8 years ago

Added in d86f62b