1 | #karma-jspm#
|
2 |
|
3 | Karma plugin to inject jspm and systemjs into the test run so that modules can be dynamically loaded.
|
4 |
|
5 | ##Installation##
|
6 |
|
7 | Available in npm: `npm install karma-jspm`
|
8 |
|
9 | ##Configuration##
|
10 |
|
11 | *karma.conf.js*
|
12 |
|
13 | Include this plugin in your frameworks:
|
14 |
|
15 | ```js
|
16 | frameworks: ['jspm', 'jasmine'],
|
17 | ```
|
18 |
|
19 | This configuration tells karma-jspm which files should by dynamically loaded via systemjs before the tests run. Globs or regular file paths are acceptable. You should not include these in the regular karma files array.
|
20 |
|
21 | ```js
|
22 | client: {
|
23 | jspm: {
|
24 | // Edit this to your needs
|
25 | files: ['src/**/*.js', 'test/**/*.js']
|
26 | }
|
27 | }
|
28 | ```
|
29 |
|
30 | This proxy configuration tells Karma to rewrite the requests for `/jspm_packages/...` to `/base/jspm_packages/...` so that karma knows how to serve the files that jspm/systemjs will try to load.
|
31 |
|
32 | ```js
|
33 | proxies: {
|
34 | '/jspm_packages/': '/base/jspm_packages/'
|
35 | }
|
36 | ```
|
37 |
|
38 | That's it!
|
39 |
|