Tommy

Results 70 comments of Tommy

The [`title-case`](https://www.npmjs.com/package/title-case) package has a `sentenceCase` option (vs. a naive sentence case): ```js titleCase("hello there, world! I'm Tommy.", { sentenceCase: true }) //=> "Hello there, world! I'm Tommy." naiveSentenceCase("hello there,...

Is there anything more to the built-in assertions than being a property of the `Assertions` class? Could custom assertions be registered there?

I’ve played around a bit before with adding type definitions to another library that supported custom assertions, using a mapped type with generics can preserve the added assertions and any...

> Maybe not top-level but under a namespace, e.g. `t.sinon.assert()` or something that follows their assertion API, but then better integrates with AVA. It might make sense for custom assertion...

That’s fair. I still think having a “custom” namespace be reserved for users is a good idea, though.

I think, at minimum, we'd need to expose: - `AssertionError` ([*assert.js*](https://github.com/avajs/ava/blob/0574e5e6d7959b7dc506cb2204f432f73ba39451/lib/assert.js#L36)), so AVA can recognize when a custom assertion fails - `Assertions.withSkip`, `Assertions.checkMessage`, the formatting functions, etc. ([*assert.js*](https://github.com/avajs/ava/blob/0574e5e6d7959b7dc506cb2204f432f73ba39451/lib/assert.js#L280-L293)), so custom...

@novemberborn I'd like to help get a `t.unorderedEqual` assertion added, do you remember what you were thinking of for the shallow equal?

Here's a dirty first draft of this (only supports comparing maps to maps, or sets to sets or arrays): ##### `unordered-equal.js` This is a helper file (like `like-selector.js`) that gets...

Now that assertions throw, would the `return` be necessary? I think that tests should still fail if they're cancelled after running assertions.

@novemberborn does AVA more easily support this now?