-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reporter): On no-single-run and failure, emit a debug URL (#235)
* feat(reporter): On no-single-run and failure, emit a debug URL * fix up lint
- Loading branch information
1 parent
a12024d
commit 76f092a
Showing
6 changed files
with
86 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"description": "A Karma plugin - adapter for Jasmine testing framework.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "grunt" | ||
"test": "jasmine; grunt" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -17,6 +17,7 @@ | |
], | ||
"author": "Vojta Jina <vojta.jina@gmail.com>", | ||
"dependencies": { | ||
"jasmine": "^3.4.0", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
johnjbarton
Author
Contributor
|
||
"jasmine-core": "^3.3" | ||
}, | ||
"devDependencies": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
const diInfo = require('../lib/index.js'); | ||
|
||
describe('reporter', () => { | ||
|
||
it('is available via dependency injection', () => { | ||
const diEntry = diInfo['reporter:karma-jasmine']; | ||
expect(diEntry.length).toBe(2); | ||
expect(typeof diEntry[1]).toBe('function'); | ||
}); | ||
|
||
it('logs debug_url', () => { | ||
const logSpy = jasmine.createSpy('consoleLog', console.log); | ||
const originalLog = console.log; | ||
console.log = logSpy; | ||
const InjectKarmaJasmineReporter = diInfo['reporter:karma-jasmine'][1]; | ||
const reporter = InjectKarmaJasmineReporter(false); | ||
reporter.onSpecComplete(/** ignored */undefined, {debug_url: 'hiya'}); | ||
expect(logSpy).toHaveBeenCalledWith('Debug this test: hiya'); | ||
console.log = originalLog; | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"spec_dir": "spec", | ||
"spec_files": [ | ||
"**/*[sS]pec.js" | ||
], | ||
"helpers": [ | ||
"helpers/**/*.js" | ||
], | ||
"stopSpecOnExpectationFailure": false, | ||
"random": true | ||
} |
@johnjbarton are you sure jasmine should be in dependencies and not in devDependencies? Also do note the test command you have here isn't cross-platform