Gathering detailed insights and metrics for uvu
Gathering detailed insights and metrics for uvu
Gathering detailed insights and metrics for uvu
Gathering detailed insights and metrics for uvu
uvu is an extremely fast and lightweight test runner for Node.js and the browser
npm install uvu
96.3
Supply Chain
99.1
Quality
75.9
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2,979 Stars
238 Commits
99 Forks
21 Watching
6 Branches
23 Contributors
Updated on 24 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-8.6%
513,983
Compared to previous day
Last week
1.8%
2,963,797
Compared to previous week
Last month
5.8%
12,671,380
Compared to previous month
Last year
25.5%
145,506,694
Compared to previous year
async
/await
tests$ npm install --save-dev uvu
Check out
/examples
for a list of working demos!
1// tests/demo.js 2import { test } from 'uvu'; 3import * as assert from 'uvu/assert'; 4 5test('Math.sqrt()', () => { 6 assert.is(Math.sqrt(4), 2); 7 assert.is(Math.sqrt(144), 12); 8 assert.is(Math.sqrt(2), Math.SQRT2); 9}); 10 11test('JSON', () => { 12 const input = { 13 foo: 'hello', 14 bar: 'world' 15 }; 16 17 const output = JSON.stringify(input); 18 19 assert.snapshot(output, `{"foo":"hello","bar":"world"}`); 20 assert.equal(JSON.parse(output), input, 'matches original'); 21}); 22 23test.run();
Then execute this test file:
1# via `uvu` cli, for all `/tests/**` files 2$ uvu -r esm tests 3 4# via `node` directly, for file isolation 5$ node -r esm tests/demo.js
Note: The
-r esm
is for legacy Node.js versions. Learn More
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!
uvu
The main entry from which you will import the test
or suite
methods.
uvu/assert
A collection of assertion methods to use within your tests. Please note that:
via the
/bench
directory with Node v10.21.0
Below you'll find each test runner with two timing values:
took ___
value is the total process execution time – from startup to termination(___)
) is the self-reported execution time, if knownEach 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)
MIT © Luke Edwards
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 11/28 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More