{"id":18204,"library":"chai-things","title":"Chai Things","description":"Chai Things (v0.2.0, unmaintained since 2015) extends Chai assertion library with array element matchers like `include.something.that`, `all`, and `none`. Allows deep equality, property, and nested assertions on arrays. Last updated on npm in 2016; no releases for 9+ years. Use with Chai v4.x but may have compatibility issues. Alternative: use native Chai `members` matcher with deep equality or Lodash`_.some`/_.every.","status":"deprecated","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/RubenVerborgh/Chai-Things","tags":["javascript"],"install":[{"cmd":"npm install chai-things","lang":"bash","label":"npm"},{"cmd":"yarn add chai-things","lang":"bash","label":"yarn"},{"cmd":"pnpm add chai-things","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required to use chai-things","package":"chai","optional":false}],"imports":[{"note":"CommonJS require works but is not recommended for ESM projects. The package does not export named symbols.","wrong":"const chaiThings = require('chai-things'); chai.use(chaiThings);","symbol":"default","correct":"import chaiThings from 'chai-things'; chai.use(chaiThings);"},{"note":"chai-things does not export named symbols; it only registers Chai plugins and extends the assertion chain.","wrong":"import { something } from 'chai-things';","symbol":"chai-things","correct":"import 'chai-things'; // side-effect import when used via chai.should()"},{"note":"chai-things must be used with chai.use(). There is no default export or Plugin class.","wrong":"const { Plugin } = require('chai-things');","symbol":"Plugin usage","correct":"chai.use(require('chai-things')); // CommonJS"}],"quickstart":{"code":"const chai = require('chai');\nchai.should();\nchai.use(require('chai-things'));\n\n// Example:\nconst items = [{ a: 1 }, { b: 2 }];\nitems.should.include.something.that.deep.equals({ b: 2 });\n// passes\n\nitems.should.all.have.property('a');\n// fails because { b: 2 } does not have property 'a'\n\nitems.should.not.include.something.that.deep.equals({ c: 3 });\n// passes\n","lang":"javascript","description":"Install chai-things, register with chai, and use include.something.that / all / none assertions on arrays."},"warnings":[{"fix":"Consider using chai.assert.deepInclude or other native Chai methods, or migrate to a maintained library.","message":"Package has not been updated since 2016. It may not work with Chai 5.x or newer.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use dynamic import: const chaiThings = (await import('chai-things')).default;","message":"Cannot be used with ESM imports directly; only CommonJS require works reliably.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Always call chai.should() earlier or use chai.expect with chai-things.","message":"In Chai 4.x, 'should' interface requires chai.should() call before chai.use(require('chai-things')).","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Add explicit length check if needed: arr.should.have.length.gt(0).and.all.satisfy(...).","message":"The 'all' and 'none' matchers treat empty arrays as vacuously true (all matches everything, none matches nothing).","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure you have required chai and called chai.should() or chai.expect before using chai-things.","cause":"chai is not imported or chai.should() not called.","error":"TypeError: Cannot read property 'use' of undefined"},{"fix":"Check that array is not empty or use include.something.that on non-empty arrays.","cause":"Using something matcher on an empty array; no element matches.","error":"AssertionError: expected [] to include something that deeply equals ..."},{"fix":"Ensure the value being tested is an Array.","cause":"Attempting to use include.something.that on a non-array object.","error":"chai-things: Error: cannot call include.something.that on non-array value"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}