diff --git a/Gruntfile.js b/Gruntfile.js index 14077d78..e50595cd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -40,11 +40,17 @@ module.exports = function(grunt) { jasmine = new Jasmine({jasmineCore: jasmineCore}); jasmine.loadConfigFile('./spec/support/jasmine.json'); - jasmine.onComplete(function(passed) { - done(passed); - }); - jasmine.execute(); + jasmine.exitOnCompletion = false; + jasmine.execute().then( + result => { + done(result.overallStatus === 'passed'); + }, + err => { + console.error(err); + exit(1); + } + ); } ); diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 700e7e18..31dbb06f 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1679,7 +1679,9 @@ getJasmineRequireObj().Env = function(j$) { } delayedExpectationResult.message += - 'Did you forget to return or await the result of expectAsync?'; + '1. Did you forget to return or await the result of expectAsync?\n' + + '2. Was done() invoked before an async operation completed?\n' + + '3. Did an expectation follow a call to done()?'; topSuite.result.failedExpectations.push(delayedExpectationResult); } @@ -10720,5 +10722,5 @@ getJasmineRequireObj().UserContext = function(j$) { }; getJasmineRequireObj().version = function() { - return '3.9.0'; + return '3.10.0'; }; diff --git a/lib/jasmine-core/version.rb b/lib/jasmine-core/version.rb index ccee40c5..8d69fe3f 100644 --- a/lib/jasmine-core/version.rb +++ b/lib/jasmine-core/version.rb @@ -4,6 +4,6 @@ # module Jasmine module Core - VERSION = "3.9.0" + VERSION = "3.10.0" end end diff --git a/package.json b/package.json index 84dd9372..9e7a620a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jasmine-core", "license": "MIT", - "version": "3.9.0", + "version": "3.10.0", "repository": { "type": "git", "url": "https://github.com/jasmine/jasmine.git" @@ -44,7 +44,7 @@ "grunt-contrib-concat": "^1.0.1", "grunt-css-url-embed": "^1.11.1", "grunt-sass": "^3.0.2", - "jasmine": "^3.4.0", + "jasmine": "^3.10.0", "jasmine-browser-runner": "github:jasmine/jasmine-browser#main", "jsdom": "^15.0.0", "load-grunt-tasks": "^4.0.0", diff --git a/release_notes/3.10.0.md b/release_notes/3.10.0.md new file mode 100644 index 00000000..4d674c2b --- /dev/null +++ b/release_notes/3.10.0.md @@ -0,0 +1,57 @@ +# Jasmine Core 3.10 Release Notes + +## New features and bug fixes + +* Added support for running Jasmine multiple times + * If the env is configured with `autoCleanClosures: false`, then it can be + executed repeatedly. + * Merges #1934 from @nicojs + * Fixes #1925 + +* Improved error message when an async expectation occurs after the spec + finishes + * Merges #1937 from @AndreWillomitzer + * Fixes #1854 + +* Reject timeout values that are too large for setTimeout + * See #1930 + +* Don't immediately move to the next queueable fn on async error + + This allows assertion failures and other errors that occur after the async + error to be routed to the correct spec/suite. + +* Added a stringContaining asymmetric equality tester + * Fixes #1923. + +* The jasmine-core Ruby gem now prints a deprecation message when loaded unless + the SUPPRESS_JASMINE_DEPRECATION environment variable is set. + + +## Documentation updates + +* Added discussion of max timeout value to jsdocs + * Merges #1931 from @trusktr + +* Added missing @since annotations + +* Improved jsdocs for asymmetric equality testers + +* Added a deprecation notice to the jasmine-core Ruby gem's description + +## Supported environments + +jasmine-core 3.10.0 has been tested in the following environments. + +| Environment | Supported versions | +|-------------------|--------------------| +| Node | 10, 12, 14, 16 | +| Safari | 8-14 | +| Chrome | 94 | +| Firefox | 93, 78, 68 | +| Edge | 94 | +| Internet Explorer | 10, 11 | + +------ + +_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_ diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index 823a609e..556dc029 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -3056,7 +3056,9 @@ describe('Env integration', function() { message: 'Spec "a suite does not wait" ran a "toBeResolved" expectation ' + 'after it finished.\n' + - 'Did you forget to return or await the result of expectAsync?', + '1. Did you forget to return or await the result of expectAsync?\n' + + '2. Was done() invoked before an async operation completed?\n' + + '3. Did an expectation follow a call to done()?', matcherName: 'toBeResolved' }), jasmine.objectContaining({ @@ -3067,7 +3069,9 @@ describe('Env integration', function() { 'after it finished.\n' + "Message: \"Expected a promise to be resolved to 'something else' " + 'but it was resolved to undefined."\n' + - 'Did you forget to return or await the result of expectAsync?', + '1. Did you forget to return or await the result of expectAsync?\n' + + '2. Was done() invoked before an async operation completed?\n' + + '3. Did an expectation follow a call to done()?', matcherName: 'toBeResolvedTo' }) ]); @@ -3120,7 +3124,9 @@ describe('Env integration', function() { message: 'Suite "a suite" ran a "toBeResolved" expectation ' + 'after it finished.\n' + - 'Did you forget to return or await the result of expectAsync?', + '1. Did you forget to return or await the result of expectAsync?\n' + + '2. Was done() invoked before an async operation completed?\n' + + '3. Did an expectation follow a call to done()?', matcherName: 'toBeResolved' }) ]); diff --git a/src/core/Env.js b/src/core/Env.js index 1f9e13b4..65233780 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -518,7 +518,9 @@ getJasmineRequireObj().Env = function(j$) { } delayedExpectationResult.message += - 'Did you forget to return or await the result of expectAsync?'; + '1. Did you forget to return or await the result of expectAsync?\n' + + '2. Was done() invoked before an async operation completed?\n' + + '3. Did an expectation follow a call to done()?'; topSuite.result.failedExpectations.push(delayedExpectationResult); }