Improved specs for async matcher error messages

This commit is contained in:
Steve Gravrock
2024-12-31 10:10:40 -08:00
parent 03d665e243
commit 7683325d68
6 changed files with 6 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ describe('toBePending', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBePending to be called on a promise but was on a ${typeof actual}.` 'Expected toBePending to be called on a promise but was on a string.'
); );
}); });
}); });

View File

@@ -29,7 +29,7 @@ describe('toBeRejected', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBeRejected to be called on a promise but was on a ${typeof actual}.` 'Expected toBeRejected to be called on a promise but was on a string.'
); );
}); });
}); });

View File

@@ -232,7 +232,7 @@ describe('#toBeRejectedWithError', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBeRejectedWithError to be called on a promise but was on a ${typeof actual}.` 'Expected toBeRejectedWithError to be called on a promise but was on a string.'
); );
}); });
}); });

View File

@@ -83,7 +83,7 @@ describe('#toBeRejectedWith', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBeRejectedWith to be called on a promise but was on a ${typeof actual}.` 'Expected toBeRejectedWith to be called on a promise but was on a string.'
); );
}); });
}); });

View File

@@ -36,7 +36,7 @@ describe('toBeResolved', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBeResolved to be called on a promise but was on a ${typeof actual}.` 'Expected toBeResolved to be called on a promise but was on a string.'
); );
}); });
}); });

View File

@@ -93,7 +93,7 @@ describe('#toBeResolvedTo', function() {
} }
expect(f).toThrowError( expect(f).toThrowError(
`Expected toBeResolvedTo to be called on a promise but was on a ${typeof actual}.` 'Expected toBeResolvedTo to be called on a promise but was on a string.'
); );
}); });
}); });