Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
fix: handle non existing mochaConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 26, 2016
1 parent 0122080 commit dcb74a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 9 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ module.exports = function (config) {

browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],

autoWatch: true
autoWatch: true,

plugins: [
require.resolve('./'),
'karma-chai',
'karma-sinon',
'karma-firefox-launcher',
'karma-chrome-launcher'
]
})
}
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var initMocha = function (files, mochaConfig) {
var mochaPath = path.dirname(require.resolve('mocha'))
files.unshift(createPattern(path.join(__dirname, 'adapter.js')))

if (mochaConfig.require && mochaConfig.require.map) {
if (mochaConfig && mochaConfig.require && mochaConfig.require.map) {
mochaConfig.require.map(function (requirePath) {
return files.unshift(createPattern(requirePath))
})
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@
"grunt-eslint": "^18.0.0",
"grunt-karma": "2.x",
"grunt-npm": "~0.0.2",
"karma": "1.x || ^0.13.15",
"karma-chai": "1.x || ~0.1.0",
"karma-chrome-launcher": "1.x || ^0.2.1",
"karma-firefox-launcher": "1.x || ~0.1.0",
"karma-mocha": "1.x || ~0.2.1",
"karma-sinon": "1.x || ~1.0.3",
"karma": "^1.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-sinon": "^1.0.3",
"load-grunt-tasks": "^3.2.0",
"mocha": "^2.4.5",
"shared-karma-files": "git://github.com/karma-runner/shared-karma-files.git#82ae8d02",
Expand Down

0 comments on commit dcb74a5

Please sign in to comment.