Include the name of the suite in the empty suite error message
This commit is contained in:
@@ -2169,7 +2169,10 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
addSpecsToSuite(suite, specDefinitions);
|
addSpecsToSuite(suite, specDefinitions);
|
||||||
if (suite.parentSuite && !suite.children.length) {
|
if (suite.parentSuite && !suite.children.length) {
|
||||||
throw new Error('describe with no children (describe() or it())');
|
throw new Error(
|
||||||
|
'describe with no children (describe() or it()): ' +
|
||||||
|
suite.getFullName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return suite.metadata;
|
return suite.metadata;
|
||||||
};
|
};
|
||||||
|
|||||||
+11
-3
@@ -235,9 +235,17 @@ describe('Env', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('throws an error when it has no children', function() {
|
it('throws an error when it has no children', function() {
|
||||||
expect(function() {
|
let ran = false;
|
||||||
env.describe('done method', function() {});
|
env.describe('parent suite', function() {
|
||||||
}).toThrowError('describe with no children (describe() or it())');
|
expect(function() {
|
||||||
|
env.describe('child suite', function() {});
|
||||||
|
}).toThrowError(
|
||||||
|
'describe with no children (describe() or it()): parent suite child suite'
|
||||||
|
);
|
||||||
|
ran = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(ran).toBeTrue();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -1028,7 +1028,10 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
addSpecsToSuite(suite, specDefinitions);
|
addSpecsToSuite(suite, specDefinitions);
|
||||||
if (suite.parentSuite && !suite.children.length) {
|
if (suite.parentSuite && !suite.children.length) {
|
||||||
throw new Error('describe with no children (describe() or it())');
|
throw new Error(
|
||||||
|
'describe with no children (describe() or it()): ' +
|
||||||
|
suite.getFullName()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return suite.metadata;
|
return suite.metadata;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user