-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for test name to contain parent suite(s) names #85
Merged
dignifiedquire
merged 1 commit into
karma-runner:master
from
phillipj:fix/default-test-name
Mar 10, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,23 +20,31 @@ | |
], | ||
"author": "Vojta Jina <[email protected]>", | ||
"dependencies": { | ||
"path-is-absolute": "^1.0.0", | ||
"xmlbuilder": "3.1.0" | ||
}, | ||
"peerDependencies": { | ||
"karma": ">=0.9" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"eslint": "^1.2.1", | ||
"eslint-config-standard": "^4.1.0", | ||
"eslint-plugin-standard": "^1.3.1", | ||
"grunt": "^0.4.1", | ||
"grunt-bump": "^0.5.0", | ||
"grunt-cli": "^0.1.13", | ||
"grunt-conventional-changelog": "^4.1.0", | ||
"grunt-conventional-github-releaser": "^0.4.0", | ||
"grunt-eslint": "^17.1.0", | ||
"grunt-npm": "^0.0.2", | ||
"load-grunt-tasks": "^3.2.0" | ||
"grunt-simple-mocha": "^0.4.1", | ||
"load-grunt-tasks": "^3.2.0", | ||
"mocha": "^2.4.5", | ||
"proxyquire": "^1.7.4", | ||
"sinon": "^1.17.3", | ||
"sinon-chai": "^2.8.0" | ||
}, | ||
"contributors": [ | ||
"dignifiedquire <[email protected]>", | ||
|
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,5 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
} | ||
} |
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,83 @@ | ||
'use strict' | ||
|
||
var chai = require('chai') | ||
var expect = require('chai').expect | ||
var sinon = require('sinon') | ||
var proxyquire = require('proxyquire') | ||
|
||
chai.use(require('sinon-chai')) | ||
|
||
function noop () {} | ||
|
||
var fakeLogger = { | ||
create: noop | ||
} | ||
|
||
var fakeHelper = { | ||
normalizeWinPath: noop, | ||
mkdirIfNotExists: sinon.stub().yields() | ||
} | ||
|
||
var fakeConfig = { | ||
basePath: __dirname, | ||
junitReporter: { | ||
outputFile: '' | ||
} | ||
} | ||
|
||
var fakeBaseReporterDecorator = noop | ||
|
||
describe('JUnit reporter', function () { | ||
var reporterModule | ||
var reporter | ||
|
||
var fakeFs | ||
|
||
beforeEach(function () { | ||
fakeFs = { | ||
writeFile: sinon.spy() | ||
} | ||
|
||
reporterModule = proxyquire('..', { | ||
fs: fakeFs | ||
}) | ||
}) | ||
|
||
beforeEach(function () { | ||
reporter = new reporterModule['reporter:junit'][1](fakeBaseReporterDecorator, fakeConfig, fakeLogger, fakeHelper) | ||
}) | ||
|
||
it('should include parent suite names in generated test names', function () { | ||
var fakeBrowser = { | ||
id: 'Android_4_1_2', | ||
name: 'Android', | ||
fullName: 'Android 4.1.2', | ||
lastResult: { | ||
error: false, | ||
total: 1, | ||
failed: 0, | ||
netTime: 10 * 1000 | ||
} | ||
} | ||
|
||
var fakeResult = { | ||
suite: [ | ||
'Sender', | ||
'using it', | ||
'get request' | ||
], | ||
description: 'should not fail', | ||
log: [] | ||
} | ||
|
||
reporter.onRunStart([ fakeBrowser ]) | ||
reporter.specSuccess(fakeBrowser, fakeResult) | ||
reporter.onBrowserComplete(fakeBrowser) | ||
reporter.onRunComplete() | ||
|
||
expect(fakeFs.writeFile).to.have.been.called | ||
|
||
var writtenXml = fakeFs.writeFile.firstCall.args[1] | ||
expect(writtenXml).to.have.string('testcase name="Sender using it get request should not fail"') | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed locally only globally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
grunt-cli
to avoid requiring global install of gulp. As good npm citizens we should not require such global installs by developers trying to run the tests :)