diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index fa0ae527..8503208b 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -2099,11 +2099,7 @@ getJasmineRequireObj().Env = function(j$) { } addSpecsToSuite(suite, specDefinitions); if (suite.parentSuite && !suite.children.length) { - this.deprecated( - '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.' - ); + throw new Error('describe with no children (describe() or it())'); } return suite; }; diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index 53b7dc05..75979537 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -149,15 +149,10 @@ describe('Env', function() { ); }); - it('logs a deprecation when it has no children', function() { - spyOn(env, 'deprecated'); - env.describe('no children', function() {}); - expect(env.deprecated).toHaveBeenCalledWith( - '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.' - ); + it('throws an error when it has no children', function() { + expect(function() { + env.describe('done method', function() {}); + }).toThrowError('describe with no children (describe() or it())'); }); }); diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index facbb62c..2e2656f0 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -2036,6 +2036,7 @@ describe('Env integration', function() { } catch (e) { exception = e; } + env.it('has a test', function() {}); }); env.execute(null, function() { diff --git a/src/core/Env.js b/src/core/Env.js index 1d950402..fed16dfc 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -1097,11 +1097,7 @@ getJasmineRequireObj().Env = function(j$) { } addSpecsToSuite(suite, specDefinitions); if (suite.parentSuite && !suite.children.length) { - this.deprecated( - '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.' - ); + throw new Error('describe with no children (describe() or it())'); } return suite; };