mirror of
https://github.com/FormidableLabs/react-fast-compare.git
synced 2026-01-18 16:13:59 +00:00
- Update library to include ES.next support for `Map`, `Set`, `ArrayBuffer`. Part of #36 - Update to `fast-deep-equal@3.1.1` with modified support for ES.next data types. - Upgrade lots of `devDependenices` - Use `fast-deep-equal` tests directly in our correctness tests. - Update CI to modern Node.js versions. - **Note**: There's a bug / limitation of `Set` comparisons whereby objects are compared by reference not value. Tracked at #50 . In our `yarn benchmark`, `lodash.isEqual` gets test differences because it correctly handles those.
31 lines
648 B
JavaScript
31 lines
648 B
JavaScript
'use strict';
|
|
|
|
var assert = require('assert');
|
|
var sinon = require('sinon');
|
|
|
|
var equal = require('../..');
|
|
var tests = require('./tests');
|
|
|
|
describe('basics', function() {
|
|
let sandbox;
|
|
|
|
beforeEach(() => {
|
|
sandbox = sinon.createSandbox();
|
|
sandbox.stub(console, 'warn');
|
|
});
|
|
|
|
afterEach(() => {
|
|
sandbox.restore();
|
|
});
|
|
|
|
tests.all.forEach(function (suite) {
|
|
describe(suite.description, function() {
|
|
suite.tests.forEach(function (test) {
|
|
(test.skip ? it.skip : it)(test.description, function() {
|
|
assert.strictEqual(equal(test.value1, test.value2), test.equal);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|