Pregunta

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)

¿Fue útil?

Solución

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
}

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top