diff --git a/CHANGELOG.md b/CHANGELOG.md index 39021d60caf7..1f90b4117584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - `[jest-snapshot]` Introduce `toMatchInlineSnapshot` and `toThrowErrorMatchingInlineSnapshot` matchers ([#6380](https://github.com/facebook/jest/pull/6380)) +### Fixes + +- `[describe]` no longer throws an error in case of no tests are passed + ### Chore & Maintenance - `[website]` Switch domain to https://jestjs.io ([#6549](https://github.com/facebook/jest/pull/6549)) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index d547c0a8f271..7bda83ba10ac 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -322,6 +322,9 @@ export default function(j$) { this.describe = function(description, specDefinitions) { const suite = suiteFactory(description); + if (!specDefinitions) { + return; + } if (specDefinitions.length > 0) { throw new Error('describe does not expect any arguments'); }