New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

karma-requirejs-preprocessor

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-requirejs-preprocessor

A Karma plugin. Extend project RequireJs config by test RequireJs config

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

karma-requirejs-preprocessor NPM version

Karma preprocessor to create special requirejs config for tests

Install with npm

npm install karma-requirejs-preprocessor

Usage

//Karma config
module.exports = function(config) {
  config.set({
  
      files: [
          ...
          
          //load original RequireJs config
          'src/requirejsconfig.js'
      ],

  
      preprocessors: {
          'src/requirejsconfig.js': 'requirejs' //original RequireJs config
      },
    
      requirejsPreprocessor: {
          config: { //test RequireJs config
              baseUrl: '/base/src/', //replace baseUrl of original config
              paths: { //extend paths of original config
                  angularMocks: 'vendor/angular-mocks/angular-mocks'
              },
              shim:  { //extend shim of original config
                  angularMocks: ['angular']
              },
              deps:  [ //replace deps of original config
                  'angularMocks'
              ]
          },
          testRegexp: '(spec|test)\.js$' //Should be a valid regular expression
      },
  });
};

API

requirejsPreprocessor

config

Type: Object

RequireJS config for test environment

testRegexp

Type: String

Custom regular expression for test files searching. Used in instantiating a new RegExp object. Default spec\.js$

License

© Oleg Istomin 2015. Released under the MIT license

Keywords

karma-plugin

FAQs

Package last updated on 10 Apr 2016

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