mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
* implemented assert.doesNotMatch * fixed assert.match and assert.doesNotMatch tests and ensure it throws when actual is not a string --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
14 lines
493 B
JavaScript
14 lines
493 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");
|
|
});
|