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

ember-qunit-nice-errors

v3.0.0

Published

Babel plugin that gives message-less QUnit assertions a message: their own source text.

Readme

ember-qunit-nice-errors

CI

Because expected true, result false is not enough.

Gives message-less QUnit assertions a message: their own source text.

// you write
assert.ok(user.isActive);

// it compiles to
assert.ok(user.isActive, 'assert.ok(user.isActive)');

So a failure reports

assert.ok(user.isActive)

instead of

failed, expected argument to be truthy

Only assertions without a message are touched. Anything you wrote yourself is left alone.

Upgrading from v2? v3 is a Babel plugin rather than an ember-cli addon, and it needs one line of configuration — installing it is no longer enough. See MIGRATION.md.

Installation

pnpm add --save-dev ember-qunit-nice-errors

Then add it to your Babel config. This step is required — the plugin does nothing until you do.

Vite / Embroider

// babel.config.mjs
import qunitNiceErrors from 'ember-qunit-nice-errors';

export default {
  plugins: [
    qunitNiceErrors,
    // ...your other plugins
  ],
};

Classic ember-cli builds

// ember-cli-build.js
const app = new EmberApp(defaults, {
  babel: {
    plugins: [require.resolve('ember-qunit-nice-errors')],
  },
});

The same works in an addon's index.js and in an engine's ember-cli-build.js.

Compatibility

  • @babel/core 7 or 8
  • Node.js 22 or above

There is no longer an Ember version requirement — this is a plain Babel plugin. It works under Vite, Embroider and classic builds alike, and in any QUnit suite that runs through Babel.

Options

| option | type | default | meaning | | -------------------------- | --------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------- | | include | RegExp \| string \| Array | [/-test\.(?:[cm]?[jt]sx?\|g[jt]s)$/] | Which filenames to transform. Replaces the default rather than extending it. | | exclude | RegExp \| string \| Array | — | Filenames to skip. Takes precedence over include. | | showFileInfo | boolean | false | Append at <path>:<line>:<column>, relative to Babel's cwd. | | completeExistingMessages | boolean | false | Also overwrite messages you wrote yourself. Off by default, and rarely what you want. |

Strings are compiled with new RegExp(...), so escape accordingly ('\\.spec\\.js$').

[
  'ember-qunit-nice-errors',
  {
    include: [/\.spec\.js$/],
    exclude: [/vendor/],
    showFileInfo: true,
  },
];

The default pattern is exported if you would rather extend it than replace it:

const { DEFAULT_INCLUDE } = require('ember-qunit-nice-errors');

['ember-qunit-nice-errors', { include: [...DEFAULT_INCLUDE, /\.spec\.js$/] }];

In v2 include and exclude were globs read from config/environment.js. They are now regular expressions passed as plugin options — see MIGRATION.md.

Which assertions

ok, notOk, equal, notEqual, strictEqual, notStrictEqual, deepEqual, notDeepEqual, propEqual, notPropEqual.

Assertions whose failure output is already descriptive — throws, step, verifySteps, expect, async, timeout — are deliberately left alone.

How it decides what is an assertion

It resolves the assert object through Babel's scope rather than matching the identifier by name. A call is transformed only when its object is the first parameter of a function passed to a QUnit test() — including QUnit.test, test.only, test.skip and test.todo.

That means:

  • renamed parameters work — test('x', function (a) { a.ok(v); })
  • arrow-function tests work — test('x', async (assert) => { … })
  • an unrelated local called assert is not transformed
  • an assert passed to hooks.beforeEach is not transformed, because it is not a test callback

The last two were gaps in v2, which tracked the most recently seen test() call textually and only matched FunctionExpression.

It is also idempotent: a call is only matched when its argument count says no message was passed, so re-running the transform cannot append twice.

Development

pnpm install
pnpm test          # node --test
pnpm run lint
pnpm run lint:fix

License

MIT