
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
test-allclose
Advanced tools
Utility for tape to compare numbers, arrays, or nested arrays up to some tolerance, with helpful error output on test failure. Uses allclose and inspired by test-fuzzy-array.
use npm
npm install test-allclose
require with
var allclose = require('test-allclose')
then use with a test instance t of tape or similar
var close = allclose(t)
to get a function close(a, b, [atol], [rtol]) that, when called on two arrays a and b, will execute tests using the test instance t and generate useful output on test failure
setup tests using tape as usual
var test = require('tape')
then inside a test call
test('arrays', function (t) {
allclose(t)([1, 2], [1, 3])
t.end()
})
you can test numbers
allclose(t)(1, 1)
> test passes
allclose(t)(1, 2)
> test fails
or arrays
allclose(t)([1, 2], [1, 2])
> test passes
allclose(t)([1, 2], [1, 3])
> test fails
or nested arrays
allclose(t)([[1, 2], [3, 4]], [[1, 2], [3, 4]])
> test passes
allclose(t)([[1, 2], [3, 4]], [[1, 2], [3, 5]])
> test fails
and you can optionally specify a tolerance
allclose(t)([1, 2], [1, 2.1])
> test fails
allclose(t)([1, 2], [1, 2.1], 0.3)
> test passes
FAQs
tape utility to compare nested arrays within an epislon
The npm package test-allclose receives a total of 16 weekly downloads. As such, test-allclose popularity was classified as not popular.
We found that test-allclose demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.