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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cucaroo

v0.4.1

Published

Light cucumber implementation for node javascript

Downloads

7

Readme

cucaroo 🥒

Build Status Code Climate

A light cucumber implementation for node javascript. Cucaroo allows you to have product defined .features and facilitates the testing against the narrative of the feature.

Usage

$> cucaroo

Feature: Successful feature runs
  As a BDD developer
  I want to implement and run cucumber tests
  So that I have regression testing, and a starting place for talking with product people

  Scenario: All is good
     Given  all step definitions are defined
     When   I run the feature
     Then   I should see all steps in green
     And    the exit code should be 0

$>

Installation

npm install -g cucaroo

Overview

Run tests against your feature steps.

Successfully Passed Features

The good. Here is an example of a feature that is well defined and passes all of it's scenario's steps.

Feature Definition

Feature: Successful feature runs
  As a BDD developer
  I want to implement and run cucumber tests
  So that I have regression testing, and a starting place for talking with product people

  Scenario: All is good
    Given all step definitions are defined
    When I run the feature
    Then I should see all steps in green
    And the exit code should be 0

Here is our step_definition for this feature

const expect = require('chai').expect;

module.exports = function(world) {
  world.given('all step definitions are defined', function(done) {
    expect(foo).to.be.ok;
    done();
  });

  world.when('I run the feature', function(done) {
    expect(bar).to.ok;
    done();
  });

  world.then('I should see all steps in green', function(done) {
    expect(baz.success).to.equal(4);
    done();
  });

  world.and('the exit code should be 0', function(done) {
    assert.equal(world.errors, 0);
    done();
  });
};

Assuming your tests successfully passed, you will get an exit code of 0.

Failed Features

The bad. During development and other situations, tests will fail. In the event your cucuroo test fails, you will received information on where and how a test failed. Here is an example of a feature failing.

Feature Definition

Feature: Feature with a whole lot of errors
  As a BDD developer
  I want to see my regression tests fail
  So that I know my code works after modifications

  Scenario: Assertion failure
    Given Things are moving along just fine
    When And then I make an assertion that aint true
    Then I should see a helpful stack trace
    And the summary at the end reflects those errors

  Scenario: Runtime errors
    Given Things are moving along just fine
    When I make an error resulting in a runtime failure
    Then I should see a helpful stack trace
    And the summary at the end reflects those errors

And then the step_definition file that actually does the assertions.

const expect = require('chai').expect;

module.exports = function(world) {
  world.given('Things are moving along just fine', function(done) {
    done();
  });

  world.when('And then I make an assertion that aint true', function(done) {
    expect(true).to.be.(false);
    done();
  });

  world.then('I should see a helpful stack trace', function(done) {
    done();
  });

  world.and('the summary at the end reflects those errors', function(done) {
    done();
  });

  world.when('I make an error resulting in a runtime failure', function(done) {
    failHard();
  });
};

And with these failing steps, you will recevied the following output (but with pretty colors).

Feature: Feature with a whole lot of errors
  As a BDD developer
  I want to see my regression tests fail
  So that I know my code works after modifications

  Scenario: Assertion failure
     Given  Things are moving along just fine
     When   And then I make an assertion that aint true  // step threw an error; halting scenario

AssertionError: it isnt like we thought
    at StepDefinition.implementation (/Users/user1/Projects/cucaroo/test/features/step_definitions/failing-steps.js:11:5)
    at Step.run (/Users/user1/Projects/cucaroo/lib/step.js:25:23)
    at StepCollection.runStepUnlessHalted (/Users/user1/Projects/cucaroo/lib/step-collection.js:53:10)
    at /Users/user1/Projects/cucaroo/lib/step-collection.js:30:33
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:3830:24
    at replenish (/Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:946:17)
    at iterateeCallback (/Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:931:17)
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:906:16
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:3835:13
    at definition.implementation (/Users/user1/Projects/cucaroo/lib/step.js:33:9)

     Then  I should see a helpful stack trace
     And   the summary at the end reflects those errors

  Scenario: Runtime errors
     Given  Things are moving along just fine
     When   I make an error resulting in a runtime failure  // step threw an error; halting scenario

ReferenceError: failHard is not defined
    at StepDefinition.implementation (/Users/user1/Projects/cucaroo/test/features/step_definitions/failing-steps.js:24:5)
    at Step.run (/Users/user1/Projects/cucaroo/lib/step.js:25:23)
    at StepCollection.runStepUnlessHalted (/Users/user1/Projects/cucaroo/lib/step-collection.js:53:10)
    at /Users/user1/Projects/cucaroo/lib/step-collection.js:30:33
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:3830:24
    at replenish (/Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:946:17)
    at iterateeCallback (/Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:931:17)
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:906:16
    at /Users/user1/Projects/cucaroo/node_modules/async/dist/async.js:3835:13
    at definition.implementation (/Users/user1/Projects/cucaroo/lib/step.js:33:9)

     Then   I should see a helpful stack trace
     And    the summary at the end reflects those errors


Some features failed:

  Features -   Passing: 0, Failing: 1
  Scenarios -  Passing: 0, Failing: 2
  Steps -      Passing: 2, Failing: 2

Config

TODO

Project Structure

TODO

Contributing

TODO