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

@lowlighter/testing

v5.1.3

Published

[![JSR](https://jsr.io/badges/@libs/testing)](https://jsr.io/@libs/testing) [![JSR Score](https://jsr.io/badges/@libs/testing/score)](https://jsr.io/@libs/testing) [![NPM](https://img.shields.io/npm/v/@lowlighter%2Ftesting?logo=npm&labelColor=cb0000&color

Readme

🧪 Testing utilities

JSR JSR Score NPM Coverage

Isomorphic test runner to perform cross-platform testing on the Deno, Node.js and Bun runtimes.

📑 Examples

import { expect, runtime, Status, test, throws } from "./mod.ts"

// Test is performed on all available runtimes by default
test("test on all available runtimes", () => {
  expect("https://example.com").toBeUrl()
})

// Test can be restricted to specific runtimes by gating them with `runtime`
if (runtime === "node") {
  test("test only on node runtime", () => {
    expect("foo").toBeOneOf(["foo", "bar"])
  })
}

// Test on deno are performed without any additional permissions by default
// to satisfy the principle of least privilege, but can be overridden (this is ignored on other runtimes)
test("test `Deno.serve({ port: 8080 })` with additional `{ permissions: { net: 'inherit' } }`", async () => {
  await using server = Deno.serve({ port: 8080, onListen: () => null }, () => new Response(null, { status: Status.OK }))
  await expect(fetch(`http://${server.addr.hostname}:${server.addr.port}`)).resolves.toRespondWithStatus("2XX")
}, { permissions: { net: "inherit" } })

// You can use
test.todo("todo test", () => null)
test.skip("broken test", () => throws("broken test"))

✨ Features

  • Isomorphic test runner that can be used multiple different runtimes.
  • Extends @std/expect with additional matchers (toMatchDescriptor, toBeImmutable, toBeIterable, toRespondWithStatus, toBeEmail, etc.)
  • The permissions for deno test are defaulted to "none" rather than "inherit".
  • Syntax highlighting in test names for better readability.

🤖 Workflow usage

Below is an example on how it could be used within a GitHub Actions workflow:

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: denoland/setup-deno@v2
        with:
          deno-version: 2.x
      - run: deno test
      - uses: oven-sh/setup-bun@v1
        with:
          bun-version: 1.x
      - run: bun test
      - uses: actions/setup-node@v4
        with:
          node-version: 22.x
      - run: npx tsx --test

🕊️ Migrating from 3.x.x to 4.x.x

Test must be run through respective runtime

Previously, tests were run through Deno, but now you are supposed to run them through the runtime you want to test.

  • deno: deno test
  • bun: bun test
  • node: npx tsx --test

Runtime selection must now be done by gating tests

The test() function is now directly the runner rather than a function that returns a runner.

- test()("foo", () => void null)
+ test("foo", () => void null)
- test("node", "bun")("foo", () => void null)
+ if (runtime === "node" || runtime === "bun")
+   test("foo", () => void null)

🕊️ Migrating from 2.x.x to 3.x.x

Version 3.x.x and onwards require Deno 2.x.x or later.

toBeType("object") and null

The toBeType("object") matcher now excludes null by default. The second argument has been replaced by an object with a nullable property for better readability.

- expect(null).toBeType("object", !null)
+ expect(null).toBeType("object", { nullable: true })

Updated headers and syntax highlighting

The prefix for runtime in test names has been changed to be displayed in uppercase over a colored background. If you were using the deno test --filter option, you will need to update your filter accordingly.

- [deno]
+  DENO

Additionally, test names now syntax highlight everything specified in backticks.

📜 License

Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE