☕ Ergonomic, modern and type-safe assertion library for TypeScript
MIT License
npm install --save-dev earl
import { expect } from 'earl'
const user = {
name: 'John Doe',
email: '[email protected]',
notificationCount: 5,
}
// This code fails to compile, and TypeScript provides this useful
// error message:
// Property 'notificationCount' is missing in type
// '{ name: string; email: any; }' but required in type 'User'.
expect(user).toEqual({
name: 'John Doe',
email: expect.a(String),
})
Published under the MIT License. Copyright © 2023 L2BEAT.