Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove is-error dependency #2911

Closed
wants to merge 3 commits into from
Closed
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
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