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 - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

19

index.js

@@ -8,9 +8,15 @@ 'use strict'

const start = (msg) => process.stdout.write(`${msg}\n`)
let startime
const start = (msg) => {
if (msg) process.stdout.write(`${msg}\n`)
startime = Date.now()
}
const finish = () => {
const sec = `${((Date.now() - startime) / 1000).toFixed(2)} seconds`
const plural = run > 1 ? 'tests' : 'test'
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
process.stdout.write(`${colorGreen}All ${run} ${plural} passed${colorReset}\n`)
const out = `${colorGreen}All ${run} ${plural} passed${colorReset} in ${sec}\n`
process.stdout.write(out)
}

@@ -39,3 +45,9 @@

const runTests = async (cb, meta) => {
const runTests = async (msg, cb, meta) => {
if (typeof msg === 'function') {
meta = cb
cb = msg
msg = undefined
}
start(msg)
try {

@@ -46,2 +58,3 @@ await cb()

}
finish()
}

@@ -48,0 +61,0 @@

2

package.json
{
"name": "mvt",
"version": "1.1.0",
"version": "2.0.0",
"description": "A minimum viable testing framework, aka a few test helpers, 0 dependencies",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ # mvt [![NPM version](https://badge.fury.io/js/mvt.svg)](https://npmjs.org/package/mvt) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## why another testing module
I'm getting tired of github security alerts on nested dev dependencies, usually
I'm getting tired of Github security alerts on nested dev dependencies, typically
from my chosen test framework. The tests I run are typically lite and

@@ -33,13 +33,8 @@ don't require all the frills provided by the majors. I'm totes fine with

**runTests** (testCallback[, meta]) - Just a wrapper that takes care to catch anything in it
**runTests** (message, testCallback[, meta]) - Just a wrapper that takes care to catch anything in it
- arguments
- `string` - Message to display on test start-up
- `function / async function` - Run your tests in this to ensure nothing is missed
- `object` - If anything fails this object will be printed to stderr
**start** (message) - 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** (description, truthyOrComparison[[, comparison], meta]) - Test against single truthy value or compare two values

@@ -65,5 +60,3 @@ - arguments

runTests(async () => {
start(`Testing my app`)
runTests(`Testing my app`, async () => {
test('Should be truthy', true)

@@ -74,4 +67,2 @@

await testAsync('Should resolve truthy', async () => Promise.resolve(true))
finish()
})

@@ -78,0 +69,0 @@ ```

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