Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jestjs babel jest不polyfill Array.flat_Jestjs_Vue Cli 3 - Fatal编程技术网

Jestjs babel jest不polyfill Array.flat

Jestjs babel jest不polyfill Array.flat,jestjs,vue-cli-3,Jestjs,Vue Cli 3,我在Vue应用程序中使用了Array.flat,测试失败,出现TypeError:variable.flat不是函数 我已经发现了一些github问题,但没有一个可以帮助: 你知道为什么babel没有多边形填充Array.flat函数吗 我的配置全部位于根目录中 .browserslistrc defaults babel.config.js module.exports = { presets: [ '@vue/app', ], }; moduleFileExten

我在Vue应用程序中使用了Array.flat,测试失败,出现TypeError:variable.flat不是函数

我已经发现了一些github问题,但没有一个可以帮助:

你知道为什么babel没有多边形填充Array.flat函数吗

我的配置全部位于根目录中

.browserslistrc

defaults
babel.config.js

module.exports = {
  presets: [
    '@vue/app',
  ],
};
  moduleFileExtensions: [
    'js',
    'jsx',
    'json',
    'vue',
  ],
  transform: {
    '^.+\\.vue$': 'vue-jest',
    '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
    '^.+\\.jsx?$': 'babel-jest',
  },
  transformIgnorePatterns: [
    '/node_modules/',
  ],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1',
  },
...
};

};

jest.config.js

module.exports = {
  presets: [
    '@vue/app',
  ],
};
  moduleFileExtensions: [
    'js',
    'jsx',
    'json',
    'vue',
  ],
  transform: {
    '^.+\\.vue$': 'vue-jest',
    '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
    '^.+\\.jsx?$': 'babel-jest',
  },
  transformIgnorePatterns: [
    '/node_modules/',
  ],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1',
  },
...
};

};

愚蠢的我

从v10.15.3到v12.10.0的简单节点更新完成了任务