在我的 package.json 文件中设置 ava 测试。但是,当我尝试从命令行运行测试时得到这个
following error:
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
编辑:使用 ava 版本 1.0.0-beta.8"
包.json
"ava": {
"cache": false,
"files": [
"../test/**/*"
],
"sources": [
"../renderer/components/**/*.{js, jsx}"
],
"concurrency": 5,
"failFast": true,
"require": [
[
"babel-register",
"babel-polyfill"
],
"ignore-styles",
"./test/helpers/setup-browser-env.js"
],
"babel": {
"extensions": [
"js",
"jsx"
]
}
}
更新:使用 .babelrc 文件
{
"presets": [
"es2015",
"stage-2",
"@babel/preset-react"
],
"plugins": [
"espower",
"transform-runtime"
]
}
目前正试图让 ava 从我的 .babelrc 文件中读取