New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

highkick

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highkick

Asynchronous, no-style, super simple testing tool.

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by287.5%
Maintainers
1
Weekly downloads
 
Created
Source

Asynchronous, no-style, super simple testing tool for NodeJS.

Install

$ npm install highkick

Usage Example

To see HighKick in action, run "make test" command in the source code directory as below example;

$ make test
node test/run.js
Running "test_foo" ...
Running "test_bar" ...
> test_bar (1/2 , 0.001s)   OK
* All tests has been fired.
> test_foo (2/2 , 0.01s)   OK
====
Ran 2 tests without any error.

Introduction

Code your tests in a separated module;

function test_foobar(callback){
  setTimeout(function(){
    try {
      do();
      something();
      and();
      callback();
    } catch (error)
      callback(error);
    }
  }, 1000);
}

function test_quux(callback){
  callback();
}

Optionally, you may place an "init" function that is called before each test function is called. Returned values of init functions are passed to the tests as seen below;

// tests.js
function init(){
  return +(new Date);
}

function test_corge(date, callback){
  callback();
}

To run the tests, create a new script calling HighKick;

// run.js
var highkick = require('highkick');
highkick({ 'module':require('./tests') }, function(error, result){
  console.log('Ran '+result.len+' tests with '+result.fail+' fail(s).');
});

"silent" and "name" are the remaining options that can be given optionally. Time to kick the tests;

$ node run.js

That's all. See test/ dir for a usage example.

Development

todo:

  • make init & reset functions async
  • browser support

Keywords

FAQs

Package last updated on 14 Oct 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc