Tut*_*teC 4 javascript ember.js ember-cli
我tests/acceptance/index-test.js在ember-cli版本0.0.22应用程序中有以下内容:
import startApp from '../helpers/start-app';
test('index transitions', function(){
visit('/');
});
Run Code Online (Sandbox Code Playgroud)
当我去的时候,http://localhost:4200/tests我看到:
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)
Run Code Online (Sandbox Code Playgroud)
看来我在加载代码时遇到了麻烦.项目中的占位符文件很有用.我怎样才能使它工作?
我需要调用startApp();测试文件,如:
import startApp from '../helpers/start-app';
test('index transitions', function(){
startApp();
visit('/');
andThen(function(){
equal(find('h3.breadcrumb').text(), 'Title');
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1254 次 |
| 最近记录: |