https://github.com/ashubham/karma-systemjs-imports
Add systemJS imports when unit testing with Karma.
https://github.com/ashubham/karma-systemjs-imports
Last synced: 21 days ago
JSON representation
Add systemJS imports when unit testing with Karma.
- Host: GitHub
- URL: https://github.com/ashubham/karma-systemjs-imports
- Owner: ashubham
- License: mit
- Created: 2017-06-28T05:30:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T07:18:59.000Z (almost 8 years ago)
- Last Synced: 2025-03-11T06:49:51.857Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# karma-systemjs-imports
[](https://travis-ci.org/ashubham/karma-systemjs-imports)Add system imports when unit testing with Karma.
Plays nicely along with `` imports. Useful for gradual migration of unit tests from
Javascript -> Typescript/ES6.```
$ npm i karma-systemjs-imports --save-dev
```
## Simple Usage```javascript
// karma.conf.js or grunt karma config
plugins: [
'karma-systemjs-imports',
// Other plugins
]frameworks: ['jasmine', 'systemjs-imports'],
browsers: ['Chrome'],
files: [/* Files to import normally using scripts */],
systemjs: {
/*
List of files that will be imported using System.import
before karma starts running the tests.
*/
importFiles: grunt.file.expand([
'app/src/**/*-spec.ts' // Or ES6 Modules.
])
}
```## Caveats
This plugin assumes:
- SystemJS is already loaded on the global window object.
- Your test files are already transpiled/compiled.
- A systemJS config is defined which, enables loading the modules via System.import