Skip to content

Commit 7c9221d

Browse files
committed
backout deprecation of value returned from suite; closes #3744
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
1 parent b7cfceb commit 7c9221d

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

lib/interfaces/common.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
var Suite = require('../suite');
4-
var utils = require('../utils');
54
var errors = require('../errors');
65
var createMissingArgumentError = errors.createMissingArgumentError;
76

@@ -138,16 +137,7 @@ module.exports = function(suites, context, mocha) {
138137
}
139138
}
140139
if (typeof opts.fn === 'function') {
141-
var result = opts.fn.call(suite);
142-
if (typeof result !== 'undefined') {
143-
utils.deprecate(
144-
'Suites ignore return values. Suite "' +
145-
suite.fullTitle() +
146-
'" in ' +
147-
suite.file +
148-
' returned a value; this may be a bug in your test code'
149-
);
150-
}
140+
opts.fn.call(suite);
151141
suites.shift();
152142
} else if (typeof opts.fn === 'undefined' && !suite.pending) {
153143
throw createMissingArgumentError(

test/integration/suite.spec.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@ describe('skipped suite w/ callback', function() {
5151
});
5252

5353
describe('suite returning a value', function() {
54-
it('should give a deprecation warning for suite callback returning a value', function(done) {
54+
it('should not give a deprecation warning for suite callback returning a value', function(done) {
5555
run(
5656
'suite/suite-returning-value.fixture.js',
5757
args,
5858
function(err, res) {
5959
if (err) {
6060
return done(err);
6161
}
62-
var pattern = new RegExp('Suites ignore return values', 'g');
63-
var result = res.output.match(pattern) || [];
64-
expect(result, 'to have length', 1);
62+
expect(res, 'not to contain output', /Suites ignore return values/);
6563
done();
6664
},
6765
{stdio: 'pipe'}

0 commit comments

Comments
 (0)