r/javascript • • Mar 26 '18

Modern Frontend Developer in 2018

https://medium.com/tajawal-engineering/modern-frontend-developer-in-2018-4c2072fa2b9c
558 Upvotes

91 comments sorted by

View all comments

3

u/[deleted] Mar 26 '18

I would add Selenium to the list. It is useful for unit- and integrationtests of the UI aswell.

E.g.: Imagine an input form that should convert all text inputs to upper-case. It has an attached event handler: cvtToLower(input:string).

  • Test the event handler the traditional way.

  • Use Selenium to make sure the converted test actually ends up in the correct input.

Thats basically an integration test of the markup and UI code (i.e. are the ids set correctly?). Integrating Selenium in a unittest runner(like mocha), still allows mocking and makes the test run fast (compared to the typical end-to-end use case of selenium). Granted, this is a very basic example and not worth the effort, but having perfectly tested code and still ending up fixing a malfunctioning UI is something people are spending way too much time on.