Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including karma-expect with all npm packages installed. Try it out:

var karmaExpect = require("karma-expect")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

karma-expect v1.1.3

Expect.js adapter for Karma

karma-expect

Dependency Status NPM version NPM downloads Travis CI

Motivation

You should use it only if you want run tests in IE8 and lower, otherwise consider karma-chai-plugins, which provides more complete Chai assertions as well as additional plugins.

Installation

Install the module from npm:

$ npm install karma-expect --save-dev

Add expect to the frameworks key in your Karma configuration:

module.exports = function(karma) {
  karma.set({

    // frameworks to use
    frameworks: ['mocha', 'expect']

    // ...
  });
};

Usage

Expect.js assertions are available in the tests:

describe('karma tests with expect', function() {
  it('should expose expect method', function() {
    expect('foo').to.not.equal('bar');
  });
});

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free