小编Ano*_*ous的帖子

Cypress 任务:插件文件丢失或无效

当我添加我的自定义任务时,我开始遇到一些错误,我不知道如何解决它。我正在遵循 RWA 的示例:https : //github.com/cypress-io/cypress-realworld-app/blob/develop/cypress/plugins/index.ts

柏树/插件/index.js

import axios from "axios";
import { percyHealthCheck } from "@percy/cypress/task";
import { bookingCancel } from "../../server/api/booking-controller";

export default (on, config) => {
  on("task", {
    percyHealthCheck,
    async "booking:cancel"(user, bookingId, options) {
      const response = await axios({
        baseURL: Cypress.env("apiUrl"),
        ...bookingCancel(user, bookingId, options),
      });
      return response;
    },
  });
  return config;
};
Run Code Online (Sandbox Code Playgroud)

我的错误:

Error: The plugins file is missing or invalid.

Your `pluginsFile` is set to `/cypress/plugins/index.js`, but either the file is missing, it contains a syntax …
Run Code Online (Sandbox Code Playgroud)

javascript testing automated-tests cypress

5
推荐指数
1
解决办法
5079
查看次数

标签 统计

automated-tests ×1

cypress ×1

javascript ×1

testing ×1