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

[core] Remove toEqualDateTime chai matcher #37073

Merged
merged 1 commit into from
May 11, 2023
Merged
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
13 changes: 0 additions & 13 deletions test/utils/initMatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ declare global {
* @see [Excluding Elements from the Accessibility Tree](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion)
*/
toBeInaccessible(): void;
/**
* Matcher with useful error messages if the dates don't match.
*/
toEqualDateTime(expected: Date): void;
toHaveAccessibleDescription(description: string): void;
/**
* Checks if the accessible name computation (according to `accname` spec)
Expand Down Expand Up @@ -475,15 +471,6 @@ chai.use((chaiAPI, utils) => {
},
);

chai.Assertion.addMethod('toEqualDateTime', function toEqualDateTime(expectedDate, message) {
// eslint-disable-next-line no-underscore-dangle
const actualDate = this._obj;
const assertion = new chai.Assertion(actualDate.toISOString(), message);
// TODO: Investigate if `as any` can be removed after https://github.com/DefinitelyTyped/DefinitelyTyped/issues/48634 is resolved.
utils.transferFlags(this as any, assertion, false);
assertion.to.equal(expectedDate.toISOString());
});

chai.Assertion.addMethod('toThrowMinified', function toThrowMinified(expectedDevMessage) {
// TODO: Investigate if `as any` can be removed after https://github.com/DefinitelyTyped/DefinitelyTyped/issues/48634 is resolved.
if (process.env.NODE_ENV !== 'production') {
Expand Down