react config test env with jest and create-react-app 1
/.babelrc
{
"presets": ["@babel/preset-env","@babel/preset-react"],
"plugins":[
"@babel/plugin-proposal-class-properties"
]
}
/jest.config.js
module.exports = { "setupFiles": ["./tests/setup.js"], testEnvironment: "node", };
/package.json
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"babel-jest": "^23.6.0",
"enzyme": "/home/rudy/.config/yarn/global/node_modules/enzyme",
"enzyme-adapter-react-16": "/home/rudy/.config/yarn/global/node_modules/enzyme-adapter-react-16",
"jest": "^23.6.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest",
"eject": "react-scripts eject"
},
/tests/setup.js
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
react config test env with jest and create-react-app 1的更多相关文章
- [React] Use the Fragment Short Syntax in Create React App 2.0
create-react-app version 2.0 added a lot of new features. One of the new features is upgrading to Ba ...
- [React] {svg, css module, sass} support in Create React App 2.0
create-react-app version 2.0 added a lot of new features. One of the new features is added the svgr ...
- 使用create react app教程
This project was bootstrapped with Create React App. Below you will find some information on how to ...
- 如何扩展 Create React App 的 Webpack 配置
如何扩展 Create React App 的 Webpack 配置 原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...
- 深入 Create React App 核心概念
本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...
- 在 .NET Core 5 中集成 Create React app
翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...
- tap news:week5 0.0 create react app
参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...
- 利用 Create React Native App 快速创建 React Native 应用
本文介绍的 Create-React-Native-App 是非常 Awesome 的工具,而其背后的 Expo 整个平台也让笔者感觉非常的不错.笔者目前公司是采用 APICloud 进行移动应用开发 ...
- react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false
react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false
随机推荐
- Linux常见配置文件
一./etc 配置文件 /etc/passwd 用户数据库,其中的域给出了用户名.真实姓名.家目录.加密口令和用户的其他信息 /etc/group 类似/etc/passwd ,但说明的不是用户而是组 ...
- Codeforces807 B. T-Shirt Hunt 2017-05-08 23:23 175人阅读 评论(0) 收藏
B. T-Shirt Hunt time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- AtCoder - 4351 Median of Medians(二分+线段树求顺序对)
D - Median of Medians Time limit : 2sec / Memory limit : 1024MB Score : 700 pointsProblem Statement ...
- springmvc 孔浩
modelAttribute属性指定该form绑定的是哪个Model,当指定了对应的Model后就可以在form标签内部其 它表单标签上通过为path指定Model属性的名称来绑定Model中的数据了 ...
- Moving XML/BI Publisher Components Between Instances
As it is well known fact that XMLPublisher stores the metadata and physical files for templates and ...
- C++回调:利用函数指针
#include <iostream> using namespace std; /**************************************************** ...
- Python廖雪峰学习笔记——单元测试
定义:对一个模块.一个类.一个函数进行进行正确性检验的测试性工作.当我们对函数或者模块等进行修改时,单元测试就显得尤为重要. 单元测试 = 测试用例(用来测试的数据)+测试模块
- 【文文殿下】【CF724C】Ray Tracing (中国剩余定理)
题解 我们考虑将棋盘扩大一倍,这样相当于取膜.然后,我们只要对x,y,的位置分类讨论,做四次crt就行.具体细节看文文代码. #include<cstdio> #include<al ...
- javascript中的数据类型和变量
Number JavaScript不区分整数和浮点数,统一用Number表示,以下都是合法的Number类型: 123; // 整数123 0.456; // 浮点数0.456 1.2345e3; / ...
- C++类模板 template <class T>
C++在发展的后期增加了模板(template )的功能,提供了解决这类问题的途径.可以声明一个通用的类模板,它可以有一个或多个虚拟的类型参数. 比如: class Compare_int class ...