concept React application in category javascript

appears as: React applications, React application
Testing JavaScript Applications

This is an excerpt from Manning's book Testing JavaScript Applications.

When testing front-end applications, assertions can become more challenging, because now you’re not only dealing with a function’s return value, but also with its interaction with the DOM. Therefore, you will learn how to find elements within your tests, and perform assertions on their contents.

Listing 6.1. index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Inventory Manager</title>
</head>
<body>
    <h1>Cheesecakes: <span id="count">0</span></h1>
    <button id="increment-button">Add cheesecake</button>
    <script src="main.js"></script>  #1
</body>
</html>