reactJs Jest:`jsdom 4.x以前只能用于io.js,而不是Node.jsT:
的package.json:
{ "name": "flux-pricing", "version": "0.0.1", "description": "Pricing component with flux", "main": "js/app.js", "dependencies": { "flux": "^2.0.0", "jest-cli": "^0.5.0", "jsdom": ">= 0.1.23 < 4.0.0", "react": "^0.12.0", "underscore": "^1.7.0" }, "devDependencies": { "browserify": "~6.2.0", "envify": "~3.0.0", "react": "^0.12.0", "reactify": "^0.15", "watchify": "~2.1.0", "gulp": "~3.8.9", "gulp-browserify": "~0.5.0", "gulp-concat": "~2.4.1", "node-jsx": "~0.2.0", "express": "~4.0.0" }, "scripts": { "start": "watchify -o js/bundle.js -v -d .", "build": "browserify . | uglifyjs -cm > js/bundle.min.js", "test": "jest" }, "jest": { "rootDir": "./js" }, "browserify": { "transform": [ "reactify", "envify" ] }
}
npm安装后,当我尝试做npmtesting
s \ jsdom \ lib \ jsdom.js:3`jsdom 4.x onward只能用于io.js,而不是Node.jsT: https : //github.com/tmpvar ^意外的标记ILLEGAL如何解决这个问题?
我有同样的问题。 解决scheme是切换到使用Jest 0.4。
这是github的问题。 https://github.com/facebook/jest/issues/469#issuecomment-133105627
我实际上必须降级到Jest 0.3和10.x节点才能获得Jest React示例。 这里是参考https://github.com/facebook/jest/issues/427
- Jest:运营商和运营商之间的差异1
- 意外的令牌导入native-base-shoutem-theme / index.js:1可能是native-base / react-native
- babel-jest ES2015import报表
- EADDRINUSE 127.0.0.1:5858在jesttesting期间debugging
- 如何使用iron-node来debugging玩笑unit testing?
- 在ES2017与巴贝尔和JEST意外令牌导入
- Jest,Typescript,ts-jest:覆盖率稍微不正确
- 使用Jesttesting失败,错误:观察文件更改时出错:EMFILE
- Jesttesting简单的香草JavaScript – 不能读取null的属性'addEventListener'