Skip to main content

Posts

Showing posts with the label React JS

Create self signed SSL certificate

How to Create a Self-Signed SSL Certificate for React JS Using mkcert How to Create a Self-Signed SSL Certificate for React JS Using mkcert A self-signed certificate is a digital certificate that is created and signed by the same entity it identifies. Unlike certificates issued by trusted Certificate Authorities (CAs), self-signed certificates aren't verified by external parties. They're commonly used for local development, testing, or internal systems where the identity verification provided by a CA is not necessary. Although self-signed certificates can secure communication, they lack the third-party validation provided by CA-signed certificates, and users may encounter browser warnings when accessing websites using self-signed certificates. In this guide, we’ll walk you through the steps to create a self-signed SSL certificate for your React JS application using mkcert . Step 1: Install Chocolatey Cho...

Create Test Case using Jest library in React JS

Creating Unit Test Cases in React JS with Jest and React Testing Library Creating Unit Test Cases in React JS with Jest and React Testing Library In this article, you will get an understanding of how we can create a basic unit test case in React JS. Creating automated test cases for a React application involves using testing libraries and frameworks like Jest and React Testing Library. For testing a LoginForm component, you would want to cover different scenarios like valid and invalid inputs, form submission, error handling, and more. Below, I'll provide an example of how to create test cases using Jest and React Testing Library. LoginForm Component Let's assume your LoginForm component looks something like this: import React, { useState } from 'react'; const LoginForm = ({ onLogin }) => { const [email, setEmail] = useState(''); const [password, setPassword] = u...