npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@candlelib/cure

v0.8.2

Published

Testing Framework

Downloads

5

Readme

Cure is a testing framework that aims to be:

  • Easy To Use

    A minimal amount of code should be required to run a test. Cure should be able to understand a codebase and pull in requirements automatically

    Should provide accurate feed back when a failure has been encountered in order to make quick decisions on how to correct the problem and meet the specification.

  • Highly Configurable

    Cure should be able handle the requirements of an evolving code base. Cure sure should be easily adaptable to existing projects while also allowing new projects to work with it minimal, ideally no, boilerplate.

    Additional features should be able to be added through a rich plugin system that that is simple to use.

  • Fun

    Most importantly, making tested code work should be rewarding. It should provide a nostalgia for a person's early days, when the first Hello World message was printed, and that person became a programmer.

State of the Framework

Cure is experimental but relatively stable, however there is no release available yet. There will be an alpha release before end of Feb 2021

Most of the development work is going into supporting a plugin system, which means the core architecture is mostly finalized. There are frequent updates to this framework, so watch this project if you want to see what comes about.

Usage

Install

Yarn

$ yarn global add @candlelib/cure

NPM

$ npm install -g @candlelib/cure

Run

Single file execution with that will watch imported files

$ cure --watch ./test/test.spec.js

Spec Files

Commandline Interface

Config Script

A configuration script can be included to handle the task of loading data

Plugins

Reporters

Tips & Tricks

Side effects

Make sure expressions in assertions sites do not have side effects or are placed in sequenced assertion groups, otherwise an assertion will if it relies on those side effects:

let a = 0;

assert( a++ == 0 ) // Will pass

assert( a++ == 1) // Will fail. 

// The effect of the first assertion 
// is not seen by the second

This is because Cure isolates assertions by removing all expressions and statements that do not directly effect the outcome of the assertion, including other assertion statement. If an assertion site makes a modification to an object that a subsequent assertion site relies on, the latter site will fail due to effect of the former one being present in the execution context.

To overcome this problem, either ensure assertions do not modify their references, or wrap them in an assert_group:


let a = 0;

assert_group(sequence, ()=>{

    assert( a++ == 0 ) // Will pass

    assert( a++ == 1) // Will also pass

    // The second assertion can now see the 
    // effects of the first one
})