Skip to main content

Allows you to verify your console output matches expected behavior

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Browsers
JSR Score
94%
Published
2 months ago

@md/assert-console

Allows you to verify your console output matches expected behavior.

How to use

import { assertConsole } from "@md/assert-console";

Deno.test(function example() {
  console.log("Hello");
  console.warn("World", "Number1");
  console.warn("World", "#2");
  console.error("!");

  assertConsole({
    log: [["Hello"]],
    warn: [
      ["World", "Number1"],
      ["World", "#2"],
    ],
    error: [["!"]],
  });
});

Add Package

deno add @md/assert-console

Import symbol

import * as mod from "@md/assert-console";

Add Package

npx jsr add @md/assert-console

Import symbol

import * as mod from "@md/assert-console";

Add Package

yarn dlx jsr add @md/assert-console

Import symbol

import * as mod from "@md/assert-console";

Add Package

pnpm dlx jsr add @md/assert-console

Import symbol

import * as mod from "@md/assert-console";

Add Package

bunx jsr add @md/assert-console

Import symbol

import * as mod from "@md/assert-console";