Archive: 2022

0

Promise basic

Promise: A new solution for asynchronous programming introduced in ES6. Promises are mainly to solve the previous problem of callback hell. Promise is a constructor that encapsulates an asynchronous

0

Rerender jest-axe

render() rerender is used to simulate props changing. How to get rerender(): 1const {rerender} = render(<FavoriteNumber />); rerender() uses and passes parameters rerender() is u

0

Jest test methods

Format expect(A).ValidateItem() is used in React testing library and Jest to verify functionality. Expect() Assertion Summary 1 [Expect() Assertion Summary 2](https://www.w3cschool.cn/jest_cn/ jest

0

Methods to get DOM

Aria-label try not to use role and aria-label in css. It’s all about accessibility. aria-label="cancelbtn", will read cancelbtn directly. So aria-label is for reading. If there is no aria-

0

Render, debug

Simple reusable rendering method In this method, we pass in the component as a parameter: 12345function render(ui) { const div = document.createElement('div') ReactDOM.render(<Fa

0

Installation, config

Install 1npm install --save-dev @testing-library/dom After installation, the setupTests.js file will be generated under src. ​ unit test file location The unit test file can be placed in the s

0

Stripe webhook

Using webhooks First search for stripe cli, find the relevant version, download and unzip it. Select the x86_64 version. Enter cmd in the folder where the unzipped file is located, then enter stripe

0

Stripe hosted page front-end

Stripe hosted checkout: Front-end The frontend receives the sessionID and uses this id to redirect the user to the stripe checkout page. The front-end needs to be packaged as follows: stripe packag