Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-should

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-should

Ultra-simple testing framework without dependencies. Supports async cases.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
381
increased by30.03%
Maintainers
1
Weekly downloads
 
Created
Source

micro-should

Ultra-simple testing framework without dependencies. Supports async cases.

Works with any assertion library.

npm install micro-should

Usage

const {should} = require("micro-should");

// Built-in node.js assertion lib.
// You can use any other library, like Chai.js or Expect.js.
const assert = require("assert");

should("add two numbers together", () => {
  assert.equal(2 + 2, 4);
});

should("catch errors", () => {
  assert.throws(() => { throw new Error("invalid"); });
});

should("produce correct promise result", async () => {
  const fs = require("fs").promises;
  const data = await fs.readFile("README.md", "utf-8");
  assert.ok(data.includes("Minimal testing"));
});

// should.only("execute only one test", () => {
//   assert.ok(true);
// });

// should.skip("disable one test by using skip", () => {
//   assert.ok(false); // would not execute
// })

// Execute this at the end of a file.
should.run();

License

MIT (c) Paul Miller (https://paulmillr.com), see LICENSE file.

FAQs

Package last updated on 05 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc