
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
harness-jsYet another test organizers except that is work in NodeJS, Mongo's shell. Being able to run across these three environments with depending on things like RequireJS was a major reason to write this module. Hopefully it is helpful to others.
Harness provides a simple way of organizing assertive tests in Mongo's shell (using mongo-modules), NodeJS and in many web browsers.
var path = require("path"),
assert = require("assert"),
harness = require("harness");
// Setup a test by assigning a function to callback and
// a label to the test group.
harness.push({callback: function (test_label) {
assert.strictEqual(harness.counts("running"), 1, "Should have on test running for 'Testing push()'");
// Now that you've completed this test
// group tell harness that this label
// is now complete.
harness.completed(test_label);
}, label: "Test group 1"});
// This is a second test group just to show you can do
// more than one group of tests.
// Setup a test by assigning a function to callback and
// a label to the test group.
harness.push({callback: function (test_label) {
assert.strictEqual(harness.counts("running"), 2, "Should have on test running for 'Testing push()'");
// Now that you've completed this test
// group tell harness that this label
// is now complete.
harness.completed(test_label);
}, label: "Test group 2"});
harness.RunIt(path.basename(module.filename), 10);
The command to run example/node-example.js looks like-
node example/node-example.js
The output would look something like-
Starting [node-example.js] ...
Starting Test group 1 ...
Test group 1 called
Test group 1 OK
Starting Test group 2 ...
Test group 2 called
Test group 2 OK
node-example.js Success!
Harness support comes with mongo-modules and mongo-modules will need to be installed for it to work. Other than that it looks much like the NodeJS version above. The difference is that the module.filename object isn't defined by mongo-modules so we must define that ourselves.
var path = require("path"),
assert = require("assert"),
harness = require("harness"),
// mongo-modules does not define the module object's
// filename.
module = {
filename: "mongo-example.js"
};
// Setup a test by assigning a function to callback and
// a label to the test group.
harness.push({callback: function (test_label) {
assert.strictEqual(harness.counts("running"), 1,
"Should have on test running for 'Testing push()'");
// Now that you've completed this test
// group tell harness that this label
// is now complete.
harness.completed(test_label);
}, label: "Test group 1"});
// This is a second test group just to show you can do
// more than one group of tests.
// Setup a test by assigning a function to callback and
// a label to the test group.
harness.push({callback: function (test_label) {
assert.strictEqual(harness.counts("running"), 2, "Should have on test running for 'Testing push()'");
// Now that you've completed this test
// group tell harness that this label
// is now complete.
harness.completed(test_label);
}, label: "Test group 2"});
harness.RunIt(path.basename(module.filename), 10);
Running the example/mongo-example.js with mongo-modules available is done like-
mongo ~/.mongojs.rc example/mongo-example.js
The output should look something like-
MongoDB shell version: 2.2.0
connecting to: test
loading file: /Users/johndoe/.mongorc.js
loading file: example/mongo-example.js
Starting [mongo-example.js] ...
Starting Test group 1 ...
Test group 1 called
Test group 1 OK
Starting Test group 2 ...
Test group 2 called
Test group 2 OK
mongo-example.js Success!
FAQs
Yet another test organizer except this one works in NodeJS, Mongo 2.2's shell and modern web browsers.
The npm package harness receives a total of 36 weekly downloads. As such, harness popularity was classified as not popular.
We found that harness 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
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.