Start by choosing the testing structure and syntax (2) you like, assertion functions (3) library, and decide how do you want to run the tests (1). Some frameworks like Jest, Jasmine, TestCafe, and Cypress provide all of these out of the box. Some of them provide only some of the functionality and a combination of libraries should be used: (mocha + chai + sinon). We also suggest creating two different processes. One for running unit and integration tests and another one for Functional Tests. This is because functional tests usually take longer, especially when running the test suite on several different browsers.
Think about when it's appropriate to run each type of test. For example:
Unit + integration on every change, functional tests only before commits.