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
随机推荐
- Window 下好用的同步备份工具(来自微软)SyncToy
SyncToy 简单好用,满足备份的基本需求.
- POJ3026 Borg Maze 2017-04-21 16:02 50人阅读 评论(0) 收藏
Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14165 Accepted: 4619 Descri ...
- smarty-2014-02-28
使用smarty,在tpl文件中如何使用相对路径调用css&javascript文件,实际上这个相对路径的参照物就是以调用该tpl文件的php文件来写. 假如,我在index.php这个文件中 ...
- Android-卖票案例static-不推荐此方式
需求描述:四个窗口一起卖票,把10张票卖完,不许多卖 先看一个错误的案例: package android.java.thread06; /** * 售票线程 */ class Booking ext ...
- 二、安装并配置Kubernetes Master节点
1. 安装配置Master节点上的Kubernetes服务 1.1 安装Master节点上的Kubernetes服务 yum -y install kubernetes 1.2 修改kube-apis ...
- 设计模式之工厂模式(Factory Pattern)
一.什么是工厂模式? 1.“简单工厂模式”,Simple Factory Pattern 也就是常用的在Factory类中定义静态方法负责new对象的方式. 摘要中提到过“严格地说,这种被称为“简单工 ...
- ubuntu Mono+Jexus 部署到 ASP.NET MVC 5
之前搞了很多次都是卡在了razor那个异常哪里,今天心血来潮就在试一试,一试竟然成功了,激动的我赶紧记录下历程.废话不说,走起... ubuntu 16.04 安装mono(最新版 5.14.0) 官 ...
- C#中的split的基本用法
split的使用: 1.使用char()字符分隔:根据单个的char()类型的进行分隔 代码如下: string str="e2kdk2fjod2fiksf21"; ');//因为 ...
- 深入浅出“跨视图粒度计算”--3、EXCLUDE表达式
本文由 网易云发布. 深入嵌入“跨视图粒度计算”的前面两篇分别讲了 1.理解数据的粒度 2.INCLUDE表达式 这一篇讲一下EXCLUDE表达式的用法. EXCLUDE,中文译为“排除”,顾名思义 ...
- 前端分享----JS异步编程+ES6箭头函数
前端分享----JS异步编程+ES6箭头函数 ##概述Javascript语言的执行环境是"单线程"(single thread).所谓"单线程",就是指一次只 ...