Skip to content

Commit

Permalink
HTML Reporter: Move internal diff.js import to core.js
Browse files Browse the repository at this point in the history
Ref #1118.
  • Loading branch information
Krinkle committed Sep 24, 2023
1 parent 8e5f59b commit 8e36011
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ProcessingQueue from './core/processing-queue';
import { on, emit } from './events';
import onWindowError from './core/onerror';
import onUncaughtException from './core/on-uncaught-exception';
import diff from './core/diff';

const QUnit = {};

Expand All @@ -42,6 +43,7 @@ QUnit.version = '@VERSION';
extend(QUnit, {
config,

diff,
dump,
equiv,
reporters,
Expand Down
8 changes: 3 additions & 5 deletions src/html-reporter/diff.js → src/core/diff.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QUnit from '../core';
/* eslint-disable indent */
import { escapeText } from '../core/utilities';

/*
Expand Down Expand Up @@ -29,7 +29,6 @@ import { escapeText } from '../core/utilities';
* Usage: QUnit.diff(expected, actual)
*
*/
QUnit.diff = (function () {
function DiffMatchPatch () {
}

Expand Down Expand Up @@ -1112,13 +1111,12 @@ QUnit.diff = (function () {
}
};

return function (o, n) {
export default function diff (o, n) {
let diff, output, text;
diff = new DiffMatchPatch();
output = diff.DiffMain(o, n);
diff.diffCleanupEfficiency(output);
text = diff.diffPrettyHtml(output);

return text;
};
}());
}
3 changes: 0 additions & 3 deletions src/html-reporter/reporter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
import './fixture';
import './diff';
import './urlparams';
import './html';
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion src/qunit.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import './core';
import './html-reporter/reporter';
import './html-runner/fixture';
import './html-runner/urlparams';
import './html-reporter/html';

0 comments on commit 8e36011

Please sign in to comment.