/.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. Resharper 修改命名空间

    1. 使用Reshared 右键->Refactor->Rename 修改所有文件的命名空间(鼠标移动到对应类的命名空间) 2.修改类库中的命名空间 包括程序集信息 右键->属性 3 ...

  2. springMVC 开涛 数据绑定

    纸上得来终觉浅,绝知此事要躬行. 一.@requestParam //使用方法URL:?username="sfp" test(@RequestParam(value=" ...

  3. java Map集合学习

    学习语法还是从例子着手: FileDao fileDao=new FileBeanDaoImpl(); FileBean fileBean=new FileBean(); listBean=fileD ...

  4. JavaLogin小框架制作【精品博客】

    做一个小登录接口方法,让用户传入用户名,密码,就可以知道登录的结果信息,并以接口监听的方式控制. 先看客户端执行效果: 输入正确: 输入错误: 模拟客户端使用登录小框架: package com.de ...

  5. docker 多阶段构建

    构建镜像最具挑战性的一点是使镜像大小尽可能的小.Dockerfile中的每条指令都为图像添加了一个图层,您需要记住在移动到下一层之前清理任何不需要的工件.对于多阶段构建,您可以在Dockerfile中 ...

  6. datagridview 代码添加列

    int column_key = 0; private DataGridViewTextBoxColumn column_add(string name) { DataGridViewTextBoxC ...

  7. Unity的Shader如何控制投影颜色

    细节慢慢补充,有几个需要注意的地方,必须要有接收投影的pass也就是Name是ShadowCollector的,必须添加#pragma multi_compile_fwdbase,物体的着色器必须有T ...

  8. 关于jdbc编程的几点需要注意的地方

    代码 private void logDataDb(ArrayList<ReceiveData> datas) { Connection conn = null; PreparedStat ...

  9. ifnull是个好东西

    在进行数据与服务器的数据运算的时候(或者直接在sql中运算的时候),在新插入值的时候,可能会有null,这时如果进行运算,会报错,比如后台字段有totalminute,无论初始值怎么设置,在新建的时候 ...

  10. 前端入门CSS(3)

    day60 不透明度 opacity()\ opacity (不透明度)             1. 取值0~1             2. 和rgba()的区别:                ...