Testing Batman.TestCase上的安装、运行测试和拆卸失败

Testing Batman.TestCase上的安装、运行测试和拆卸失败,testing,batman.js,Testing,Batman.js,我正试着站起来跑步。Qunit和测试运行良好,但当我使用该示例时: class SimpleTest extends Batman.TestCase @test 'A simple test', -> @assert true test = new SimpleTest test.runTests() 当我浏览到localhost:3000/qunit时,我会收到以下消息: 安装程序在简单测试中失败:undefined不是函数 死于test.Batman.TestCase.

我正试着站起来跑步。Qunit和测试运行良好,但当我使用该示例时:

class SimpleTest extends Batman.TestCase
  @test 'A simple test', ->
    @assert true

test = new SimpleTest
test.runTests()
当我浏览到localhost:3000/qunit时,我会收到以下消息:

  • 安装程序在简单测试中失败:undefined不是函数
  • 死于test.Batman.TestCase.TestCase.test.test.test.run的测试2(localhost:3000/assets/extras/testing/test#u case.js?body=1:20:22) 在SimpleTest.Batman.TestCase.TestCase.runTests(localhost:3000/assets/extras/testing/test_case.js?body=1:51:28) 在localhost:3000/assets/simple_test.js?body=1:24:8 在localhost:3000/assets/simple_test.js?body=1:26:4:undefined不是一个函数
  • 简单测试中的拆卸失败:undefined不是函数
  • 在test_helper.coffee中,我手动包含了项目、sinon和github源代码中的四个测试用例源文件,包括test_case.coffee


    我做错了什么?

    根据这些
    .coffee
    源文件的加载方式,它们可能没有先加载依赖项

    你可以试试这个:

    • 从下载0.16版本
    • 使用版本中预编译的
      batman.testing.js
    • 确保QUnit首先加载
      batman.js
      ,然后加载
      batman.testing.js
      。(
      Batman.Object
      必须在加载
      Batman.TestCase
      之前定义)
    这有用吗