Description
Ultimate Velocity, Unleashed Features - Super lightweight - Extremely performant - Individually executable test files - Supports async/await tests - Supports native ES Modules - Browser-Compatible - Familiar API
uvu alternatives and similar modules
Based on the "Testing" category.
Alternatively, view uvu alternatives based on common mentions on social networks and blogs.
-
Playwright
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. -
Nightwatch
Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack -
volkswagen
:see_no_evil: Volkswagen detects when your tests are being run in a CI server, and makes them pass. -
istanbul
Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale. -
loadtest
Runs a load test on the selected URL. Fast and easy to use. Can be integrated in your own workflow using the API. -
power-assert
Power Assert in JavaScript. Provides descriptive assertion messages through standard assert interface. No API is the best API. -
testcontainers-node
Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of uvu or a related project?
Popular Comparisons
README
uvu is an extremely fast and lightweight test runner for Node.js and the browser Ultimate Velocity, Unleashed
Features
- Super lightweight
- Extremely performant
- Individually executable test files
- Supports
async
/await
tests - Supports native ES Modules
- Browser-Compatible
- Familiar API
Install
$ npm install --save-dev uvu
Usage
Check out
/examples
for a list of working demos!
// tests/demo.js
import { test } from 'uvu';
import * as assert from 'uvu/assert';
test('Math.sqrt()', () => {
assert.is(Math.sqrt(4), 2);
assert.is(Math.sqrt(144), 12);
assert.is(Math.sqrt(2), Math.SQRT2);
});
test('JSON', () => {
const input = {
foo: 'hello',
bar: 'world'
};
const output = JSON.stringify(input);
assert.snapshot(output, `{"foo":"hello","bar":"world"}`);
assert.equal(JSON.parse(output), input, 'matches original');
});
test.run();
Then execute this test file:
# via `uvu` cli, for all `/tests/**` files
$ uvu -r esm tests
# via `node` directly, for file isolation
$ node -r esm tests/demo.js
Note: The
-r esm
is for legacy Node.js versions. Learn More
Assertions
The uvu/assert
module is completely optional.
In fact, you may use any assertion library, including Node's native assert
module! This works because uvu
relies on thrown Errors to detect failures. Implicitly, this also means that any uncaught exceptions and/or unhandled Promise
rejections will result in a failure, which is what you want!
API
Module: uvu
The main entry from which you will import the test
or suite
methods.
Module: uvu/assert
A collection of assertion methods to use within your tests. Please note that:
- these are browser compatible
- these are completely optional
Benchmarks
via the
/bench
directory with Node v10.21.0
Below you'll find each test runner with two timing values:
- the
took ___
value is the total process execution time โ from startup to termination - the parenthesis value (
(___)
) is the self-reported execution time, if known
Each test runner's stdout
is printed to the console to verify all assertions pass.Said output is excluded below for brevity.
~> "ava" took 594ms ( ??? )
~> "jest" took 962ms (356 ms)
~> "mocha" took 209ms ( 4 ms)
~> "tape" took 122ms ( ??? )
~> "uvu" took 72ms ( 1.3ms)
License
MIT ยฉ Luke Edwards
*Note that all licence references and agreements mentioned in the uvu README section above
are relevant to that project's source code only.