Jest在尝试进行快照测试时遇到意外令牌

时间:2019-04-23 15:46:13

标签: reactjs jestjs babel-jest

我正在尝试运行快照测试,但遇到此错误: photo of error

我相信这是因为我没有安装某些软件包,但是我不确定哪个软件包

.babelrc

std::time_t t = std::time(0);
std::tm* now = std::localtime(&t);
std::cout << (now->tm_year + 1900) << (now->tm_mon + 1) <<  (now->tm_mday);

package.json

{
"presets": ["react", "es2015"]
 }

FileUploader.js

{
"name": "ovals",
"version": "0.1.0",
"private": true,
"dependencies": {
"@types/reactstrap": "^6.4.4",
"babel": "^6.23.0",
"babel-jest": "^23.6.0",
"bootstrap": "^4.2.1",
"browser-cookies": "^1.2.0",
"chromedriver": "^2.46.0",
"firebase": "^5.8.2",
"firebase-tools": "^6.7.0",
"jest": "^23.6.0",
"jimp": "^0.5.6",
"jquery": "^3.3.1",
"react": "^16.8.1",
"react-async-script-loader": "^0.3.0",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.8.1",
"react-draggable": "^3.1.1",
"react-dropzone": "^8.0.4",
"react-icons": "^3.3.0",
"react-image-crop": "^6.0.12",
"react-paypal-button": "^2.0.3",
"react-popper": "^1.3.3",
"react-rnd": "^9.1.1",
"react-router-dom": "^4.3.1",
"react-scripts": "^2.1.8",
"react-spinners": "^0.5.1",
"react-stripe-checkout": "^2.6.3",
"react-test-renderer": "^16.8.6",
"reactstrap": "^6.5.0",
"save": "^2.3.3",
"selenium-webdriver": "^4.0.0-alpha.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest",
"eject": "react-scripts eject",
"deploy": "firebase deploy"
 },
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
 ],
"devDependencies": {
"@babel/preset-react": "^7.0.0",
"babel-preset-react": "^6.24.1",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1"
 }
}

如果有人知道为什么我在Fileupload中遇到此错误以及如何解决它,将不胜感激

0 个答案:

没有答案