mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
* Ignore * Create biome.json * Ignore * biome * [autofix.ci] apply automated fixes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
16 lines
500 B
JavaScript
16 lines
500 B
JavaScript
var assert = require("assert");
|
|
|
|
test("match does not throw when matching", () => {
|
|
assert.match("I will pass", /pass/);
|
|
});
|
|
|
|
test("match throws when argument is not string", () => {
|
|
expect(() => assert.match(123, /pass/)).toThrow('The "actual" argument must be of type string. Received type number');
|
|
});
|
|
|
|
test("match throws when not matching", () => {
|
|
expect(() => assert.match("I will fail", /pass/, "match throws when not matching")).toThrow(
|
|
"match throws when not matching",
|
|
);
|
|
});
|