Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

BBVAEngineering/karma-cli-flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED

karma-cli-flags Build Status GitHub version Coverage Status

Information

NPM

Packagekarma-cli-flags
Description Karma preprocessor to inject cli flags
Node Version >= 0.10

Installation

Just add karma-cli-flags as a devDependency in your package.json.

{
  "devDependencies": {
    "karma-cli-flags": "~0.1.0"
  }
}

Or issue the following command:

npm install karma-cli-flags --save-dev

Configuration

The code below shows a sample configuration of the preprocessor.

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.js': ['cli-flags']
    }
  });
};

Optionally, you can define the next parameters:

// karma.conf.js
module.exports = function(config) {
  config.set({
    cliFlags:
        export: 'ENV',
        wrap: false,
        namespace: '__cliFlags__'
    }
  });
};

export

Variable containing cli args to override until the end of file

export: 'ENV'

wrap

Wrap code into a function

wrap: false

namespace

Temp var to store exported variable value

namespace: '__cliFlags__'