Merge branch 'no-children' of https://github.com/johnjbarton/jasmine into 4.0
* Merges #1742 from @johnjbarton
This commit is contained in:
@@ -2099,11 +2099,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
addSpecsToSuite(suite, specDefinitions);
|
addSpecsToSuite(suite, specDefinitions);
|
||||||
if (suite.parentSuite && !suite.children.length) {
|
if (suite.parentSuite && !suite.children.length) {
|
||||||
this.deprecated(
|
throw new Error('describe with no children (describe() or it())');
|
||||||
'describe with no children (describe() or it()) is ' +
|
|
||||||
'deprecated and will be removed in a future version of Jasmine. ' +
|
|
||||||
'Please either remove the describe or add children to it.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return suite;
|
return suite;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -149,15 +149,10 @@ describe('Env', function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('logs a deprecation when it has no children', function() {
|
it('throws an error when it has no children', function() {
|
||||||
spyOn(env, 'deprecated');
|
expect(function() {
|
||||||
env.describe('no children', function() {});
|
env.describe('done method', function() {});
|
||||||
expect(env.deprecated).toHaveBeenCalledWith(
|
}).toThrowError('describe with no children (describe() or it())');
|
||||||
'describe with no children' +
|
|
||||||
' (describe() or it()) is deprecated and will be removed in a future ' +
|
|
||||||
'version of Jasmine. Please either remove the describe or add ' +
|
|
||||||
'children to it.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2036,6 +2036,7 @@ describe('Env integration', function() {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception = e;
|
exception = e;
|
||||||
}
|
}
|
||||||
|
env.it('has a test', function() {});
|
||||||
});
|
});
|
||||||
|
|
||||||
env.execute(null, function() {
|
env.execute(null, function() {
|
||||||
|
|||||||
@@ -1097,11 +1097,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
addSpecsToSuite(suite, specDefinitions);
|
addSpecsToSuite(suite, specDefinitions);
|
||||||
if (suite.parentSuite && !suite.children.length) {
|
if (suite.parentSuite && !suite.children.length) {
|
||||||
this.deprecated(
|
throw new Error('describe with no children (describe() or it())');
|
||||||
'describe with no children (describe() or it()) is ' +
|
|
||||||
'deprecated and will be removed in a future version of Jasmine. ' +
|
|
||||||
'Please either remove the describe or add children to it.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return suite;
|
return suite;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user