This package has been deprecated

Author message:

Use Jest instead

madewithlove-karma-config

0.6.0 • Public • Published

Madewithlove Karma configuration

Usage

karma.conf.js

module.exports = function(config) {
    // Returns the Karma config object
    // Optionally set path to tests, defaults to `tests`
    config = require('madewithlove-karma-config')(
        config,
        'tests/karma'
    );
 
    // Customize additional options
    config.browsers = ['Firefox'];
};
 

tests/index.js

const testsContext = require.context('.', true, /Test.js$/);
testsContext.keys().forEach((path) => {
    let suite = path.replace(/\.\/(.+)Test.js/, '$1');
 
    describe(suite, () => testsContext(path));
});

tests/Reducer/SomeReducerTest.js

it('can do something', () => {
    // ...
});

Test utilities

The package also comes with some test utilities for common needs:

import expect from 'madewithlove-karma-config/expect';
 
expect(new Immutable.Map({foo: 'bar'})).toEqualJs({
    foo: 'bar',
});
 
expect(someSaga()).toEqualSaga([
    {
        action: put(someAction()),
        response: 'foobar',
    },
    {
        action: select(someSelector('foobar')),
        response: 'baz',
    }
]);

Dependencies (14)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i madewithlove-karma-config

    Weekly Downloads

    19

    Version

    0.6.0

    License

    MIT

    Last publish

    Collaborators

    • anahkiasen
    • bramdevries