🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

karma-systemjs-imports

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-systemjs-imports

A Karma plugin. Adapter for SystemJS module loader.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

karma-systemjs-imports

Build Status

Add system imports when unit testing with Karma.

Plays nicely along with <script> imports. Useful for gradual migration of unit tests from Javascript -> Typescript/ES6.

$ npm i karma-systemjs-imports --save-dev

Simple Usage

// 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

Keywords

karma-plugin

FAQs

Package last updated on 28 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts