
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
run useful tests on your arrays or hashes of arrays or hashes
var test = require('testover');
test.max('length').over(someArray); //run your tests inline
var samelength = test.equals('length'); //or set up a testing function to call later
samelength(someArray);
triplets: [
{name: 'Joe', age: 20}
, {name: 'Josie', age: 20}
, {name: 'Johnny', age: 20}
]
test.consistent('age').over(triplets);
test.equals('age', 20).over(triplets);
assoc_triplets: {
first: {name: 'Joe', age: 20}
, second: {name: 'Josie', age: 20}
, third: {name: 'Johnny', age: 20}
}
test.consistent('age').over(assoc_triplets);
test.equals('age', 20).over(assoc_triplets);
The underlying process is essentially a fancy reduce function. With this in mind you can add your own reductions to do even more testing.
tests.add(* *<field name>, * *<reduction function>, * *<options object>)
Reductions take the form r(property, row, reduced, opts) where
property is the property passed to the new test
row is the object or array currently being tested
reduced is the variable being reduced (the variable that will be returned)
opts is an object with extra goodies you can pass between iterations of your reduction
You can assign an initial value by assigning opts.init when you add the new reduction, otherwise opts.init and opts.first are assigned to the first list item's value.
test.add('noConsecutiveRepeats', function(prop, row, repeats, opts) {
var current = row[prop];
if (current === opts.previous) {
return false
} else {
opts.previous = current;
return repeats;
}
}, {init: true, previous: undefined});
test.noConsecutiveRepeats('property').over(array);
MIT
FAQs
run useful tests on your arrays or hashes of arrays or hashes
The npm package test-over receives a total of 2 weekly downloads. As such, test-over popularity was classified as not popular.
We found that test-over 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
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.