From ed11ff063ff35879a2f111da81b7a0814988e1f4 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Sat, 26 May 2018 01:46:44 +0300 Subject: [PATCH] fix: ensure karma.config is passed (#192) --- src/adapter.js | 9 ++++----- src/adapter.wrapper | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/adapter.js b/src/adapter.js index bf75712..8e5c09d 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -173,12 +173,11 @@ var createMochaReporterConstructor = function (tc, pathname) { } } /* eslint-disable no-unused-vars */ -var createMochaStartFn = function (mocha) { +var createMochaStartFn = function (karma, mocha) { /* eslint-enable no-unused-vars */ - return function (config) { - var clientArguments - config = config || {} - clientArguments = config.args + return function () { + var config = karma.config || {} + var clientArguments = config.args if (clientArguments) { if (Object.prototype.toString.call(clientArguments) === '[object Array]') { diff --git a/src/adapter.wrapper b/src/adapter.wrapper index 5281d41..53b31b0 100644 --- a/src/adapter.wrapper +++ b/src/adapter.wrapper @@ -2,6 +2,6 @@ %CONTENT% - window.__karma__.start = createMochaStartFn(window.mocha) + window.__karma__.start = createMochaStartFn(window.__karma__, window.mocha) window.mocha.setup(createConfigObject(window.__karma__)) })(window)