Skip to content

Commit

Permalink
refactor(deps): remove is-error dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
drazisil committed Dec 15, 2021
1 parent 77623a5 commit af29824
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/assert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import concordance from 'concordance';
import isError from 'is-error';
import isPromise from 'is-promise';

import concordanceOptions from './concordance-options.js';
Expand Down Expand Up @@ -154,7 +153,7 @@ function validateExpectations(assertion, expectations, numberArgs) { // eslint-d
// Note: this function *must* throw exceptions, since it can be used
// as part of a pending assertion for promises.
function assertExpectations({assertion, actual, expectations, message, prefix, savedError}) {
if (!isError(actual)) {
if (!(actual instanceof Error)) {
throw new AssertionError({
assertion,
message,
Expand Down
3 changes: 1 addition & 2 deletions lib/serialize-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {fileURLToPath, pathToFileURL} from 'node:url';

import cleanYamlObject from 'clean-yaml-object';
import concordance from 'concordance';
import isError from 'is-error';
import StackUtils from 'stack-utils';

import {AssertionError} from './assert.js';
Expand Down Expand Up @@ -146,7 +145,7 @@ function trySerializeError(error, shouldBeautifyStack, testFile) {
}

export default function serializeError(origin, shouldBeautifyStack, error, testFile) {
if (!isError(error)) {
if (!(error instanceof Error)) {
return {
avaAssertionError: false,
nonErrorObject: true,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"globby": "^12.0.2",
"ignore-by-default": "^2.0.0",
"indent-string": "^5.0.0",
"is-error": "^2.2.2",
"is-plain-object": "^5.0.0",
"is-promise": "^4.0.0",
"matcher": "^5.0.0",
Expand Down

0 comments on commit af29824

Please sign in to comment.