Skip to content

Commit

Permalink
feat(reporter): On no-single-run and failure, emit a debug URL
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjbarton committed Aug 9, 2019
1 parent cd6f060 commit 0bda0e9
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 18 deletions.
1 change: 1 addition & 0 deletions karma.conf.js
@@ -1,6 +1,7 @@
module.exports = function (config) {
config.set({
frameworks: ['jasmine'],
reporters: ['karma-jasmine'],

files: [
'src/*.js',
Expand Down
15 changes: 14 additions & 1 deletion lib/index.js
Expand Up @@ -13,6 +13,19 @@ var initJasmine = function (files) {

initJasmine.$inject = ['config.files']

function InjectKarmaJasmineReporter(singleRun) {
return {
onSpecComplete(browser, karmaResult) {
if (!singleRun && karmaResult.debug_url) {
console.log('Debug this test: ' + karmaResult.debug_url);
}
}
}
}

InjectKarmaJasmineReporter.$inject = ['config.singleRun']

module.exports = {
'framework:jasmine': ['factory', initJasmine]
'framework:jasmine': ['factory', initJasmine],
'reporter:karma-jasmine': ['factory', InjectKarmaJasmineReporter],
}
51 changes: 35 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -4,7 +4,7 @@
"description": "A Karma plugin - adapter for Jasmine testing framework.",
"main": "lib/index.js",
"scripts": {
"test": "grunt test"
"test": "jasmine; grunt test"
},
"repository": {
"type": "git",
Expand All @@ -17,6 +17,7 @@
],
"author": "Vojta Jina <vojta.jina@gmail.com>",
"dependencies": {
"jasmine": "^3.4.0",
"jasmine-core": "^3.3"
},
"devDependencies": {
Expand Down

0 comments on commit 0bda0e9

Please sign in to comment.