{"id":13396671,"url":"https://github.com/chaijs/chai","last_synced_at":"2025-05-12T18:28:50.710Z","repository":{"id":1997968,"uuid":"2931111","full_name":"chaijs/chai","owner":"chaijs","description":"BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.","archived":false,"fork":false,"pushed_at":"2025-04-09T13:22:20.000Z","size":5116,"stargazers_count":8203,"open_issues_count":86,"forks_count":702,"subscribers_count":135,"default_branch":"main","last_synced_at":"2025-04-30T20:32:14.946Z","etag":null,"topics":["assertions","bdd","chai","javascript","tdd"],"latest_commit_sha":null,"homepage":"https://chaijs.github.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaijs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"chaijs"}},"created_at":"2011-12-07T08:06:35.000Z","updated_at":"2025-04-30T08:48:28.000Z","dependencies_parsed_at":"2023-07-11T11:18:02.536Z","dependency_job_id":"8f191ac3-0d4a-4412-99a8-be0698bfda39","html_url":"https://github.com/chaijs/chai","commit_stats":{"total_commits":1236,"total_committers":193,"mean_commits":6.404145077720207,"dds":0.6529126213592233,"last_synced_commit":"1b1780582c07eefb3781333e24316865b9db7ae8"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaijs%2Fchai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaijs%2Fchai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaijs%2Fchai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaijs%2Fchai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaijs","download_url":"https://codeload.github.com/chaijs/chai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251899390,"owners_count":21662006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertions","bdd","chai","javascript","tdd"],"created_at":"2024-07-30T18:00:59.673Z","updated_at":"2025-05-05T15:39:21.762Z","avatar_url":"https://github.com/chaijs.png","language":"JavaScript","readme":"\u003ch1 align=center\u003e\n  \u003ca href=\"http://chaijs.com\" title=\"Chai Documentation\"\u003e\n    \u003cimg alt=\"ChaiJS\" src=\"http://chaijs.com/img/chai-logo.png\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  chai\n\u003c/h1\u003e\n\n\u003cp align=center\u003e\n  Chai is a BDD / TDD assertion library for \u003ca href=\"http://nodejs.org\"\u003enode\u003c/a\u003e and the browser that can be delightfully paired with any javascript testing framework.\n\u003c/p\u003e\n\n\u003cp align=center\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chai\"\u003e\n    \u003cimg\n      alt=\"downloads:?\"\n      src=\"https://img.shields.io/npm/dm/chai.svg?style=flat-square\"\n    /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chai\"\u003e\n    \u003cimg\n      alt=\"node:?\"\n      src=\"https://img.shields.io/badge/node-%3E=4.0-blue.svg?style=flat-square\"\n    /\u003e\n  \u003c/a\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://chai-slack.herokuapp.com/\"\u003e\n    \u003cimg\n      alt=\"Join the Slack chat\"\n      src=\"https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square\"\n    /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://gitter.im/chaijs/chai\"\u003e\n    \u003cimg\n      alt=\"Join the Gitter chat\"\n      src=\"https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square\"\n    /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opencollective.com/chaijs\"\u003e\n    \u003cimg\n      alt=\"OpenCollective Backers\"\n      src=\"https://opencollective.com/chaijs/backers/badge.svg?style=flat-square\"\n    /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nFor more information or to download plugins, view the [documentation](http://chaijs.com).\n\n## What is Chai?\n\nChai is an _assertion library_, similar to Node's built-in `assert`. It makes testing much easier by giving you lots of assertions you can run against your code.\n\n## Installation\n\n### Node.js\n\n`chai` is available on [npm](http://npmjs.org). To install it, type:\n\n    $ npm install --save-dev chai\n\n### Browsers\n\nYou can also use it within the browser; install via npm and use the `chai.js` file found within the download. For example:\n\n```html\n\u003cscript src=\"./node_modules/chai/chai.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nImport the library in your code, and then pick one of the styles you'd like to use - either `assert`, `expect` or `should`:\n\n```js\nimport { assert } from 'chai';  // Using Assert style\nimport { expect } from 'chai';  // Using Expect style\nimport { should } from 'chai';  // Using Should style\n```\n\n### Register the chai testing style globally\n\n```js\nimport 'chai/register-assert';  // Using Assert style\nimport 'chai/register-expect';  // Using Expect style\nimport 'chai/register-should';  // Using Should style\n```\n\n### Import assertion styles as local variables\n\n```js\nimport { assert } from 'chai';  // Using Assert style\nimport { expect } from 'chai';  // Using Expect style\nimport { should } from 'chai';  // Using Should style\nshould();  // Modifies `Object.prototype`\n\nimport { expect, use } from 'chai';  // Creates local variables `expect` and `use`; useful for plugin use\n```\n\n### Usage with Mocha\n\n```bash\nmocha spec.js --require chai/register-assert.js  # Using Assert style\nmocha spec.js --require chai/register-expect.js  # Using Expect style\nmocha spec.js --require chai/register-should.js  # Using Should style\n```\n\n[Read more about these styles in our docs](http://chaijs.com/guide/styles/).\n\n## Plugins\n\nChai offers a robust Plugin architecture for extending Chai's assertions and interfaces.\n\n- Need a plugin? View the [official plugin list](http://chaijs.com/plugins).\n- Want to build a plugin? Read the [plugin api documentation](http://chaijs.com/guide/plugins/).\n- Have a plugin and want it listed? Simply add the following keywords to your package.json:\n  -  `chai-plugin`\n  -  `browser` if your plugin works in the browser as well as Node.js\n  -  `browser-only` if your plugin does not work with Node.js\n\n### Related Projects\n\n- [chaijs / chai-docs](https://github.com/chaijs/chai-docs): The chaijs.com website source code.\n- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing.\n- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.\n- [chaijs / check-error](https://github.com/chaijs/check-error): Error comparison and information related utility for Node.js and the browser.\n- [chaijs / loupe](https://github.com/chaijs/loupe): Inspect utility for Node.js and browsers.\n- [chaijs / pathval](https://github.com/chaijs/pathval): Object value retrieval given a string path.\n\n### Contributing\n\nThank you very much for considering to contribute!\n\nPlease make sure you follow our [Code Of Conduct](https://github.com/chaijs/chai/blob/master/CODE_OF_CONDUCT.md) and we also strongly recommend reading our [Contributing Guide](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md).\n\nHere are a few issues other contributors frequently ran into when opening pull requests:\n\n- Please do not commit changes to the `chai.js` build. We do it once per release.\n- Before pushing your commits, please make sure you [rebase](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md#pull-requests) them.\n\n### Contributors\n\nPlease see the full\n[Contributors Graph](https://github.com/chaijs/chai/graphs/contributors) for our\nlist of contributors.\n\n### Core Contributors\n\nFeel free to reach out to any of the core contributors with your questions or\nconcerns. We will do our best to respond in a timely manner.\n\n[![Jake Luer](https://avatars3.githubusercontent.com/u/58988?v=3\u0026s=50)](https://github.com/logicalparadox)\n[![Veselin Todorov](https://avatars3.githubusercontent.com/u/330048?v=3\u0026s=50)](https://github.com/vesln)\n[![Keith Cirkel](https://avatars3.githubusercontent.com/u/118266?v=3\u0026s=50)](https://github.com/keithamus)\n[![Lucas Fernandes da Costa](https://avatars3.githubusercontent.com/u/6868147?v=3\u0026s=50)](https://github.com/lucasfcosta)\n[![Grant Snodgrass](https://avatars3.githubusercontent.com/u/17260989?v=3\u0026s=50)](https://github.com/meeber)\n","funding_links":["https://opencollective.com/chaijs"],"categories":["JavaScript","Testing Frameworks","测试框架","Unit Testing","Repository","Programming","Web 后端","Testing Frameworks [🔝](#readme)","目录","dApps directory","Uncategorized","javascript","Test tools","测试","{{ Test }}","Back-End Development"],"sub_categories":["Assertion","断言","Testing","JavaScript","测试/工具/Mock","Blockchain Security Tools","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaijs%2Fchai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaijs%2Fchai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaijs%2Fchai/lists"}