From 389597fdc145681c2b8befb75ac7ca1d7ebc84c4 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 20 Feb 2019 20:14:22 -0800 Subject: [PATCH] backout deprecation of value returned from suite; closes #3744 Signed-off-by: Christopher Hiller --- lib/interfaces/common.js | 12 +----------- test/integration/suite.spec.js | 6 ++---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/interfaces/common.js b/lib/interfaces/common.js index 976b4d7a65..1802fcc9dc 100644 --- a/lib/interfaces/common.js +++ b/lib/interfaces/common.js @@ -1,7 +1,6 @@ 'use strict'; var Suite = require('../suite'); -var utils = require('../utils'); var errors = require('../errors'); var createMissingArgumentError = errors.createMissingArgumentError; @@ -138,16 +137,7 @@ module.exports = function(suites, context, mocha) { } } if (typeof opts.fn === 'function') { - var result = opts.fn.call(suite); - if (typeof result !== 'undefined') { - utils.deprecate( - 'Suites ignore return values. Suite "' + - suite.fullTitle() + - '" in ' + - suite.file + - ' returned a value; this may be a bug in your test code' - ); - } + opts.fn.call(suite); suites.shift(); } else if (typeof opts.fn === 'undefined' && !suite.pending) { throw createMissingArgumentError( diff --git a/test/integration/suite.spec.js b/test/integration/suite.spec.js index ae93491e44..d3aac74034 100644 --- a/test/integration/suite.spec.js +++ b/test/integration/suite.spec.js @@ -51,7 +51,7 @@ describe('skipped suite w/ callback', function() { }); describe('suite returning a value', function() { - it('should give a deprecation warning for suite callback returning a value', function(done) { + it('should not give a deprecation warning for suite callback returning a value', function(done) { run( 'suite/suite-returning-value.fixture.js', args, @@ -59,9 +59,7 @@ describe('suite returning a value', function() { if (err) { return done(err); } - var pattern = new RegExp('Suites ignore return values', 'g'); - var result = res.output.match(pattern) || []; - expect(result, 'to have length', 1); + expect(res, 'not to contain output', /Suites ignore return values/); done(); }, {stdio: 'pipe'}