Skip to content

Commit 28bb0d5

Browse files
platy11sindresorhus
authored andcommitted
Deprecate t.error() - fixes #995 (#999)
1 parent 8446f48 commit 28bb0d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/assert.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ x.notRegex = function (contents, regex, msg) {
147147
test(!regex.test(contents), create(regex, contents, '!==', msg, x.notRegex));
148148
};
149149

150-
x.ifError = x.error = function (err, msg) {
150+
x.ifError = function (err, msg) {
151151
test(!err, create(err, 'Error', '!==', msg, x.ifError));
152152
};
153153

@@ -159,6 +159,7 @@ x.ok = util.deprecate(x.truthy, getDeprecationNotice('ok()', 'truthy()'));
159159
x.notOk = util.deprecate(x.falsy, getDeprecationNotice('notOk()', 'falsy()'));
160160
x.same = util.deprecate(x.deepEqual, getDeprecationNotice('same()', 'deepEqual()'));
161161
x.notSame = util.deprecate(x.notDeepEqual, getDeprecationNotice('notSame()', 'notDeepEqual()'));
162+
x.error = util.deprecate(x.ifError, getDeprecationNotice('error()', 'ifError()'));
162163

163164
function getDeprecationNotice(oldApi, newApi) {
164165
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.';

0 commit comments

Comments
 (0)