async function toThrow(actualFunction, expected) {
	let actual = undefined

	try {
		actual = await actualFunction()
	} catch (error) {
		// do nothing and continue
		return
	}

	throw new AssertionError({
		message: 'Expected exception:',
		operator: 'throws',
		stackStartFn: toThrow,
		actual,
		expected,
	})
}
Tests that the actual function does throw when it is called.