Once you install and set up Jasmine-as-Promised, you now have a second way of creating asynchronous tests, besides Jasmine's
usual runs(); waitsFor(); runs(); style. Just return a promise. When the promise is resolved the test expectations are checked and if it is rejected the test
fails, with the rejection reason as the error. Nice, huh?

Jasmine as Promised works with all Jasmine interfaces: BDD, TDD, QUnit, whatever. It hooks in at such a low level, the
interfaces don't even get involved.

Jasmine-Node is a project that integrates the Jasmine Spec framework with NodeJS.

jasmine-node includes an alternate syntax for writing asynchronous tests. Accepting a done callback in the specification will trigger jasmine-node to run the test asynchronously waiting until the done() callback is called.

Notice that this Jasmine-as-Promised library does not use a done callback function argument in the it( ) call. But developers can still use Jasmine-As-Promised with Jasmine-Node; see the usage notes below for use with Node.

Jasmine-as-Promised supports being used as an AMD module, registering itself anonymously. So, assuming you have
configured your loader to map the Jasmine and Jasmine as Promised files to the respective module IDs "jasmine" and
"jasmine-as-promised", you can use them as follows:

The require("jasmine-as-promised")() above tries to detect which instance of Jasmine is being used automatically. This
way, Jasmine-as-Promised can plug into either the local Jasmine instance installed into your project, or into the global
Jasmine instance if you're running your tests using the globally-installed command-line runner.

In some cases, if you're doing something weird, this can fall down. In these cases, you can pass the Jasmine instance into
into the Jasmine-as-Promised function. For example, if you somehow had your Jasmine module as a property of the foo module,
instead of it being found in the usual npm directory structures, you would do

While this approach using the interceptor or head hook approach, it should be note that this is hack... albeit a reasonable one.
Note that Jasmine-as-Promised just overrides the window.runs method (published as part of Jasmine core); check the source for more details.

Developers should note that these do NOT show how RequireJS can also be used… that is out-of-scope for this project.
If you really need to know how to use RequireJS with your tests and Karma, contact me or come and see me at the 2014 NG-Conference