earl

☕ Ergonomic, modern and type-safe assertion library for TypeScript

MIT License

Downloads
30.7K
Stars
257
Committers
14

Bot releases are hidden (Show)

earl - [email protected]

Published by sz-piotr 6 months ago

Minor Changes

  • 46f000c: Add .clear to mocks which clears the calls array. Fixes .reset not clearing the calls.
  • e5ce81a: Add mockObject.reset which resets all functions on MockObject

Patch Changes

  • ce60bac: Improve performance by making some error messages lazy
earl -

Published by krzkaczor almost 4 years ago

Patch Changes

  • 591dccc: Add readme to the final npm package
earl -

Published by krzkaczor almost 4 years ago

Patch Changes

  • 4964a16: Fix bug in StringMatching matcher that prevented it from matching strings with special characters
  • 1e3951d: Added new matchers: arrayWith, objectWith Improve containerWith to work with multiple values
  • 4964a16: Added experimental plugin API. User guide | Dev guide

Internals

  • 4964a16: Migrated to monorepo.
earl -

Published by krzkaczor almost 4 years ago

Patch Changes

  • 0f490bd: Tweak toBeRejected validator signature to be properly async (return
    Promise<void>). This was a bug in typings not in behavior.
earl -

Published by krzkaczor almost 4 years ago

0.1.1

Patch Changes

  • ded8b37: Change compilation target to ES2015 to enable running on older
    node.js versions
  • 42ed317: Added containerWith matcher, allowing to match a iterable
    containing given value
earl - earl v0.1 - First stable release!

Published by krzkaczor almost 4 years ago

This is the first stable release of earl. From now on, we will publish changelogs.

Earl is an ergonomic, modern and type-safe assertion library for TypeScript

Features

  • 💪 Powerful validators and matchers
  • 🤖 Type-safe - written in TypeScript and goes well with static analysis
  • 🎭 Builtin support for mocks
  • ☕ Works great with Mocha

Changelog

There are many changes in this version, most important are:

  • Remove autofix - it was a controversial feature but most importantly it was complicating codebase in unexpected ways. I still feel like it could make a comeback but maybe in a way closer to jest's snapshot.

  • Redesign some APIs for convenience - in some situations we preferred the consistency above the convenience of the interfaces. For example toThrow worked with non-errors and needed to be combined with expect.error matcher for any meaningful results. We decided to simplify it and make toThrow work only with errors.

  • Redesign mocks - now mocks are generally simpler, we got rid of string / loose mocks and earl features only one design of mocks.

  • Moved earl development to a separate org - we hope this will help to build a community around the project faster

The whole documentation was updated, so to view the current API see: https://earljs.dev/docs/api/api-reference

Package Rankings
Top 2.38% on Npmjs.org
Related Projects