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

@oc-mui/plugin-testing

v1.0.2

Published

Test harness for Opencast Management UI plugins — load a plugin in isolation and assert its manifest and runtime contracts.

Readme

@oc-mui/plugin-testing

Contract-test harness for plugins that target the @oc-mui/plugin-system runtime. Boots a minimal manager with the three built-in plugins (objectRegistry, renderer, appRegistry), registers the plugin under test, and returns a small set of expect* assertion helpers tailored to the manifest and runtime-API contracts documented in docs/reference/contracts.md.

Public API

import { loadPluginInHarness, readPluginManifest } from "@oc-mui/plugin-testing";
  • loadPluginInHarness(plugin, options?) — returns a TestHarness handle. Always call harness.dispose() in your afterAll.
  • readPluginManifest(pluginDir) — reads <pluginDir>/plugin.json, validates it with the shared runtime validator, and returns the parsed manifest.

Example

import { describe, it, beforeAll, afterAll } from "vitest";
import { resolve } from "node:path";
import {
  loadPluginInHarness,
  readPluginManifest,
  type TestHarness,
} from "@oc-mui/plugin-testing";
import { myPlugin } from "./index";

describe("my-plugin contract", () => {
  let harness: TestHarness;

  beforeAll(async () => {
    const pluginDir = resolve(__dirname, "..");
    harness = await loadPluginInHarness(myPlugin, {
      manifest: await readPluginManifest(pluginDir),
      pluginDir,
      i18nLocales: ["en", "de"],
    });
  });

  afterAll(() => harness.dispose());

  it("activates cleanly", () => harness.expectActivated());
  it("registers all manifest extension points", () =>
    harness.expectAllManifestRegistrationsSucceed());
  it("has i18n parity across en/de", () => harness.expectI18nKeyParity());
  it("renders without console errors", () => harness.expectCleanRender());
});

Assertion reference

| Method | Intent | | --- | --- | | expectActivated() | The plugin is in manager.plugins after register(). | | expectRegistered([...eps]) | Each listed extension point has ≥ 1 entry. | | expectAllManifestRegistrationsSucceed() | Same as above, fed by manifest.extensionPoints. | | expectI18nKeyParity(locales?) | Every locale under each i18nNamespaces folder exposes the same flattened key set. | | expectCleanRender({ render? }) | No console.error / console.warn since the last call (optionally renders a React tree first). |

Breaking-change policy

This package is part of the test tooling, not the shipped runtime. It follows the project's general semver discipline:

  • New expect* helpers: minor.
  • Adding new optional fields to HarnessOptions or TestHarness: minor.
  • Removing or renaming anything on the public surface: major.
  • Tightening what counts as a harness failure (e.g. treating warnings as errors when they previously were ignored): major.

Tests written against the harness should rely only on the exports re-exported from ./src/index.ts.

Scope

MVP ships only the plugin-system provider in HarnessPluginProvider. Query / i18n / router wrappers are added per test when needed; if a common stack emerges, it will be promoted here.

Layer

Integration. Depends on @oc-mui/plugin-system (the runtime under test) and @oc-mui/utils. Not shipped to consumers — it's a workspace dev-only package.

See also