Unit testing Mocha单元测试中的模拟

Unit testing Mocha单元测试中的模拟,unit-testing,mocking,angularjs,mocha.js,karma-runner,Unit Testing,Mocking,Angularjs,Mocha.js,Karma Runner,我试图建立一个简单的模拟示例,取自以下内容: 但是,当我尝试使用TestCular(使用Mocha)运行它时,会出现以下错误: info (watcher): Changed file "/path/to/testMock.js". PhantomJS 1.7 (Mac) Testing a car "before each" hook FAILED TypeError: 'undefined' is not an object (evaluating 'currentSpec.queu

我试图建立一个简单的模拟示例,取自以下内容:

但是,当我尝试使用TestCular(使用Mocha)运行它时,会出现以下错误:

info (watcher): Changed file "/path/to/testMock.js".
PhantomJS 1.7 (Mac) Testing a car "before each" hook FAILED
    TypeError: 'undefined' is not an object (evaluating 'currentSpec.queue.running')
        at isSpecRunning (/path/to/angular-mocks.js:1626)
        at /path/to/angular-mocks.js:1648
        at /path/to/testMock.js:25
PhantomJS 1.7 (Mac): Executed 29 of 41 (1 FAILED) (0.215 secs / NaN secs)

我做错了什么?

angular的稳定版本中没有用于摩卡的AFAIK Mock。它们已添加到不稳定的1.1.1版本中。code.angularjs.org/1.1.1/angular-mocks.js。
info (watcher): Changed file "/path/to/testMock.js".
PhantomJS 1.7 (Mac) Testing a car "before each" hook FAILED
    TypeError: 'undefined' is not an object (evaluating 'currentSpec.queue.running')
        at isSpecRunning (/path/to/angular-mocks.js:1626)
        at /path/to/angular-mocks.js:1648
        at /path/to/testMock.js:25
PhantomJS 1.7 (Mac): Executed 29 of 41 (1 FAILED) (0.215 secs / NaN secs)