karma-custom
v1.1.9
Published
A karma adapter to run custom and framework free test suites
Downloads
133
Maintainers
Readme
karma-custom
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
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({});
};