Socket
Socket
Sign inDemoInstall

@types/chai

Package Overview
Dependencies
0
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/chai

TypeScript definitions for chai


Version published
Maintainers
1
Weekly downloads
4,886,096
decreased by-9.68%

Weekly downloads

Package description

What is @types/chai?

The @types/chai package provides TypeScript type definitions for Chai, a BDD / TDD assertion library for node and the browser. This allows developers to use Chai in TypeScript projects with type checking and IntelliSense support in code editors.

What are @types/chai's main functionalities?

Expect/Should Assertions

Provides fluent API for asserting facts about values in a readable manner. Supports both 'expect' and 'should' styles.

expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.lengthOf(3);
should.exist(foo);
foo.should.be.a('string');
foo.should.equal('bar');

Assert Style

Enables a more classical assert style, similar to node's assert module but with more capabilities.

assert.typeOf(foo, 'string');
assert.equal(foo, 'bar');
assert.lengthOf(foo, 3);

Property Assertions

Allows asserting the existence of an object's property, optionally asserting its value or properties.

expect(foo).to.have.property('length').with.lengthOf(3);
foo.should.have.property('length').with.lengthOf(3);

Other packages similar to @types/chai

Readme

Source

Installation

npm install --save @types/chai

Summary

This package contains type definitions for chai (http://chaijs.com/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chai.

Additional Details

  • Last updated: Wed, 20 Mar 2024 18:35:47 GMT
  • Dependencies: none

Credits

These definitions were written by Bart van der Schoor, Andrew Brown, Olivier Chevet, Matt Wistrand, Shaun Luttin, Satana Charuwichitratana, Erik Schierboom, Bogdan Paranytsia, CXuesong, and Joey Kilpatrick.

FAQs

Last updated on 20 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc