Book Image

Hands-On Full Stack Development with Spring Boot 2.0 and React

By : Juha Hinkula
Book Image

Hands-On Full Stack Development with Spring Boot 2.0 and React

By: Juha Hinkula

Overview of this book

Apart from knowing how to write frontend and backend code, a full-stack engineer has to tackle all the problems that are encountered in the application development life cycle, starting from a simple idea to UI design, the technical design, and all the way to implementing, testing, production, deployment, and monitoring. This book covers the full set of technologies that you need to know to become a full-stack web developer with Spring Boot for the backend and React for the frontend. This comprehensive guide demonstrates how to build a modern full-stack application in practice. This book will teach you how to build RESTful API endpoints and work with the data access Layer of Spring, using Hibernate as the ORM. As we move ahead, you will be introduced to the other components of Spring, such as Spring Security, which will teach you how to secure the backend. Then, we will move on to the frontend, where you will be introduced to React, a modern JavaScript library for building fast and reliable user interfaces, and its app development environment and components. You will also create a Docker container for your application. Finally, the book will lay out the best practices that underpin professional full-stack web development.
Table of Contents (24 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
Index

Chapter 12


Answer 1: Jest is a test library for JavaScript and it is developed by Facebook.

Answer 2: Create a test file using the .test.js extension. Implement your test cases inside the file and you can run the tests using the following command npm test.

Answer 3: For the snapshot testing you have to install react-test-render package and you have to import renderer to you test file. Implement your snapshot test cases inside the file and you can run the tests using the following command npm test.

Answer 4: Enzyme is a JavaScript library for testing the React component's output.

Answer 5: Using the following npm command npm install enzyme enzyme-adapter-react-16 --save-dev.

Answer 6: You have to import Enzyme and Adapter components to your test file. Then you can create you test cases to render a component. With the Enzyme, you can use Jest for assertions.

Answer 7: Enzyme provides the simulate method that can be used to test events.