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

shisha

v1.1.0

Published

Simple smoke testing library in NodeJS

Downloads

224

Readme

Shisha, smoke tests made easy!

Build Status

Shisha is a smoke testing library written in NodeJs. Simply provide a list of URLs and expected status codes and Shisha will take care of testing them!

Installation

You can install this library through NPM:

npm install -g shisha

Usage

In your project root directory, define a .smoke file:

http://example.org 200
http://example.org/about 200
http://example.org/isdf 404
http://example.org/private 403

then simply cd into your project's root and run shisha!

example

.smoke file

Defining the .smoke file is flexible, you can define your URLs with variables in this form:

http://{{ domain1 }}/{{ path }}/some-url 200
http://{{ domain2 }}/{{ path }}/some-other-url 200

By calling shisha --domain1 example.org --domain2 example.net --path api, the locals are populated automatically!

example

Even more! You can define any text file with a list of URLs and expected status codes and point shisha at them using the --smoke option shisha --smoke ./my/other/project/.urls

Smoke File Comments: you can add hash style comments inline by starting the line with a hash like this:

# A comment  
http://example.org/some-url 200

Extending

To be able to extend shisha, simply:

npm install --save shisha

# then

var shisha = require('shisha');

Then, you will have access to the smoke method, that accepts following arguments:

  • a path to the smoke file or an object / list that defines your resources
  • a list of locals to replace in the smoke file: { domain1: 'example.org' }
  • a callback that is triggered when the smoke tests are completed.
shisha.smoke(filePath, options, callback)

# or, with an object:

var resources = [{
  url: 'http://google.com',
  status: 200
},{
  url: 'http://ahhhhhhhhh.com',
  status: 404
}];

shisha.smoke(resources, options, callback);

# or you can even use another
# data model:

var resources = {
  'http://google.com': 200,
  'http://ahhhhh.com': 404,
};

shisha.smoke(resources, options, callback);

If you do not have any locals, you can omit them:

shisha.smoke(filePath, callback)

Tests

You can run tests locally with

npm test

The build is continuously run on travis.

On SSL/TLS self signed certificates

In order for shisha to work properly with servers hosting self signed certificates (mainly for development purposes) The CLI accepts a ca argument referring to the location of a local copy of the server's self signed certificate.

shisha --ca /path/to/cert.pem

Feedback

Add an issue, open a PR, drop us an email! We would love to hear from you!