Skip to content

📦 Package: Bump diff from 5 to 7 #5330

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Feature Request Checklist

Overview

Mocha currently depends an older major version of diff:

"diff": "^5.2.0",

Suggested Solution

diff@7.0.0 is the latest. It'd be nice to bump to that, so users aren't stuck on a dep that's two major versions behind.

Alternatives

This isn't critical and I don't think we need to do it. But it's nice ecosystem cleanup in general.

I don't know of popular alternatives to diff and haven't looked for them.

Additional Info

The diff package is used in example one place internally, the Base reporter class:

var diff = require('diff');

var msg = diff.createPatch('string', actual, expected);

mocha/lib/reporters/base.js

Lines 532 to 534 in a2e600d

return diff
.diffWordsWithSpace(actual, expected)
.map(function (str) {

diff@7 still supports older Node.js versions than Mocha, so I don't believe we're blocked on that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions