Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Asynchronous, no-style, super simple testing tool for NodeJS.
$ git clone git@github.com:azer/highkick.git
$ cd highkick
$ npm install
$ make test
Code your tests in a separated module, naming them starting with "test":
// tests.js
var assert = require('assert'); // highkick doesn't provide a new assertion library. NodeJS has a good one already.
exports.testFoo = function(callback){
setTimeout(function(){
try {
do();
something();
and();
callback();
} catch (error)
callback(error);
}
}, 1000);
}
exports.testBar = function(callback){
callback();
}
You can optionally add an init function that will be called before each test.
An init function takes two arguments, first one is the options of the test, and second one is the callback that will fire the pending test.
Init functions may pass any number of parameters to the test functions. See the below example;
exports.init = function init(options, callback){
callback(null, +(new Date), Math.random());
}
exports.testCorge = function(date, randomNumber, callback){
callback();
}
You may be curious about the options
variable passed to the init function (if you've defined one).
You pass the options
object to the highkick function itself, to run the tests.
In the below example, I create a new module and call HighKick, passing the tests module I've coded above.
// run.js
var highkick = require('highkick');
highkick({ 'module':require('./tests'), 'name':'main tests', 'silent':false }, function(error, result){
if(error) throw error;
console.log('Ran '+result.len+' tests with '+result.fail+' fail(s).');
});
Only required option field is module
, see the Available Options section for details. feel free to skip name
and ```silent`` fields if you dont need.
Let's call the module above;
$ node run.js
That's all. See test/ dir for a basic usage example.
module Passes the module that contains the tests. Required.
name A name that'll be seen as a prefix of the messages produced by the related tests.
silent Keeps the tests silent.
ordered Each test waits its previous sibling to produce a result by running its callback.
I use HighKick in my OneJS project heavily. You may take a look at its tests;
FAQs
This package name is not currently in use, but was formerly occupied by a popular package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.
The npm package highkick receives a total of 31 weekly downloads. As such, highkick popularity was classified as not popular.
We found that highkick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.