vue jest运行报错及解决方案
原文链接:https://www.cnblogs.com/qpnets/p/10368998.html问题1: Option “mapCoverage” has been removed, as it’s no longer necessary.解决:此属性已移除,详细可以见 https://jestjs.io/docs/en/configuration 官方公布的属性,在test/unit/..
·
原文链接:https://www.cnblogs.com/qpnets/p/10368998.html
问题1: Option “mapCoverage” has been removed, as it’s no longer necessary.
原因:此属性已移除,详细可以见 https://jestjs.io/docs/en/configuration 官方公布的属性,
解决方法:在test/unit/jest.conf.js找到并删除该属性
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
setupFiles: ['<rootDir>/test/unit/setup'],
// mapCoverage: true,
coverageDirectory: '<rootDir>/test/unit/coverage',
问题2:localStorage is not available for opaque origins
解决:在jest.config.js里,增加这两个属性定义
module.exports = {
verbose: true,
testURL: "http://localhost/",
...
}
可参考https://stackoverflow.com/questions/51554366/jest-securityerror-localstorage-is-not-available-for-opaque-origins#
更多推荐
已为社区贡献1条内容
所有评论(0)