错误:ENOENT:没有这样的文件或目录,stat '/.VolumeIcon.icns'

MLa*_*Law 12 unit-testing vue.js cypress

知道为什么我在尝试Vue.js使用 Cypress 运行组件测试时会得到这个吗?这是与在 MacOS Catalina 上运行有关的错误吗?(我问这个是因为我认为 VolumeIcon.icns 是 OS X 的东西??)

The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (/Users/MLaw/vue-app/tests/plugins/index.js)

Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns'

Error: The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (`/Users/MLaw/vue-app/tests/plugins/index.js`)
    at Object.get (/Users/MLaw/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/server/lib/errors.js:968:15)
    at EventEmitter.handleError (/Users/MLaw/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/index.js:159:20)
    at EventEmitter.emit (events.js:310:20)
    at ChildProcess.<anonymous> (/Users/MLaw/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:19:22)
    at ChildProcess.emit (events.js:310:20)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
Run Code Online (Sandbox Code Playgroud)

我的index.js样子:

    const preprocessor = require('@cypress/vue/dist/plugins/webpack');
module.exports = (on, config) => {
  preprocessor(on, config);
  // IMPORTANT return the config object
  return config
};
Run Code Online (Sandbox Code Playgroud)

tro*_*roy 23

sudo touch /.VolumeIcon.icns
Run Code Online (Sandbox Code Playgroud)

我使用 M1 MacOS,它适合我。