From 1bd41ad7182e1a637c79948c009a521772b7b77b Mon Sep 17 00:00:00 2001 From: Adam Gruber Date: Mon, 27 Apr 2020 12:03:46 -0400 Subject: [PATCH] Fix inline diffs (#313) * Set mocha config in tdd script * Replace deprecated mocha option Mocha deprecated `useInlineDiffs` in favor of `inlineDiffs` * Update CHANGELOG Co-authored-by: Adam Gruber --- CHANGELOG.md | 2 ++ package.json | 2 +- src/config.js | 2 +- test/reporter.test.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de9dda2..f7d5f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # mochawesome changelog ## [Unreleased] +### Fixed +- Restore inline-diff rendering [#312](https://github.com/adamgruber/mochawesome/issues/312) ## [6.1.0] - 2020-04-13 ### Changed diff --git a/package.json b/package.json index dbdc534..63c50df 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test:prog": "node ./test-programmatic", "test:mem": "mocha test-functional/mem-test.js --config test-functional/.mocharc.json", "test:ctx": "mocha test-functional/test-context.js --config test-functional/.mocharc.json", - "tdd": "npm run lint && cross-env NODE_ENV=test nyc mocha --watch", + "tdd": "npm run lint && cross-env NODE_ENV=test nyc mocha --config test/.mocharc.json --watch", "prepack": "npm run test" }, "author": "Adam Gruber", diff --git a/src/config.js b/src/config.js index 873bd4c..c908ef3 100644 --- a/src/config.js +++ b/src/config.js @@ -39,7 +39,7 @@ module.exports = function (opts) { saveHtml: _getOption('html', reporterOpts, true, true), saveJson: _getOption('json', reporterOpts, true, true), consoleReporter: _getOption('consoleReporter', reporterOpts, false, 'spec'), - useInlineDiffs: !!opts.useInlineDiffs, + useInlineDiffs: !!opts.inlineDiffs, code: noCode ? false : code }; }; diff --git a/test/reporter.test.js b/test/reporter.test.js index e5114e6..44d5972 100644 --- a/test/reporter.test.js +++ b/test/reporter.test.js @@ -239,7 +239,7 @@ describe('Mochawesome Reporter', () => { describe('mocha options', () => { beforeEach(() => { - mochaReporter = makeReporter({ useInlineDiffs: true }); + mochaReporter = makeReporter({ inlineDiffs: true }); }); it('should transfer mocha options', done => {