You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
const{ expect }=require("chai");const{ it }=require("mocha");// make a string of 25k lines of random numbers:text1=newArray(25000).fill(0).map((n)=>newArray(20).fill(1).map((n)=>Math.floor(Math.random()*10)).join("")).join("\n");// grab the first 10,000 characters:text2=text1.slice(0,10000);it("diff test",()=>{expect(text1).to.deep.equal(text2);});
Fun. The root issue on Mocha's side is that it pins diff to a specific major version. So this is really a subset of #5114. Marking as a duplicate of that one - thanks for filing!
Bug Report Checklist
faq
label, but none matched my issue.Expected
Diff performs well even on large inputs
Actual
[email protected]
has catastrophic performance in certain cases (see kpdecker/jsdiff#239).On my machine, the diff in this example takes ~45 seconds. If I pin to
[email protected]
, it's almost instantaneous.It takes some fairly custom settings to trigger this issue in Mocha, but still, you might as well upgrade to
[email protected]
.Minimal, Reproducible Example
.mocharc.js
test.js
Versions
mocha: 10.4.0
chai: 4.4.1
diff: 5.0.0
node: 20.10.0
Additional Info
No response
The text was updated successfully, but these errors were encountered: