docs(assert): add additional example in assertObjectMatch docs (#5703)

This commit is contained in:
Kevin Zou 2024-08-18 20:38:36 -07:00 committed by GitHub
parent 1bc290b1ac
commit cb3dd2baa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,8 @@ import { assertEquals } from "./equals.ts";
*
* assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
* assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws
* assertObjectMatch({ foo: 1, bar: 2 }, { foo: 1 }); // Doesn't throw
* assertObjectMatch({ foo: 1 }, { foo: 1, bar: 2 }); // Throws
* ```
*
* @example Usage with nested objects