{"id":13565776,"url":"https://github.com/doesdev/mvt","last_synced_at":"2025-05-14T08:34:44.378Z","repository":{"id":57305858,"uuid":"171059346","full_name":"doesdev/mvt","owner":"doesdev","description":"✅ Minimum Viable Testing framework","archived":false,"fork":false,"pushed_at":"2024-09-12T06:21:37.000Z","size":1385,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T02:47:07.380Z","etag":null,"topics":["lightweight","no-dependencies","test","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doesdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-16T22:39:00.000Z","updated_at":"2024-08-13T19:58:18.000Z","dependencies_parsed_at":"2024-11-04T19:47:59.880Z","dependency_job_id":null,"html_url":"https://github.com/doesdev/mvt","commit_stats":{"total_commits":75,"total_committers":1,"mean_commits":75.0,"dds":0.0,"last_synced_commit":"c54b7d6938dfd90392bbee3ed3225b06df6558a1"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fmvt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fmvt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fmvt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fmvt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doesdev","download_url":"https://codeload.github.com/doesdev/mvt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254105147,"owners_count":22015600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lightweight","no-dependencies","test","testing"],"created_at":"2024-08-01T13:01:55.211Z","updated_at":"2025-05-14T08:34:43.927Z","avatar_url":"https://github.com/doesdev.png","language":"JavaScript","readme":"# 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)  [![Build Status](https://api.travis-ci.com/doesdev/mvt.svg)](https://travis-ci.com/doesdev/mvt)  \n\n\u003e Minimum Viable Testing framework\n\n## 5.0.0\nVersion 5.0.0+ deprecates support for CommonJS, opting to only support ES Modules. \n\nPlease use `mvt@4` for CommonJS usage.\n\n## A Minimalist Take on AVA's Approach to Testing\nBecause [AVA](https://github.com/avajs/ava) is awesome. Security alerts on dev\ndependencies are not awesome. Especially when you use the same test library\nacross dozens of projects. No matter how well maintained a project is, when it\ncontains [300+ dependencies](http://npm.broofa.com/?q=ava) security alerts are\ngoing to occur.\n\n[But It's Just a Dev Dependency...](https://medium.com/swlh/but-its-just-a-dev-dependency-566646ebeec9)\n\n## What's good about it\n- It has 0 dependencies (1 dev dep, and that's ava :smirk:)\n- It can be called via the `mvt` cli or by simply calling `node [test-file].js`\n- It doesn't transpile your code *(the code you write is the code we test)*\n\n## What it lacks (the most notable items)\n- Concurrency\n  - That's not a thing here (likely never will be)\n- Transpilation\n  - Also not a thing here (definitely never will be)\n  - Actually, maybe I should add this to \"What's good...\"\n  - I added it...\n- TAP Reporter\n  - Happy to add it if there is any demand\n- A community and product maturity\n  - The most crucial elements\n  - And the primary reason you may want to stick to AVA\n\n## Table of Contents\n  - [Install](#install)\n  - [Usage](#usage)\n  - [API](#api)\n    * [Test Function](#test-function)\n    * [Setup and Teardown](#setup-and-teardown)\n    * [Test Modifiers](#test-modifiers)\n    * [Assertions](#assertions)\n  - [Notes](#notes)\n  - [License](#license)\n\n# Install\n\n```sh\n# Install globally\n$ npm install --global mvt\n\n# Install for project\n$ npm install --save-dev mvt\n```\n\n# Usage\n\n```sh\nmvt\n# OR\nmvt test\n# OR\nmvt test.js test2.js\n# OR\nmvt --verbose\n# OR\nmvt test --verbose\n# OR\nnode test.js --verbose\n# etc...\n```\n\n```js\nimport test from 'mvt'\n\ntest.setup({ verbose: true })\n\ntest.after(() =\u003e console.log('test.after invoked'))\n\ntest.before(() =\u003e console.log('test.before invoked'))\n\ntest('assert.is works', (assert) =\u003e {\n  assert.is(1, 1)\n})\n\ntest.failing('test.failing and assert.fail works', (assert) =\u003e {\n  assert.fail()\n})\n\ntest.todo('test.todo works')\n\ntest.skip('test.skip works', (assert) =\u003e assert.truthy('skipped'))\n\ntest.only('test.only works', (assert) =\u003e assert.truthy('only'))\n\ntest.bench('test.bench works', (assert) =\u003e {\n  return new Promise((resolve, reject) =\u003e {\n    setTimeout(() =\u003e resolve(), 200)\n  })\n}, { samples: 5, max: 300 })\n```\n\n![Output](images/output.png)\n\n# API\n\n## Test Function\nThe only thing this module exports.\n\n### `test` ( message, testFunction )   \nMain function, give it a message and a test function. Test function\nreceives the `assert` object (see below).   \n- `message`: (String) Description of test\n- `testFunction`: ([Async]Function) Description of test\n\n#   \n## Setup and Teardown\n\n### `test.setup` ( opts )   \nUse this to configure your tests.   \n- `opts`: (Object)\n  - `verbose` (Boolean) - Print every test if `true`\n\n### `test.before` ( callback )   \nRun this before we start running any tests. [callback can be `async`]   \n\n### `test.after` ( callback )   \nRun this after we run all tests. [callback can be `async`]   \n\n#   \n## Test Modifiers\n\n### `test.only` ( message, testFunction )   \nTests will only be run on any tests run with this modifier.   \n\n### `test.skip` ( message, testFunction )   \nSkip that test (logical enough).   \n\n### `test.failing` ( message, testFunction )   \nThis test must fail. If it passes, we'll fail your whole test suite. Goteem.   \n\n### `test.todo` ( message )   \nThis is just a placeholder for your good intentions.   \n\n#   \n## Special Tests\n\n### `test.bench` ( message, testFunction, opts )\nRun the `testFunction` `opts.samples || 10` times. If average run duration is\nmore than `opts.max || 100` milliseconds fail the test.   \n- `opts`: (Object)\n  - `samples` (Number) - How many times we should run the `testFunction`\n  - `max` (Number [*in ms*]) - Maximum average duration threshhold\n  - `parallel` (Boolean) - If `Async Func` run in parallel, default is `false`\n  - `cb` (Function) - Called with `{ msTotal, msAvg }` on bench completion\n\n#   \n## Assertions\nMethods available on `assert` object passed to testFunction\n- **`is`** ( a, b ) - `a` and `b` must be identical\n- **`not`** ( a, b ) - `a` and `b` must not be identical\n- **`pass`** () - Passes errydamntime\n- **`fail`** () - Fails errydamntime\n- **`true`** ( a ) - `a` must be strictly `true`\n- **`false`** ( a ) - `a` must be strictly `false`\n- **`truthy`** ( a ) - `a` must be truthy\n- **`falsy`** ( a ) - `a` must be falsy\n- **`contains`** ( a, b ) - `JSON.stringify(a)` must contain (String)`b`\n- **`doesNotContain`** ( a, b ) - `JSON.stringify(a)` must not contain (String)`b`\n- **`lessThan`** ( a, b ) - `a` must be less than `b`\n- **`greaterThan`** ( a, b ) - `a` must be greater than `b`\n- **`deepEqual`** ( a, b ) - `a` must be `deepEqual` to `b`\n- **`notDeepEqual`** ( a, b ) - `a` must not be `deepEqual` to `b`\n- **`throws`** ( a ) - `a` must be a function, and it must throw\n- **`notThrows`** ( a ) - `a` must be a function, and it must not throw\n- **`throwsAsync`** ( a ) - `a` must be an async function, and it must throw\n- **`notThrowsAsync`** ( a ) - `a` must be an async function, and it must not throw\n\n\n# Notes\n\n- If your test file is called with the `--verbose` flag it will list all passed tests\n\n- It fails fast and hard with `process.exit(1)`\n\n- If you have [`diff`](https://github.com/kpdecker/jsdiff) installed as a peer\ndependency, we'll use that for string diffs. To make them more readable and\nwhat not.\n\n# License\n\nMIT © [Andrew Carpenter](https://github.com/doesdev)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fmvt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoesdev%2Fmvt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fmvt/lists"}