promises-aplus/promises-tests — pull request #51 by johnyanarella (2014-01-28 06:32:27+00:00)
Title: Workaround for erratic "use strict" behavior in PhantomJS.

These changes ensure the expected scope is evaluated in the same context (i.e. within the same Mocha `specify()` block) in which the test onResolved or onRejected callback is created.

While I hate to introduce duplicated declarations of `defaultThisStrict` and `defaultThisSloppy` across these tests, it appears to be the only way to resolve this issue in the PhantomJS environment (which we for @DeftJS use in combination with Karma Test Runner and Travis CI).

Related to: stefanpenner@3a407b7
and: https://gist.github.com/stefanpenner/6d1ebcf2a6506914c831

Fixes #47