admin管理员组文章数量:1321257
I have the following tests/acceptance/index-test.js
in an ember-cli version 0.0.22 app:
import startApp from '../helpers/start-app';
test('index transitions', function(){
visit('/');
});
When I go to http://localhost:4200/tests
I see:
Died on test #1
at eval (ember-cli/tests/acceptance/index-test.js:7:5)
at requireModule (loader/loader.js:54:29)
at eval (ember-cli/tests/test-loader.js:9:7)
at Array.forEach (native)
at eval (ember-cli/tests/test-loader.js:8:8)
at requireModule (loader/loader.js:54:29)
at http://localhost:4200/tests:43:7: visit is not defined
Source: ReferenceError: visit is not defined
at Object.eval (ember-cli/tests/acceptance/index-test.js:8:7)
It seems I'm having trouble loading code. Placeholder files in the project would be useful. How can I make it work?
I have the following tests/acceptance/index-test.js
in an ember-cli version 0.0.22 app:
import startApp from '../helpers/start-app';
test('index transitions', function(){
visit('/');
});
When I go to http://localhost:4200/tests
I see:
Died on test #1
at eval (ember-cli/tests/acceptance/index-test.js:7:5)
at requireModule (loader/loader.js:54:29)
at eval (ember-cli/tests/test-loader.js:9:7)
at Array.forEach (native)
at eval (ember-cli/tests/test-loader.js:8:8)
at requireModule (loader/loader.js:54:29)
at http://localhost:4200/tests:43:7: visit is not defined
Source: ReferenceError: visit is not defined
at Object.eval (ember-cli/tests/acceptance/index-test.js:8:7)
It seems I'm having trouble loading code. Placeholder files in the project would be useful. How can I make it work?
Share Improve this question edited Jul 11, 2014 at 0:59 bguiz 28.5k49 gold badges163 silver badges251 bronze badges asked Apr 11, 2014 at 1:34 TuteCTuteC 4,38231 silver badges40 bronze badges2 Answers
Reset to default 9I needed to call startApp();
in the test file, like:
import startApp from '../helpers/start-app';
test('index transitions', function(){
startApp();
visit('/');
andThen(function(){
equal(find('h3.breadcrumb').text(), 'Title');
});
});
I added this section to the documentation for ember-cli.
Be sure to to invoke startApp()
in setup
of the module, like so:
module('An Integration test', {
setup: function() {
App = startApp();
},
teardown: function() {
Ember.run(App, App.destroy);
},
});
... instead of within each test
.
本文标签: javascriptHow can I run an acceptance testStack Overflow
版权声明:本文标题:javascript - How can I run an acceptance test? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742095872a2420545.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论