1.1.9 • Published 8 years ago

karma-custom v1.1.9

Weekly downloads
818
License
MIT
Repository
github
Last release
8 years ago

karma-custom

version npm version

Build Status Coverage Status

Dependency Status devDependency Status

Home Page

A karma adapter to run custom and framework free test suites

Purpose

  • Testing your own test framework (It's why I created this pluggin first)
  • Testing in browser very tiny modules which may not require a formal BDD method but still need to be tested (Cucumber, Jasmine, or others are maybe too much to test a simple addTwoNumbers function...)

Install

npm install karma-custom

How to use

Karma

Add 'custom' to the list of available frameworks in you karma.conf.js

//in your main-test-file.js

window.karmaCustomEnv = {};
window.karmaCustomEnv.execute = function(karma, window) {
	//use the node assert module (via browserify)
    var assert = require('assert');

    //You have access to the karma framework API
    console.log("Test suite started");

    try{
        //do your custom test here
        assert(true);

        karma.result({success: true})

    }catch(err){
        karma.result({
            success: false,
            suite: [],
            log: [err.message]
        });
    }

    karma.complete({});
};
1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago