失败 运行 Teaspoon CLI 但在浏览器中成功

Fail run Teaspoon CLI but success in browser

我很难 运行 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

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