From 05afbbaf66ee10b751cf5f250835eaa14de6d7ca Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 18 Nov 2016 19:47:47 +0100 Subject: [PATCH] Better diffs for specs. --- package.json | 2 ++ test/unit/karma.conf.js | 5 ++++- yarn.lock | 12 +++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 66134807..2388ade8 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs" }, "dependencies": { + "diff": "^3.0.1", + "karma-mocha-reporter": "^2.2.1", "moment": "^2.15.2", "node-sass": "^3.10.1", "sanitize-html": "^1.13.0", diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index ce413a43..78910f42 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -55,7 +55,7 @@ module.exports = function (config) { // 2. add it to the `browsers` array below. browsers: ['PhantomJS'], frameworks: ['mocha', 'sinon-chai'], - reporters: ['spec'], + reporters: ['mocha'], files: ['./index.js'], preprocessors: { './index.js': ['webpack', 'sourcemap'] @@ -64,6 +64,9 @@ module.exports = function (config) { webpackMiddleware: { noInfo: true }, + mochaReporter: { + showDiff: true + }, coverageReporter: { dir: './coverage', reporters: [ diff --git a/yarn.lock b/yarn.lock index 189019c6..dad4e220 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1061,7 +1061,7 @@ chai@^3.5.0: deep-eql "^0.1.3" type-detect "^1.0.0" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1656,6 +1656,10 @@ di@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" +diff: + version "3.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.0.1.tgz#a52d90cc08956994be00877bff97110062582c35" + diff@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" @@ -3141,6 +3145,12 @@ karma-coverage@^1.1.1: minimatch "^3.0.0" source-map "^0.5.1" +karma-mocha-reporter: + version "2.2.1" + resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.1.tgz#8508b2f0925433a6417f0c528e53fcb411745758" + dependencies: + chalk "1.1.3" + karma-mocha@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-1.2.0.tgz#bca6be2a66805b847417e8d2873fd0b5b27ee7cd"