function teardown(scratch) {
	if (!document.contains(scratch)) return;

	if (scratch) {
		scratch.parentNode.removeChild(scratch);
	}

	if (oldOptions != null) {
		assign(options, oldOptions);
		oldOptions = null;
	}

	testUtilTeardown();

	if (getLog().length > 0) {
		clearLog();
	}

	restoreElementAttributes();
}
Teardown test environment and reset preact's internal state
@param {HTMLElement} scratch