UNPKG

921 BMarkdownView Raw
1#karma-jspm#
2
3Karma plugin to inject jspm and systemjs into the test run so that modules can be dynamically loaded.
4
5##Installation##
6
7Available in npm: `npm install karma-jspm`
8
9##Configuration##
10
11*karma.conf.js*
12
13Include this plugin in your frameworks:
14
15```js
16frameworks: ['jspm', 'jasmine'],
17```
18
19This 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
22client: {
23 jspm: {
24 // Edit this to your needs
25 files: ['src/**/*.js', 'test/**/*.js']
26 }
27}
28```
29
30This 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
33proxies: {
34 '/jspm_packages/': '/base/jspm_packages/'
35}
36```
37
38That's it!
39