Socket
Socket
Sign inDemoInstall

baretest

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    baretest

Extremely fast and simple JavaScript test runner


Version published
Weekly downloads
812
decreased by-25.64%
Maintainers
1
Install size
16.3 kB
Created
Weekly downloads
 

Readme

Source

Baretest is an extremely simple JavaScript test runner. It has a tiny footprint, near-instant performance, and a brainless API. It makes testing tolerable.

How Baretest fits on the testing landscape

Install

npm install --save-dev baretest

With pnpm

pnpm install --save-dev baretest

Documentation

... Getting started

... API reference

... FAQ

Why Baretest?

We constantly hit CMD + B on Sublime Text to test a function we are actively working on. We do this all the time, sometimes hundreds of times a day. With Jest, each of these runs would take seconds, but Baretest runs under 100ms.

A typical setup in Sublime Text Comparing Jest vs Baretest

Another reason for building Baretest was to have an extremely simple API. Typically we only use test() and the Node's built-in assert.equals() methods to run our tests. We've never needed automatic re-ordering, file watchers, "mocking" or "snapshotting".

const test = require('baretest')('My app'),
  assert = require('assert'),
  app = require('my-app')

test('add user', async function() {
  const user = await app.addUser('test@cc.com')
  assert.equals(user.name, 'Test')
})

test('reject duplicate emails', async function() {
  await assert.rejects(async function() {
    await app.addUser('duplicate@address.com')
  })
})

// ...

!(async function() {
  await test.run()
})()

We think a good test runner stays out of your way. We want to focus on the task at hand and not deal with the complexities of testing. We don't want to commit to a massive framework that dictates our work.

License

Copyright 2020 OpenJS Foundation and contributors. Licensed under MIT.

Keywords

FAQs

Last updated on 10 Apr 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc