【问题标题】:phantom-jasmine can not find specsphantom-jasmine 找不到规格
【发布时间】:2013-06-27 10:06:19
【问题描述】:

我正在尝试使用phantom-jasmine。我已经在我的系统(Mountain Lion 和 Ubuntu)上安装了 phantomjs(1.9.1),并使用 npm 安装了 phantom-jasmine。

问题是当我尝试从他们的示例中运行 phantom-jasmine 示例/TestRunner.html 时,我得到 0 个规范,0 个失败,尽管它应该是 3 个规范,1 个输出失败。

如果我从浏览器打开 TestRunner.html,它会按预期运行,但 phantom-jasmine 似乎无法找到规范。

另一件事是当我提供绝对路径(phantom-jasmine /home/me/phantom-jasmine/examples/TestRunner.html 到 TestRunner.html this 时发生

【问题讨论】:

  • 您找到解决方案了吗?

标签: node.js jasmine phantomjs


【解决方案1】:

不完全确定原因,但我通过在调用中省略 TestRunner.html 来运行示例。像这样:

phantom-jasmine examples

您使用 npm 安装时获得的分支/版本似乎与 https://github.com/jcarver989/phantom-jasmine 中描述的不匹配。

查看已安装的 readme.md 帮助了我。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。与此同时,我最终切换到一组新的脚本来从命令行使用 phantomjs 运行 jasmine 测试。见SenchaProSvcs/UnitTestDemo

    【讨论】:

      【解决方案3】:

      我在使用 phantom-jasmine 时遇到了同样的问题。为了让它工作,我依赖 phantom-jasmine repo 中的 run_jasmine_test.coffee 文件。我在我的仓库中复制了这个文件(和 console-runner.js),并通过在我的终端中运行以下命令通过 phantomjs 调用了 testRunner:

      phantomjs lib/jasmine/run_jasmine_test.coffee testRunner.html
      

      我这里得到的输出和我直接在浏览器中运行testRunner.html时得到的输出是一致的。

      希望这会有所帮助。

      【讨论】:

        猜你喜欢
        • 2014-02-21
        • 2014-09-30
        • 1970-01-01
        • 2012-02-22
        • 1970-01-01
        • 2014-08-17
        • 2021-05-20
        • 1970-01-01
        • 2013-09-06
        相关资源
        最近更新 更多