Skip to content

Commit

Permalink
Fix JSDoc for referenceEqual, rename referenceNotEqual into notRefere…
Browse files Browse the repository at this point in the history
…nceEqual
  • Loading branch information
astorije committed Apr 21, 2019
1 parent 307c9f3 commit bfd8eec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
36 changes: 18 additions & 18 deletions chai-immutable.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@
* ### .referenceEqual(value)
*
* Asserts that the reference of the target is equivalent to the reference of
* `collection`. This method preserves the original behavior of chai's equal.
* `collection`. This method preserves the original behavior of Chai's `equal`.
*
* Reasons for this are described in #210.
* See https://github.com/astorije/chai-immutable/issues/210 for more details.
*
* ```js
* const a = List.of(1, 2, 3);
* const b = a
* const b = a;
* const c = List.of(1, 2, 3);
* expect(a).to.referenceEqual(b); // true
* expect(a).to.referenceEqual(c); // false
* expect(a).to.referenceEqual(b);
* expect(a).to.not.referenceEqual(c);
* ```
*
* @name referenceEqual
Expand Down Expand Up @@ -842,16 +842,16 @@
* ### .referenceEqual(actual, expected)
*
* Asserts that the reference of `actual` is equivalent to the reference of
* `expected`. This method preserves the original behavior of chai's equal.
* `expected`. This method preserves the original behavior of Chai's `equal`.
*
* Reasons for this are described in #210.
* See https://github.com/astorije/chai-immutable/issues/210 for more details.
*
* ```js
* const a = List.of(1, 2, 3);
* const b = a
* const b = a;
* const c = List.of(1, 2, 3);
* assert.equal(a, b); // true
* assert.equal(a, c); // false
* assert.referenceEqual(a, b);
* assert.throws(() => assert.referenceEqual(a, c));
* ```
*
* @name referenceEqual
Expand Down Expand Up @@ -892,29 +892,29 @@
};

/**
* ### .referenceNotEqual(actual, expected)
* ### .notReferenceEqual(actual, expected)
*
* Asserts that the reference of `actual` is not equivalent to the reference of
* `expected`. This method preserves the original behavior of chai's notEqual.
* `expected`. This method preserves the original behavior of Chai's `notEqual`.
*
* Reasons for this are described in #210.
* See https://github.com/astorije/chai-immutable/issues/210 for more details.
*
* ```js
* const a = List.of(1, 2, 3);
* const b = a
* const b = a;
* const c = List.of(1, 2, 3);
* assert.referenceNotEqual(a, b); // false
* assert.referenceNotEqual(a, c); // true
* assert.throws(() => assert.notReferenceEqual(a, b));
* assert.notReferenceEqual(a, c);
* ```
*
* @name referenceEqual
* @name notReferenceEqual
* @param {Collection} actual
* @param {Collection} expected
* @namespace Assert
* @api public
*/

assert.referenceNotEqual = originalNotEqual;
assert.notReferenceEqual = originalNotEqual;

/**
* ### .sizeOf(collection, length)
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,19 +993,19 @@ describe('chai-immutable', function() {
});
});

describe('referenceNotEqual assertion', function() {
describe('notReferenceEqual assertion', function() {
it('should pass for different immutable collections with equal values', function() {
const list1 = List.of(1, 2, 3);
const list2 = List.of(1, 2, 3);

assert.referenceNotEqual(list1, list2);
assert.notReferenceEqual(list1, list2);
});

it('should not pass for different immutable collections with equal values', function() {
const list1 = List.of(1, 2, 3);
const list2 = list1;

fail(() => assert.referenceNotEqual(list1, list2));
fail(() => assert.notReferenceEqual(list1, list2));
});
});

Expand Down

0 comments on commit bfd8eec

Please sign in to comment.