react-fast-compare/test/node/basics.spec.js
Ryan Roemer 5d71c91e73
Feature: Add support for ES.next Set, Map, ArrayBuffer (#51)
- 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.
2020-01-29 13:52:55 -07:00

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);
});
});
});
});
});