Question

For example, I used Modernizr which fallback to jqueryUI 's datepicker if HTML5's date input type is not supported (sadly true in general )

It is implemented like this post

Besides full-blown browser-automation test / manual starting up my safari, are there simple mechanism that we can mock up Modernizr to test against these fallbacks?

as this scenario the fallback solution jqueryui does actually function in most and my development browser (Chrome)

Was it helpful?

Solution

Wy not just comment out the if statement?

If you have more than 1 of those, I guess you could simply overwrite the value of Modernizr.inputtypes.date to false at the beginning of your JS:

Modernizr.inputtypes.date = false;
if(!Modernizr.inputtypes.date){
    //fallback here
}

OTHER TIPS

You should not be trying to disable the test in chrome, you should test in the browsers it fails in. A polyfill may work wonderfully in chrome, but fail in IE. At that point, you have just confirmed that a polyfill works in a browser that will never need it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top