问题描述
我遇到了 TypeError 问题:超级表达式必须为 null 或函数,而不是未定义
同时更新 babel 和 Bebel-jest 包。但确实解决了。
vue 版本 - 2.6.11
import BaseAPI from '../BaseAPI'
class LanguageAPI extends BaseAPI { // <-- issue
_resource ='reference'
_parentResources =['localization']
}
jest-conf.js
module.exports = {
rootDir: path.resolve(__dirname,'../../'),moduleFileExtensions: [
'js','json','vue'
],moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest','.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
},snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],setupFiles: ['<rootDir>/test/unit/setup'],testURL: 'http://localhost',testEnvironment: 'node'
}
package.json
"devDependencies": {
"@babel/preset-env": "^7.13.5","@vue/cli-plugin-pwa": "^4.3.1","babel-core": "^6.22.1","babel-eslint": "^8.2.1","babel-helper-vue-jsx-merge-props": "^2.0.3","babel-jest": "^21.2.0","babel-loader": "^7.1.1","babel-plugin-dynamic-import-node": "^1.2.0","babel-plugin-syntax-jsx": "^6.18.0","babel-plugin-transform-class-properties": "^6.24.1","babel-plugin-transform-es2015-modules-commonjs": "^6.26.0","babel-plugin-transform-runtime": "^6.22.0","babel-plugin-transform-vue-jsx": "^3.5.0","babel-preset-env": "^1.3.2","babel-preset-es2015": "^6.24.1","babel-preset-stage-2": "^6.22.0","jest": "^22.0.4","jest-serializer-vue": "^0.3.0",}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)