Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@types/mocha
Advanced tools
TypeScript definitions for mocha
The @types/mocha package provides TypeScript type definitions for Mocha, a popular JavaScript test framework. These type definitions allow developers to use Mocha in TypeScript projects with type checking and IntelliSense support in code editors.
Describe blocks
TypeScript definitions for Mocha's describe blocks, which are used to group related tests.
describe('Array', () => {
describe('#indexOf()', () => {
it('should return -1 when the value is not present', () => {
assert.equal([1, 2, 3].indexOf(4), -1);
});
});
});
It blocks
TypeScript definitions for Mocha's it blocks, which are used to define individual test cases.
it('should add two numbers', () => {
const sum = add(1, 2);
assert.equal(sum, 3);
});
Hooks
TypeScript definitions for Mocha's hooks like before, after, beforeEach, and afterEach, which are used to set up preconditions and clean up after tests.
describe('hooks', () => {
before(() => {
// runs once before the first test in this block
});
after(() => {
// runs once after the last test in this block
});
beforeEach(() => {
// runs before each test in this block
});
afterEach(() => {
// runs after each test in this block
});
});
Provides TypeScript type definitions for Jest, a testing framework with a focus on simplicity. Jest offers a different API and additional features like snapshots and built-in coverage reports compared to Mocha.
Provides TypeScript type definitions for Jasmine, a behavior-driven development framework for testing JavaScript code. Jasmine has a slightly different syntax and feature set compared to Mocha.
Provides TypeScript type definitions for QUnit, a powerful, easy-to-use JavaScript unit testing framework. QUnit has a different API and is used primarily for testing jQuery projects.
npm install --save @types/mocha
This package contains type definitions for mocha (https://mochajs.org).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mocha.
These definitions were written by Kazi Manzur Rashid, otiai10, Vadim Macagon, Andrew Bradley, Dmitrii Sorin, Noah Hummel, and nicojs.
FAQs
TypeScript definitions for mocha
The npm package @types/mocha receives a total of 4,205,188 weekly downloads. As such, @types/mocha popularity was classified as popular.
We found that @types/mocha demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.