New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mvt

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvt

A minimum viable testing framework, aka a few test helpers, 0 dependencies

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-64.29%
Maintainers
1
Weekly downloads
 
Created
Source

mvt NPM version js-standard-style

A minimum viable testing framework, aka a few test helpers, 0 dependencies

why

I'm getting tired of github security alerts on nested dev dependencies, usually from my chosen test framework. The tests I run are typically lite and don't require all the frills provided by the majors. I'm totes fine with nothing more than testing for a truthy value or comparing two values. As with most of my open source this is for me. There are many actually good test frameworks out there, but this is all I need for many circumstances.

install

$ npm install --save-dev mvt

api

runTests (function) - Just a wrapper that takes care to catch anything in it

  • arguments
    • function - Run your tests in this to ensure nothing is missed

start (string) - Prints specified message on test start-up

  • arguments
    • string - Message to display on test start-up

finish () - Prints "All X tests passed" in green, how fancy

test (string, any, any) - Test against single truthy value or compare two values

  • arguments
    • string - Test description
    • any - Will fail if not truthy OR if doesn't === argument 3
    • any - If not undefined this must === previous argument or will fail

testAsync (string, async function) - This simply awaits a promise that must resolve truthy

  • arguments
    • String - Test description
    • async function - Async function / promise returning function that must resolve truthy

usage

const { runTests, start, finish, test, testAsync } = require('mvt')

runTests(async () => {
  start(`Testing my app`)

  test('Should be truthy', true)

  test('Should be equal', 1, 1)

  await testAsync('Should be equal', async () => Promise.resolve(true))

  finish()
})

notes

If your test file is called with the flag --verbose it will list all passed tests

It fails fast and hard

It's probably not fit for much other than simple tests

License

MIT © Andrew Carpenter

Keywords

FAQs

Package last updated on 17 Feb 2019

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