【发布时间】:2021-03-25 11:31:26
【问题描述】:
String.prototype.replaceAll() 是一种有用的方法,在构建和执行时一切正常。但是,所有 Jest 测试都失败并出现以下错误:
TypeError: replaceAll is not a function
这些是我的依赖项:
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
"vue-i18n": "^8.22.0",
"vue-property-decorator": "^8.4.2",
"vue-router": "^3.3.4",
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/test-utils": "^1.1.0",
"jest-junit": "^12.0.0",
"ts-jest": "^26.4.1",
"typescript": "~3.9.3",
"vue-jest": "^3.0.7",
"vue-template-compiler": "^2.6.10"
},
如何解决此问题?
【问题讨论】:
标签: javascript node.js jestjs