docs(assert): add module example (#4439)

This commit is contained in:
Asher Gomez 2024-03-05 14:57:27 +11:00 committed by GitHub
parent ef0d782254
commit 021323eba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,13 @@
* This module is browser compatible, but do not rely on good formatting of
* values for AssertionError messages in browsers.
*
* ```ts
* import { assert } from "https://deno.land/std@$STD_VERSION/assert/assert.ts";
*
* assert("I am truthy"); // Doesn't throw
* assert(false); // Throws `AssertionError`
* ```
*
* @module
*/