这些是我迄今为止编写的测试。第一个断言通过了。第二个我得到错误:TypeError: undefined is not a function
。
/*global describe, it, assert */
App.rootElement = '#emberTestingDiv';
App.setupForTesting();
App.injectTestHelpers();
module('Integration Tests', {
setup: function() {
App.reset();
}
});
// Tests
test('search terms?', function() {
App.mainSearcher.params.q = 'our keywords';
equal(App.mainSearcher.params.q, 'our keywords');
});
test('router?', function() {
visit('/search?q=method&sort=patAssignorEarliestExDate%20desc');
andThen(function(){
equal(find('title').text(), 'method');
});
});
我不确定我为什么会这样。我正在使用 grunt-contrib-qunit,所以我很好奇我是否在通过 grunt/npm 使用 Ember 应用程序设置 qunit 时做错了什么。
但我不认为是这样,因为第一个测试通过了。
我会很感激任何帮助。
谢谢!
编辑:
这是完整的错误
Died on test #1 at file:///Users/jwhite/Documents/workspace/uspto-aotw/front-end/test/spec/test.js:21:1: undefined is not a function
Source: TypeError: undefined is not a function
第 21 行是第二次测试的第一行:
test('router?', function() {