Coder Social home page Coder Social logo

ramon18 / karma-requirejs-preprocessor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tamtakoe/karma-requirejs-preprocessor

0.0 2.0 0.0 6 KB

Karma preprocessor to create special requirejs config for tests

License: MIT License

JavaScript 100.00%

karma-requirejs-preprocessor's Introduction

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


karma-requirejs-preprocessor's People

Contributors

natlibfi-arlehiko avatar tamtakoe avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.