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

feat(core): Add normalized() helper to Assertion base class #106

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

JoseLion
Copy link
Member

This helper will allow classes extending from Assertion to create matcher methods which don't need the this.execure(..) method:

public someMatcher(): this {
  if (this.inverted) {
    // ...assert inverted somehow
  } else {
    // ...assert somehow
  }

  return this.normalized();
}

@JoseLion JoseLion requested a review from ChristianSama August 29, 2023 18:01
@JoseLion JoseLion self-assigned this Aug 29, 2023
@@ -60,6 +60,19 @@ export class Assertion<T> {
this.not = new Proxy(this, { get: this.proxyInverter(true) });
}

/**
* A convenience method to normalized the assertion instance. If it was
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A convenience method to normalized the assertion instance. If it was
* A convenience method to normalize the assertion instance. If it was

Typo

Copy link
Contributor

@ChristianSama ChristianSama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JoseLion JoseLion merged commit a30ae44 into main Aug 30, 2023
5 checks passed
@JoseLion JoseLion deleted the feat/normalized-helper branch August 30, 2023 14:50
Copy link

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants