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 🙏

© 2026 – Pkg Stats / Ryan Hefner

should-be-unexpected

v0.0.3

Published

Should.js emulation layer for Unexpected.

Readme

should-be-unexpected

This is an attempt to implement a should.js facade using unexpected. There is some incompatabilities, but only where we believe that our behaviour is better than what is found in should.js.

Not all of the current API of should is implemented. I have taken a few projects that I know of, already using should.js, and I am using them to guide the work.

Projects whose test suites run with no errors:

Projects whose tests are not yet fully running:

tj/ejs@v1.0.0 Two tests are failing, due to .include and .match not being implemented. .match is at the point in time when these tests are written a simple string regex match - now .match is an abomination that does all sorts of magic. .include has since been removed from should.js. I'm still considering what the right course of action would be on this.

Incompatabilities

1. .eql(otherValue)

The following would be okay in should.js.

[1, 2, 3].should.eql({ '0': 1, '1': 2, '2': 3 });

You can turn that behavior off, by enabling the following configuration option in should.js.

should.config.checkProtoEql = true;

Unexpected behaves as checkProtoEql is true per default, and it cannot be changed. This is a very concious choice.

2. .containEql(otherValue)

The following would work in should.js.

({ b: 10 }).should.containEql({ b: 10 });

But it doesn't in unexpected, as it does not define the assertion 'to contain' for the object type.

3. .not.property(name, value)

The following would be allowed in should.js.

var user = { name: 'John', age: 42 };
user.should.not.have.property('age', 0);

Using the not flag with the 'to have property' assertion is not working when you provide a value. The reason this was deprectated is that we felt that the intention of a test like this is unclear. Not using this kind of assertions, will make you write better tests.

4: .length

With should.js you could:

({ length: 10}).should.have.length(10);

Unexpected has a type system, and the 'to have length' assertion is only defined for string and array like types. Thus this assertion will fail, as the subject is not an array nor an arguments-array.

5: .empty

({}).should.be.empty;

The above is valid with should. In unexpected, the 'to be empty' assertion is only implemented for values of type string or array-like.

6: NaN is not a number

NaN.should.be.a.number;

The above assertion will not throw when using should.js. It will when you are using unexpected. While javascript itself considers NaN to be a number, we could not find a single reason for why you would want your assertion framework to consider it a valid number. If you get a NaN, where you expected a number, you'll most definitely not get the behaviour that you wanted.