pivotal/jasmine — pull request #497 by erikringsmuth (2014-01-11 17:52:51+00:00)
Title: amd spec runner

I've been working on a solution to issue https://github.com/pivotal/jasmine/issues/477. Here's a summary of what I've done.

In the dist folder after you've run a build:
- new `AmdSpecRunner.html` that sits alongside `SpecRunner.html`
- new `lib/jasmine-2.0.0/amd` folder with AMD related files

`AmdSpecRunner.html` loads `lib/jasmine-2.0.0/amd/amdSpecRunner.js` which configures require.js, loads all of the AMD specs, and executes the environment.

Both `AmdSpecRunner.html` and `amdSpecRunner.js` use Javascript templates to set the correct jasmine dist version. The rest of the files are copied from `lib/jasmine-core/amd` during the build.

There are two new files in `lib/jasmine-core/example/spec`. `amdSpecList.js` contains a list of all AMD specs. This is used by the `amdSpecRunner.js` to load all of the AMD specs. I also have a `amdSpec.js` to test that everything is set up correctly for AMD.

I'm not sure how or if require.js should be included in the `dist` folder since it's an external dependency. For now I'm leaving it out and you have to manually add it to you dist folder in `lib/requirejs/require.js`.

Any thoughts or ideas if anything should be moved around?