Permalink
Browse files

Upgrade Concordance

This improves the `deepEqual` and `snapshot` assertions, as well as
formatting values used in other assertions.

* Add support for `BigInt`
* Improved support for `Symbol.asyncIterator`
* Fix snapshotting non-list objects with a `length` property
* Support `React.Fragment`

The Concordance changes are not compatible with previous AVA versions.
The snapshot version has been increased accordingly. Users will need to
update their snapshot files for tests to pass.
  • Loading branch information...
novemberborn committed Sep 30, 2018
1 parent 2ff6684 commit 71eede72c4984fa7bf8f7655a0088aa5615e8c39
View
@@ -18,7 +18,7 @@ const concordanceOptions = require('./concordance-options').snapshotManager;
// Increment if encoding layout or Concordance serialization versions change. Previous AVA versions will not be able to
// decode buffers generated by a newer version, so changing this value will require a major version bump of AVA itself.
// The version is encoded as an unsigned 16 bit integer.
const VERSION = 1;
const VERSION = 2;
const VERSION_HEADER = Buffer.alloc(2);
VERSION_HEADER.writeUInt16LE(VERSION);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -66,7 +66,7 @@
"@babel/plugin-syntax-async-generators": "^7.0.0",
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-optional-catch-binding": "^7.0.0",
"@concordance/react": "^1.0.0",
"@concordance/react": "^2.0.0",
"ansi-escapes": "^3.1.0",
"ansi-styles": "^3.2.1",
"arr-flatten": "^1.1.0",
@@ -84,7 +84,7 @@
"cli-truncate": "^1.1.0",
"code-excerpt": "^2.1.1",
"common-path-prefix": "^1.0.0",
"concordance": "^3.0.0",
"concordance": "^4.0.0",
"convert-source-map": "^1.5.1",
"currently-unhandled": "^0.4.1",
"debug": "^3.1.0",
View
BIN -2 Bytes (100%) test/fixture/assert.js.snap
Binary file not shown.
Binary file not shown.
@@ -79,7 +79,7 @@ test('outdated snapshot version is reported to the console', t => {
execCli(['test.js'], {dirname: 'fixture/snapshots'}, (error, stdout) => {
t.ok(error);
t.match(stdout, /The snapshot file is v0, but only v1 is supported\./);
t.match(stdout, /The snapshot file is v0, but only v2 is supported\./);
t.match(stdout, /File path:/);
t.match(stdout, snapPath);
t.match(stdout, /Please run AVA again with the .*--update-snapshots.* flag to upgrade\./);
@@ -93,7 +93,7 @@ test('newer snapshot version is reported to the console', t => {
execCli(['test.js'], {dirname: 'fixture/snapshots'}, (error, stdout) => {
t.ok(error);
t.match(stdout, /The snapshot file is v65535, but only v1 is supported\./);
t.match(stdout, /The snapshot file is v65535, but only v2 is supported\./);
t.match(stdout, /File path:/);
t.match(stdout, snapPath);
t.match(stdout, /You should upgrade AVA\./);
@@ -103,7 +103,7 @@ test('newer snapshot version is reported to the console', t => {
test('snapshot corruption is reported to the console', t => {
const snapPath = path.join(__dirname, '..', 'fixture', 'snapshots', 'test.js.snap');
fs.writeFileSync(snapPath, Buffer.from([0x0A, 0x01, 0x00]));
fs.writeFileSync(snapPath, Buffer.from([0x0A, 0x02, 0x00]));
execCli(['test.js'], {dirname: 'fixture/snapshots'}, (error, stdout) => {
t.ok(error);

0 comments on commit 71eede7

Please sign in to comment.