jest-puppeteer-react:使用木偶和玩笑对您的Chrome中的React成分进行屏幕截图测试

开玩笑的木偶React yarn add jest-puppeteer-react这个库结合了jest-puppeteer puppeteer和webpack-dev-server来呈现您的React组件,因此您不必设置服务器并导航到它。它还包括jest-image-snapshot ,它添加了预期的toMatchImageSnapshot匹配器。设置在玩笑配置中使用预设: { "preset": "jest-puppeteer-react" }或要求/包括所需的脚本。添加一个配置文件,其中包含一个函数以返回用于渲染的webpack配置: const webpack = require('webpack'); const path = require('path'); const buildDevWebpackConfig = require('./
zip 文件大小:243.95KB