Skip to content

Commit

Permalink
Deprecate t.error() - fixes #995 (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
platy11 authored and sindresorhus committed Aug 13, 2016
1 parent 8446f48 commit 28bb0d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ x.notRegex = function (contents, regex, msg) {
test(!regex.test(contents), create(regex, contents, '!==', msg, x.notRegex));
};

x.ifError = x.error = function (err, msg) {
x.ifError = function (err, msg) {
test(!err, create(err, 'Error', '!==', msg, x.ifError));
};

Expand All @@ -159,6 +159,7 @@ x.ok = util.deprecate(x.truthy, getDeprecationNotice('ok()', 'truthy()'));
x.notOk = util.deprecate(x.falsy, getDeprecationNotice('notOk()', 'falsy()'));
x.same = util.deprecate(x.deepEqual, getDeprecationNotice('same()', 'deepEqual()'));
x.notSame = util.deprecate(x.notDeepEqual, getDeprecationNotice('notSame()', 'notDeepEqual()'));
x.error = util.deprecate(x.ifError, getDeprecationNotice('error()', 'ifError()'));

function getDeprecationNotice(oldApi, newApi) {
return 'DEPRECATION NOTICE: ' + oldApi + ' has been renamed to ' + newApi + ' and will eventually be removed. See https://github.com/avajs/ava-codemods to help upgrade your codebase automatically.';
Expand Down

0 comments on commit 28bb0d5

Please sign in to comment.