首页 > 解决方案 > SyntaxError:在 Jenkins 中运行 Nightwatch 测试的意外标识符

问题描述

附件是我在尝试运行运行守夜脚本的詹金斯作业时遇到的错误。节点模块中的功能似乎存在问题。

期望的行为是 jenkins 中的作业成功运行。问题不在于我编写的代码。这在本地有效。这是节点和詹金斯之间的问题。

aws/workspace/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS/lib/node_modules/nightwatch/lib/utils/periodic-promise.js:39

async runAction({prevResult, prevQueuePromise}) {
        ^^^^^^^^^

SyntaxError: Unexpected identifier

这是节点模块代码...

async runAction({prevResult, prevQueuePromise}) {
    if (!this.queue.length) {
      return null;
    }

    const queuePromise = this.queue.shift();
    const deferred = createPromise();

    try {
      const result = await this.perform(queuePromise, {prevResult, prevQueuePromise}, deferred);

      if (this.queue.length) {
        return await this.runAction({
          prevResult: result,
          prevQueuePromise: queuePromise
        });
      }

标签: javascriptjenkinsnightwatch

解决方案


推荐阅读