This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before importing app and supertest | |
// you should write jest.mock function | |
// with the first argument is the path of your | |
// actual middleware and second argument write a | |
// fake middle function. | |
jest.mock('../middleware/verifyToken', () => { | |
return jest.fn((req, res, next) => { | |
next() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import react, {useRef, useState} from "react"; | |
const SimpleInput = (props) => { | |
const [enteredName, setEnteredName] = useState('') | |
const [enteredNameIsValid, setEnteredNameIsValid] = useState(true) | |
const nameInputChangeHandler = event => { | |
setEnteredName(event.target.value) | |
} |