Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions lib/interfaces/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var Suite = require('../suite');
var utils = require('../utils');
var errors = require('../errors');
var createMissingArgumentError = errors.createMissingArgumentError;

Expand Down Expand Up @@ -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(
Expand Down
6 changes: 2 additions & 4 deletions test/integration/suite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ 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,
function(err, res) {
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'}
Expand Down