does anyone else feel like feature testing as a front-end practice went out of style? (wrongly so — it’s still super valuable!)
7 replies
@zachleat Which is a real shame, because in my long term experience developing for the web, it's only gotten easier. Modern tooling (e.g. vue test utils, happydom) has grown to be pretty capable, and integration (e.g. cypress, playwright) is better than ever.
@zachleat by feature testing, do you mean "does this environment support feature x?", as in early days of HTML5 where SVG as image src, media tags, and a great many other features were not reliably available in a browser (and would require polyfill)?
@ahoyboyhoy yeah, writing JavaScript to test for features, a la Modernizr: https://modernizr.com/
@zachleat The jump to APIs not being prepared for this sort of testing seemed to go by the wayside with the `type="module"`/`no-module` toggle. There was a glimmer of a hope we'd be given some form of successor to this...but, no.
@westbrook https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/supports_static#speculationrules seems like at least someone is thinking about it!