/.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的更多相关文章

  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 ...

  2. [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  ...

  3. 使用create react app教程

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  4. 如何扩展 Create React App 的 Webpack 配置

    如何扩展 Create React App 的 Webpack 配置  原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...

  5. 深入 Create React App 核心概念

    本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...

  6. 在 .NET Core 5 中集成 Create React app

    翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...

  7. tap news:week5 0.0 create react app

    参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...

  8. 利用 Create React Native App 快速创建 React Native 应用

    本文介绍的 Create-React-Native-App 是非常 Awesome 的工具,而其背后的 Expo 整个平台也让笔者感觉非常的不错.笔者目前公司是采用 APICloud 进行移动应用开发 ...

  9. react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false

    react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false

随机推荐

  1. (博弈)Simple Game --codeforces--570B

    链接: http://codeforces.com/problemset/problem/570/B http://acm.hust.edu.cn/vjudge/contest/view.action ...

  2. (线段树 区间合并更新)Tunnel Warfare --hdu --1540

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=1540 http://acm.hust.edu.cn/vjudge/contest/view.action ...

  3. noip第9课作业

    1.    打印乘法表 [问题描述] 用for循环实现输出1至9的乘法表 [样例输出] 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4 ...

  4. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed(在64位模式下运行安装了32位的Oracle客户端组件时,会发生此问题)

    部署win服务时出现下面的问题: 在事件查看器中看到如下错误: 日志名称: Application来源: ***调度服务日期: 2014/5/21 12:53:21事件 ID: 0任务类别: 无级别: ...

  5. Java面向接口编程【精品博客】

    我们从生活中去理解面向接口编程,以下举例四个案例来理解: 案例一(汽车案例): /** * 汽车标准接口 * @author Liudeli */ public interface ICar { /* ...

  6. TCP协议通讯流程

    刚才网上找到的,觉得挺详细的,转来. tcp连接的三次握手大家肯定都熟了,可是有的人不一定对tcp断开的四次握手也很熟悉. 我在园子里面找到一张图,介绍的很好,现在转来!(该图片原博客地址:http: ...

  7. Javascript设计模式理论与实战:状态模式

    在软件开发中,很大部分时候就是操作数据,而不同数据下展示的结果我们将其抽象出来称为状态,我们平时开发时本质上就是对应用程序的各种状态进行切换并作出相应处理.状态模式就是一种适合多种状态场景下的设计模式 ...

  8. Ajax 访问 或 获取 IIS 虚拟目录

    使用场景 最近用 .net core mvc 写了一个工具类的项目,作为我们项目的后台管理网站使用.第一次被老大拿去部署的时候被告知不可用,同样的代码在我电脑和我的iis上都可以使用的啊. 后来才知道 ...

  9. winform中控件的简单数据绑定

    是因为在学习组件开发过程中有个Bindable的属性,不明白意义,然后才接触到winform的数据绑定,想着先把数据绑定这块看一下,然后去测试下是否Bindable属性设为false,就不能绑定该属性 ...

  10. Openlayers地图量算功能

    http://openlayers.org/en/latest/examples/measure.html?q=measure   按官网的例子来就行,新建对象时注意加上命名空间   var vect ...