Socket
Socket
Sign inDemoInstall

karma-config-rentpath

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-config-rentpath

Shared Karma config for our apps


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

karma-config-rentpath

Shared Karma config for our apps

Installation

$ npm i --save-dev karma-config-rentpath

Usage

The most minimal usage would be to create a karma.conf.js file in the root of your app with the following content:

module.exports = require('karma-config-rentpath')

And then set up an entry file to load the tests at path /spec/javascripts/tests.bundle.js:

var context = require.context('.', true, /.+_spec\.(coffee|js|jsx)$/);
context.keys().forEach(context);
module.exports = context;

If your app requires jasmine-jquery or jasmine-flight you will need to import them at the top of the entry file:

require('jasmine-jquery')
require('webpack-jasmine-flight')

If your app has special needs, you'll want to apply the shared configuration then any custom configuration. For example:

var configure = require('karma-config-rentpath')

module.exports = function(config) {
  // Apply shared configuration
  configure(config)

  // Custom app-specific configuration
  config.files.push('some/extra/file')
}

Running tests

Make sure your app's package.json has entries in scripts like these:

"test": "karma start --single-run",
"watch:test": "karma start",

Kick off either of these with npm run (for example: npm run watch:test).

Note that the test script is a special name and can be run with these shortcuts:

# No need to say `run`:
npm test

# Or even more tersely:
npm t

Scripts

  • npm run compile - Compiles the module to disk (~/lib).
  • npm run compile:watch - Same as npm run compile but watches files for changes.
  • npm run lint - Lints all files.
  • npm run lint:fix - Lints all files and attempts to fix any issues.
  • npm run test - Runs unit tests.
  • npm run test:watch - Same as npm test but watches files for changes.
  • npm run test:cov - Generates a test coverage report.

Distribution

Execute one of the following commands

npm version patch -m "Bumped to %s"
npm version minor -m "Bumped to %s"
npm version major -m "Bumped to %s"

FAQs

Package last updated on 04 Aug 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

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