From 504ef278990d815b2553d865b44542bc209a8d41 Mon Sep 17 00:00:00 2001 From: Jan Molak <1089173+jan-molak@users.noreply.github.com> Date: Fri, 22 Oct 2021 17:58:31 +0100 Subject: [PATCH] Fixed result.pendingReason for specs marked with xit. Closes #1939 --- lib/jasmine-core/jasmine.js | 2 +- spec/core/EnvSpec.js | 12 ++++++++++++ src/core/Spec.js | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 86d7ba37..daad6630 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -991,7 +991,7 @@ x */ if (this.message) { this.excludeMessage = message; } - this.pend(); + this.pend(message); }; Spec.prototype.getResult = function() { diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index ffc39aa0..49e7f7e8 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -274,6 +274,18 @@ describe('Env', function() { expect(excludeSpy).toHaveBeenCalledWith('Temporarily disabled with xit'); }); + it('calls spec.pend with "Temporarily disabled with xit"', function() { + var pendSpy = jasmine.createSpy(); + var realExclude = jasmineUnderTest.Spec.prototype.exclude; + + spyOn(env, 'it').and.returnValue({ + exclude: realExclude, + pend: pendSpy + }); + env.xit('foo', function() {}); + expect(pendSpy).toHaveBeenCalledWith('Temporarily disabled with xit'); + }); + it('throws an error when it receives a non-fn argument', function() { expect(function() { env.xit('undefined arg', null); diff --git a/src/core/Spec.js b/src/core/Spec.js index 1548583a..2241085c 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -236,7 +236,7 @@ x */ if (this.message) { this.excludeMessage = message; } - this.pend(); + this.pend(message); }; Spec.prototype.getResult = function() {