Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chaijs/chai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.7
Choose a base ref
...
head repository: chaijs/chai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.8
Choose a head ref
  • 9 commits
  • 8 files changed
  • 7 contributors

Commits on Nov 7, 2022

  1. build

    keithamus committed Nov 7, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    keithamus Keith Cirkel
    Copy the full SHA
    3c947a7 View commit details

Commits on Nov 9, 2022

  1. chore: 4.x.x: Fix link to commit logs on GitHub (#1487)

    * 4.x.x: Fix link to commit logs on GitHub
    
    As there is no `master` branch, the link returned a 404.
    
    * Update History.md
    
    Co-authored-by: Andre Meyering <info@andremeyering.de>
    
    Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
    bugwelle and keithamus authored Nov 9, 2022

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    acd16e0 View commit details

Commits on Nov 10, 2022

  1. build(deps): bump socket.io-parser from 4.0.4 to 4.0.5 (#1488)

    Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5.
    - [Release notes](https://github.com/socketio/socket.io-parser/releases)
    - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md)
    - [Commits](socketio/socket.io-parser@4.0.4...4.0.5)
    
    ---
    updated-dependencies:
    - dependency-name: socket.io-parser
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 10, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    98f4233 View commit details

Commits on Nov 12, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b455124 View commit details

Commits on Dec 5, 2022

  1. docs: specify return type of objDisplay (#1490)

    previously it was incorrectly labeled as `objDisplay(obj: object): void` in `@types/chai`.
    scarf005 authored Dec 5, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3a8c49a View commit details

Commits on May 30, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1a8247f View commit details

Commits on Aug 24, 2023

  1. Fix: update exports.version to current version (#1534)

    * Change exports.version in lib/chai to 4.3.7
    
    * Update lib/chai/exports.version to 4.3.8
    peanutenthusiast authored Aug 24, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b351dc0 View commit details
  2. build

    keithamus committed Aug 24, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    keithamus Keith Cirkel
    Copy the full SHA
    8d3205b View commit details
  3. 4.3.8

    keithamus committed Aug 24, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    keithamus Keith Cirkel
    Copy the full SHA
    d9ff2c6 View commit details
Showing with 55 additions and 28 deletions.
  1. +1 −7 CONTRIBUTING.md
  2. +1 −1 History.md
  3. +41 −9 chai.js
  4. +1 −1 lib/chai.js
  5. +1 −0 lib/chai/utils/objDisplay.js
  6. +1 −1 lib/chai/utils/test.js
  7. +8 −8 package-lock.json
  8. +1 −1 package.json
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ Following these guidelines helps to communicate that you respect the time of the

- Creating an Issue or Pull Request requires a [GitHub](http://github.com) account.
- Issue reports should be **clear**, **concise** and **reproducible**. Check to see if your issue has already been resolved in the [master]() branch or already reported in Chai's [GitHub Issue Tracker](https://github.com/chaijs/chai/issues).
- Pull Requests must adhere to strict [coding style guidelines](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
- In general, avoid submitting PRs for new Assertions without asking core contributors first. More than likely it would be better implemented as a plugin.
- Additional support is available via the [Google Group](http://groups.google.com/group/chaijs) or on irc.freenode.net#chaijs.
- **IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the same license as that used by the project.
@@ -91,7 +90,7 @@ Good pull requests - patches, improvements, new features - are a fantastic help.
**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Please review the [Chai.js Coding Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage).
Follow this process if you'd like your work considered for inclusion in the project:
@@ -185,11 +184,6 @@ For most of the documentation you are going to want to visit [ChaiJS.com](http:/
- [API Reference](http://chaijs.com/api/)
- [Plugins](http://chaijs.com/plugins/)

Alternatively, the [wiki](https://github.com/chaijs/chai/wiki) might be what you are looking for.

- [Chai Coding Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide)
- [Third-party Resources](https://github.com/chaijs/chai/wiki/Third-Party-Resources)

Or finally, you may find a core-contributor or like-minded developer in any of our support channels.

- IRC: irc.freenode.org #chaijs
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Note

As of 3.0.0, the History.md file has been deprecated. [Please refer to the full
commit logs available on GitHub](https://github.com/chaijs/chai/commits/master).
commit logs available on GitHub](https://github.com/chaijs/chai/commits).

---

50 changes: 41 additions & 9 deletions chai.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ var used = [];
* Chai version
*/

exports.version = '4.3.3';
exports.version = '4.3.8';

/*!
* Assertion Error
@@ -8608,6 +8608,7 @@ var config = require('../config');
* messages or should be truncated.
*
* @param {Mixed} javascript object to inspect
* @returns {string} stringified object
* @name objDisplay
* @namespace Utils
* @api public
@@ -9062,7 +9063,7 @@ var flag = require('./flag');
/**
* ### .test(object, expression)
*
* Test and object for expression.
* Test an object for expression.
*
* @param {Object} object (constructed Assertion)
* @param {Arguments} chai.Assertion.prototype.assert arguments
@@ -9430,10 +9431,10 @@ function FakeMap() {
}

FakeMap.prototype = {
get: function getMap(key) {
get: function get(key) {
return key[this._key];
},
set: function setMap(key, value) {
set: function set(key, value) {
if (Object.isExtensible(key)) {
Object.defineProperty(key, this._key, {
value: value,
@@ -9625,8 +9626,9 @@ function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandTyp
case 'function':
case 'WeakMap':
case 'WeakSet':
case 'Error':
return leftHandOperand === rightHandOperand;
case 'Error':
return keysEqual(leftHandOperand, rightHandOperand, [ 'name', 'message', 'code' ], options);
case 'Arguments':
case 'Int8Array':
case 'Uint8Array':
@@ -9651,6 +9653,19 @@ function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandTyp
return entriesEqual(leftHandOperand, rightHandOperand, options);
case 'Map':
return entriesEqual(leftHandOperand, rightHandOperand, options);
case 'Temporal.PlainDate':
case 'Temporal.PlainTime':
case 'Temporal.PlainDateTime':
case 'Temporal.Instant':
case 'Temporal.ZonedDateTime':
case 'Temporal.PlainYearMonth':
case 'Temporal.PlainMonthDay':
return leftHandOperand.equals(rightHandOperand);
case 'Temporal.Duration':
return leftHandOperand.total('nanoseconds') === rightHandOperand.total('nanoseconds');
case 'Temporal.TimeZone':
case 'Temporal.Calendar':
return leftHandOperand.toString() === rightHandOperand.toString();
default:
return objectEqual(leftHandOperand, rightHandOperand, options);
}
@@ -9796,6 +9811,11 @@ function getEnumerableKeys(target) {
return keys;
}

function getNonEnumerableSymbols(target) {
var keys = Object.getOwnPropertySymbols(target);
return keys;
}

/*!
* Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
* each key. If any value of the given key is not equal, the function will return false (early).
@@ -9828,14 +9848,16 @@ function keysEqual(leftHandOperand, rightHandOperand, keys, options) {
* @param {Object} [options] (Optional)
* @return {Boolean} result
*/

function objectEqual(leftHandOperand, rightHandOperand, options) {
var leftHandKeys = getEnumerableKeys(leftHandOperand);
var rightHandKeys = getEnumerableKeys(rightHandOperand);
var leftHandSymbols = getNonEnumerableSymbols(leftHandOperand);
var rightHandSymbols = getNonEnumerableSymbols(rightHandOperand);
leftHandKeys = leftHandKeys.concat(leftHandSymbols);
rightHandKeys = rightHandKeys.concat(rightHandSymbols);

if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
leftHandKeys.sort();
rightHandKeys.sort();
if (iterableEqual(leftHandKeys, rightHandKeys) === false) {
if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) {
return false;
}
return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
@@ -9872,6 +9894,16 @@ function isPrimitive(value) {
return value === null || typeof value !== 'object';
}

function mapSymbols(arr) {
return arr.map(function mapSymbol(entry) {
if (typeof entry === 'symbol') {
return entry.toString();
}

return entry;
});
}

},{"type-detect":39}],36:[function(require,module,exports){
'use strict';

2 changes: 1 addition & 1 deletion lib/chai.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ var used = [];
* Chai version
*/

exports.version = '4.3.3';
exports.version = '4.3.8';

/*!
* Assertion Error
1 change: 1 addition & 0 deletions lib/chai/utils/objDisplay.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ var config = require('../config');
* messages or should be truncated.
*
* @param {Mixed} javascript object to inspect
* @returns {string} stringified object
* @name objDisplay
* @namespace Utils
* @api public
2 changes: 1 addition & 1 deletion lib/chai/utils/test.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ var flag = require('./flag');
/**
* ### .test(object, expression)
*
* Test and object for expression.
* Test an object for expression.
*
* @param {Object} object (constructed Assertion)
* @param {Arguments} chai.Assertion.prototype.assert arguments
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
"Veselin Todorov <hi@vesln.com>",
"John Firebaugh <john.firebaugh@gmail.com>"
],
"version": "4.3.7",
"version": "4.3.8",
"repository": {
"type": "git",
"url": "https://github.com/chaijs/chai"