Plugin for Karma Test Runner to integrate MSL (Mock Service Layer)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Plugin for Karma Test Runner to integrate MSL (Mock Service Layer)


The easiest way is to keep karma-msl as a devDependency in your package.json.

  "devDependencies": {
    "karma": "~0.12.0",
    "karma-msl": "~0.0.16"

You can simply do it by:

npm install karma-msl --save-dev


Integrating MSL with Jasmine tests (you can also integrate with your favorite testing framework)

// karma.conf.js
module.exports = function(config) {
    frameworks: ['jasmine, msl'],

    files: [
    // configuration for msl plugin
    msl: {
      port: '8002', //port to start msl server.  8000 by default.
      basedir: '../src/', // directory containing the app code (front-end code under test).  current dir by default.
      debug: 'true', // true to turn on debugging. false by default.
      extensions: 'CustomURL.js' // custom extensions for msl-server (optional)
    // this port should match the msl port specified in msl plugin config
    proxies: {
      '/' : 'http://localhost:8002/'
    // this port should match the msl port used within the tests
    port: 8001,

Contributing & Sponsor

More information on how to contribute to this project including sign off and the DCO agreement, please see the project's GitHub wiki.

FINRA has graciously allocated time for their internal development resources to enhance karma-msl and encourages participation in the open source community. Want to join FINRA? Please visit

FINRA Technology

License Type

MSL project, including karma-msl plugin, is licensed under Apache License Version 2.0