Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
jest-diff: Replace diff with diff-sequences package #6961
Much faster when number of changed lines is large: less memory and fewer iterations.
The baseline and improved versions report the same number of changed versus common lines.
This a breaking change from viewpoint of dependents like
Given received and expected values, the improved version can return different particular lines as inserted, deleted, or common than the baseline version (especially for swapped lines, see below).
In case you ask why different particular lines, because
The tests for
For realistic differences of
By the way, Jest still has
yarn why diff - "_project_#mocha" depends on it - Hoisted from "_project_#mocha#diff" - Hoisted from "_project_#example-typescript#ts-jest#jest-config#jest-jasmine2#jest-diff#diff"
Updated 6 snapshots for
Differences in baseline version, that is, 10 is change, 9 is common:
Differences in improved version, that is, 9 is change, 10 is common:
Updated 4 snapshots in
Differences in baseline version, that is, 1 is change, 2 is common:
Differences in improved version, that is, 2 is change, 1 is common:
@@ Coverage Diff @@ ## master #6961 +/- ## ========================================= + Coverage 66.86% 67% +0.13% ========================================= Files 250 250 Lines 10460 10510 +50 Branches 3 3 ========================================= + Hits 6994 7042 +48 - Misses 3465 3467 +2 Partials 1 1
Wooooooo! I've been waiting for this!
React also uses
Goal for this pull request is improve performance. A separate pull request #6917 explains in
The formatting remains the same, so most dependents which use
referenced this pull request
Sep 13, 2018
Might be a good idea to create a performance suite for this, similar to https://github.com/facebook/jest/tree/master/packages/pretty-format/perf
(although I would prefer it to be written in https://github.com/bestiejs/benchmark.js/ or something and not something home cooked)
@thymikee A performance suite in
The problem solved by replacing
@SimenB Thank you for suggesting
I will convert perf test for
That's a good idea. Too bad I didn't think of it before trying this fork. I was in a real hurry and I just wanted to
Just for the record, I first tried to
Finally, after some checks I would've done before chasing the error in jest, I realized that my snapshot tests were failing because I had some snapshots with really huge sizes (35MB, 13MB being the largest) so I came with strategy of splitting the snapshots in multiple files and now the largest are at most ~1.4MB, which run just fine.
I hope I can fix some other stuff quickly so I can