
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
This module provides a simple function that can be used in
assert.throws to verify that an error is an instance of a particular
class, and/or that its message has specific content.
'use strict'
const assert = require('assert');
const testError = require('test-error');
// ...
describe('suite', function() {
it('should throw a TypeError', function() {
assert.throws(() => testMe(),
err => testError(err, TypeError, 'missing argument'));
});
}); // suite
npm install test-error
error {Error} The error instance to be tested.constructor {Function} Optional class of which error must be an
instance. If not provided the parentage of error is not tested.msgCheck {String|RegExp} Optional content expected in
error.message. If a String is provided, the String must appear
within error.message (at any position). If a RegExp is provided, its
test method must accept error.message. If not provided the value
of error.message is not tested.Returns false if a provided constructor or msgCheck verification
fails, true otherwise.
All changes since 1.0.0 relate to package documentation.
package.json so coveralls updates are performed.FAQs
Function to check the type and message content of a Node.js Error
We found that test-error 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.