Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-commonjs-alias

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-commonjs-alias

A Karma plugin. Test CommonJS modules with added alias support

  • 0.0.13
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

karma-commonjs-alias (karma-commonjs with module aliasing)

This is a clone of karma-commonjs

Here is a link to the original repo karma-commonjs . Go there for a full list of features.

Module aliasing

Added the ability to alias modules for testing. This is useful for mocking and specifying environment. It works the same way as file aliasing in grunt-browserify.

Here is an example karma.conf configuration

module.exports = function (config) {
	config.set({
	   ...
	   commonjsPreprocessor: {
	      alias : {
	        './config/dev.js': 'config'
	      }
	   }
	   ...
  });
}

In another file, you can specify the following and it will be resolve to ./config/dev.js

require('config');

Node/NPM Installation

npm install karma-commonjs-alias

Keywords

FAQs

Package last updated on 12 Mar 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc