【问题标题】:Fail run Teaspoon CLI but success in browser运行 Teaspoon CLI 失败,但在浏览器中成功
【发布时间】:2015-04-29 09:34:32
【问题描述】:

我在运行 JS 测试套件 CLI 时遇到困难。虽然测试在网络浏览器中通过。

$ rake teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:56362/teaspoon/default
FFFFFFFFFFFFFFFFFFF

Failures:

  1)  global failure (1, 0, 1)
     Failure/Error: TypeError: instanceof called on an object with an invalid prototype property.

  2)  global failure (1, 0, 1)
     Failure/Error: ReferenceError: Can't find variable: App

  3)  global failure (1, 0, 1)
     Failure/Error: ReferenceError: Can't find variable: App

...
and so on
...

  19)  global failure (1, 0, 1)
     Failure/Error: ReferenceError: Can't find variable: App

Finished in 0.02100 seconds
19 examples, 19 failures

Failed examples:

teaspoon -s default --filter="undefined global failure"

...
and so on
...

teaspoon -s default --filter="undefined global failure"
rake teaspoon failed

这里是repo

那么为什么它在浏览器中看到 App 变量而在 CLI 中却找不到呢?

$ phantomjs -v
1.9.8

【问题讨论】:

    标签: teaspoon


    【解决方案1】:

    问题与 PhantomJS 版本有关。现在使用 2.0.0,在 CLI 中测试已经足够了。

    【讨论】:

      猜你喜欢
      • 2012-02-21
      • 2018-07-29
      • 2013-10-04
      • 2019-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-16
      • 2020-11-21
      相关资源
      最近更新 更多