The getViewportSize function does a comprehensive job of feature-testing how to get the pixel dimensions of the window/document. However, the testVHSupport and testVWSupport functions use window.innerHeight/innerWidth directly, and testVMinSupport uses document.documentElement.clientHeight/clientWidth directly.
The tests should probably go through getViewportSize to obtain the necessary pixel dimension.