Skip to content
Chris Dibbern edited this page May 16, 2018 · 9 revisions

The fluent grammar can sound weird sometimes, yes?

Yes. But are we coding, or writing prose? 😛 We're doing our best within the confines of English and Typescript. So, please... file your formal complaints with Microsoft and Britain, and definitely Microsoft's British headquarters.

Example:

Assert(something).not.is(Mine);
Assert(val)
  .has(v => v.prop)
  .that.not.equals(3);

Moral of the story: if the API allows you to type it, it should work, even if the grammar sounds a bit off. If it doesn't work, then we might have a real issue. In that case, please let us know by submitting it.

Where is feature X? Would you please add fluent operator Y?

The API is still in an early stage of development, so we might come to it on our own, soon.

In the near future, we hope to add several more fluent methods, and maybe to support Alsatian xUnit's Spy functionality (this way, you won't have to import both Alsatian's Expect and this API's Assert when spying).

Won't add

This list is here mainly to remind the author why he chose against these features.

  1. .contains("substring")
    • this is handled by the more powerful .matches(/substring/).
    • I am funny, sometimes. Totally needed a contains. It has been added.
  2. Type-filtering the API (e.g., not showing array-specific methods for non-arrays).
    • too restrictive when working with built-in types, but makes sense (and may implement) for Alsatian-specific types.
    • increases API complexity for little gain.