import "@js-temporal/polyfill";
import "urlpattern-polyfill";
globalThis.addEventListener = () => {};
import { l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
import { t as assertIsError } from "./assert_is_error-C50x8tnw.mjs";
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
	let ErrorClass = void 0;
	let msgIncludes = void 0;
	let err;
	if (typeof errorClassOrMsg !== "string") if (errorClassOrMsg === void 0 || errorClassOrMsg?.prototype instanceof Error || errorClassOrMsg?.prototype === Error.prototype) {
		ErrorClass = errorClassOrMsg;
		msgIncludes = msgIncludesOrMsg;
	} else msg = msgIncludesOrMsg;
	else msg = errorClassOrMsg;
	let doesThrow = false;
	const msgSuffix = msg ? `: ${msg}` : ".";
	try {
		fn();
	} catch (error) {
		if (ErrorClass) {
			if (error instanceof Error === false) throw new AssertionError(`A non-Error object was thrown${msgSuffix}`);
			assertIsError(error, ErrorClass, msgIncludes, msg);
		}
		err = error;
		doesThrow = true;
	}
	if (!doesThrow) {
		msg = `Expected function to throw${msgSuffix}`;
		throw new AssertionError(msg);
	}
	return err;
}
//#endregion
export { assertThrows as t };
