chai-exclude
Advanced tools
Comparing version 2.1.1 to 3.0.0
@@ -1,3 +0,6 @@ | ||
const fclone = require('fclone') | ||
import fclone from 'fclone' | ||
/** | ||
* Chai plugin to exclude keys from comparison. | ||
*/ | ||
function chaiExclude (chai, utils) { | ||
@@ -218,3 +221,2 @@ const assert = chai.assert | ||
module.exports = chaiExclude | ||
module.exports.default = chaiExclude // for Typescript | ||
export default chaiExclude |
{ | ||
"name": "chai-exclude", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"description": "Exclude keys to compare from a deep equal operation with chai expect and assert", | ||
"type": "module", | ||
"main": "chai-exclude.js", | ||
"types": "index.d.ts", | ||
"types": "chai-exclude.d.ts", | ||
"author": "Saugat Acharya <mesaugat@gmail.com>", | ||
@@ -12,8 +13,7 @@ "license": "MIT", | ||
"chai-exclude.js", | ||
"index.d.ts" | ||
"chai-exclude.d.ts" | ||
], | ||
"scripts": { | ||
"test": "mocha --reporter spec --recursive --colors *.test.js && tsd", | ||
"lint": "standard --fix", | ||
"typecheck": "tsd" | ||
"test": "mocha --reporter spec --recursive --colors *.test.js", | ||
"lint": "standard --fix" | ||
}, | ||
@@ -36,7 +36,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/chai": "^4.3.4", | ||
"chai": "^4.3.7", | ||
"mocha": "^10.2.0", | ||
"standard": "^17.0.0", | ||
"tsd": "^0.25.0" | ||
"@types/chai": "^4.3.16", | ||
"chai": "^5.1.1", | ||
"mocha": "^10.6.0", | ||
"standard": "^17.0.0" | ||
}, | ||
@@ -47,4 +46,4 @@ "dependencies": { | ||
"peerDependencies": { | ||
"chai": ">= 4.0.0 < 5" | ||
"chai": ">= 5" | ||
} | ||
} |
@@ -12,3 +12,3 @@ # chai-exclude | ||
Sometimes you'll need to exclude object properties that generate unique values while doing a deep equal operation. This plugin makes it easier to remove those properties from comparison. | ||
Sometimes you'll need to exclude object properties that generate unique values while doing an assertion. This plugin makes it easier to remove those properties from comparison. | ||
@@ -19,2 +19,4 @@ Works with both objects and array of objects with or without circular references. | ||
`chai-exclude` is an ESM package targeting Chai v5 and above. | ||
```bash | ||
@@ -24,4 +26,6 @@ npm install chai-exclude --save-dev | ||
If you are using Chai v4, you can use the CommonJS version of the package. | ||
```bash | ||
yarn add chai-exclude --dev | ||
npm install chai-exclude@2.1.1 --save-dev | ||
``` | ||
@@ -31,31 +35,10 @@ | ||
### Require | ||
```js | ||
const chai = require('chai'); | ||
const chaiExclude = require('chai-exclude'); | ||
import { use } from 'chai' | ||
import chaiExclude from 'chai-exclude' | ||
chai.use(chaiExclude); | ||
// If you are using TypeScript, the typings for chai-exclude are included in the package | ||
use(chaiExclude) | ||
``` | ||
### ES6 Import | ||
```js | ||
import chai from 'chai'; | ||
import chaiExclude from 'chai-exclude'; | ||
chai.use(chaiExclude); | ||
``` | ||
### TypeScript | ||
```js | ||
import * as chai from 'chai'; | ||
import chaiExclude from 'chai-exclude'; | ||
chai.use(chaiExclude); | ||
// The typings for chai-exclude are included with the package itself. | ||
``` | ||
## Examples | ||
@@ -62,0 +45,0 @@ |
4
212
Yes
14051
199