Top-level specs should compute fullName the same as Suites

- No longer include "Jasmine__TopLevel__Suite"
This commit is contained in:
Gregg Van Hove
2016-02-25 14:29:35 -08:00
parent db8e636021
commit 5583b6f954
4 changed files with 24 additions and 12 deletions

View File

@@ -123,7 +123,13 @@ getJasmineRequireObj().Env = function(j$) {
};
var getSpecName = function(spec, suite) {
return suite.getFullName() + ' ' + spec.description;
var fullName = [spec.description],
suiteFullName = suite.getFullName();
if (suiteFullName !== '') {
fullName.unshift(suiteFullName);
}
return fullName.join(' ');
};
// TODO: we may just be able to pass in the fn instead of wrapping here

View File

@@ -29,13 +29,13 @@ getJasmineRequireObj().Suite = function(j$) {
};
Suite.prototype.getFullName = function() {
var fullName = this.description;
for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
var fullName = [];
for (var parentSuite = this; parentSuite; parentSuite = parentSuite.parentSuite) {
if (parentSuite.parentSuite) {
fullName = parentSuite.description + ' ' + fullName;
fullName.unshift(parentSuite.description);
}
}
return fullName;
return fullName.join(' ');
};
Suite.prototype.disable = function() {