Adds new configuration option to failSpecWithNoExpectations that will report specs without expectations as failures if enabled
This commit is contained in:
committed by
Steve Gravrock
parent
e8870db8d3
commit
7263a38c3f
@@ -65,6 +65,16 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
* @default false
|
||||
*/
|
||||
failFast: false,
|
||||
/**
|
||||
* Whether to fail the spec if it ran no expectations. By default
|
||||
* a spec that ran no expectations is reported as passed. Setting this
|
||||
* to true will report such spec as a failure.
|
||||
* @name Configuration#failSpecWithNoExpectations
|
||||
* @since 3.5.0
|
||||
* @type Boolean
|
||||
* @default false
|
||||
*/
|
||||
failSpecWithNoExpectations: false,
|
||||
/**
|
||||
* Whether to cause specs to only have one expectation failure.
|
||||
* @name Configuration#oneFailurePerSpec
|
||||
@@ -167,6 +177,11 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
config.failFast = configuration.failFast;
|
||||
}
|
||||
|
||||
if (configuration.hasOwnProperty('failSpecWithNoExpectations')) {
|
||||
config.failSpecWithNoExpectations =
|
||||
configuration.failSpecWithNoExpectations;
|
||||
}
|
||||
|
||||
if (configuration.hasOwnProperty('oneFailurePerSpec')) {
|
||||
config.oneFailurePerSpec = configuration.oneFailurePerSpec;
|
||||
}
|
||||
@@ -641,6 +656,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
tree: topSuite,
|
||||
runnableIds: runnablesToRun,
|
||||
queueRunnerFactory: queueRunnerFactory,
|
||||
failSpecWithNoExpectations: config.failSpecWithNoExpectations,
|
||||
nodeStart: function(suite, next) {
|
||||
currentlyExecutingSuites.push(suite);
|
||||
defaultResourcesForRunnable(suite.id, suite.parentSuite.id);
|
||||
|
||||
Reference in New Issue
Block a user