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

jest-expect-standalone

v24.0.2

Published

Jest Expect Standalone Library

Readme

Jest Expect Standalone

Jest Expect Standalone Library. Use the expect package from the facebook/jest project in the browser without any troubles.

What and why

Previously, the expect library was maintained over at mjackson/expect. However, the author decided to donate the project over to facebook/jest. See more information about this process in facebook/jest/issues/1679. Before the donation, the expect library was hosted on various CDNs, and you could easily include it as a script tag in some HTML file. It was usually done for quick testing/prototyping of code in online tools such as JSFiddle, JS Bin, or Plunker. One good example of expect usage for educational purposes is in the series of lectures Getting Started with Redux - Egghead by Dan Abramov.

After the handover of expect library, it became almost impossible to quickly include it in HTML code as a script tag. One possibility of how it can be achieved is illustrated in the JS Bin sample jsbin/nucimeceve. However, the method is cumbersome, and the result is slow. This is partly because facebook/jest uses expect as an internal dependency, and does not bundle it as a standalone UMD module.

This project intends to make available expect library as a standalone library for easy inclusion inside the browser via a script tag. jest-expect-standalone will be made available via CDN, and updated each time facebook/jest project updates their internal expect library.

Usage

Include jest-expect-standalone as a script tag, and you will have the library available via window.expect.

<script src="https://unpkg.com/jest-expect-standalone@latest/dist/expect.min.js"></script>

See sample JS Bin jsbin/wapokahaxe.

Or copy and paste the following HTML code in your editor, and hack away:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Running jest-expect-standalone</title>
  <script src="https://unpkg.com/jest-expect-standalone@latest/dist/expect.min.js"></script>
  <script>
    try {
      expect(true).toEqual(false);
      console.log('Test #1 passed!');
    } catch (err) {
      console.log(err);
      console.log('Test #1 failed!');
    }
    try {
      expect(2).toEqual(2);
      console.log('Test #2 passed!');
    } catch (err) {
      console.log(err);
      console.log('Test #2 failed!');
    }
  </script>
</head>
<body>

</body>
</html>

Building & running tests

To hack away on this project, clone this repository and change to it's root directory. After installing NPM modules with npm install, you have the following commands available:

npm run build
npm run test

License

This project is licensed under the MIT License. See LICENSE for more details.

Enjoy ;)