我正在寻找一些帮助来解决一些非常基本的ember插件组件集成测试,并希望有人可能知道在哪里寻找解决这个问题。测试包括在下面:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('my-comp', {
integration: true
});
test('it renders', function(assert) {
this.render(hbs`{{my-comp}}`);
assert.ok(this.$());
});
test('it renders with attribute', function(assert) {
this.render(hbs`{{my-comp title="hi"}}`);
assert.ok(this.$());
});
test('it renders with attribute (again)', function(assert) {
this.set('componentTitle', 'hello');
this.render(hbs`{{my-comp title=componentTitle}}`);
assert.ok(this.$());
});
插件是使用ember蓝图创建的,并且所有3个测试都在以下ember-try场景中传递:
在以下情况下,只有包含属性的组件的测试失败:
针对两种失败方案报告的错误都是相同的:
not ok 10 PhantomJS 2.0 - component:my-comp: it renders with attribute
---
actual: >
null
message: >
Died on test #1 at test (http://localhost:7357/assets/test-support.js:1989:15)
at http://localhost:7357/assets/dummy.js:486:19
at http://localhost:7357/assets/vendor.js:150:34
at tryFinally (http://localhost:7357/assets/vendor.js:30:21)
at requireModule (http://localhost:7357/assets/vendor.js:148:15)
at require (http://localhost:7357/assets/test-loader.js:29:16)
at loadModules (http://localhost:7357/assets/test-loader.js:21:25)
at load (http://localhost:7357/assets/test-loader.js:40:35)
at http://localhost:7357/assets/test-support.js:6822:20: Assertion Failed: A helper named 'my-comp' could not be found
Log: |
...
not ok 11 PhantomJS 2.0 - component:my-comp: it renders with attribute (again)
---
actual: >
null
message: >
Died on test #1 at test (http://localhost:7357/assets/test-support.js:1989:15)
at http://localhost:7357/assets/dummy.js:527:19
at http://localhost:7357/assets/vendor.js:150:34
at tryFinally (http://localhost:7357/assets/vendor.js:30:21)
at requireModule (http://localhost:7357/assets/vendor.js:148:15)
at require (http://localhost:7357/assets/test-loader.js:29:16)
at loadModules (http://localhost:7357/assets/test-loader.js:21:25)
at load (http://localhost:7357/assets/test-loader.js:40:35)
at http://localhost:7357/assets/test-support.js:6822:20: Assertion Failed: A helper named 'my-comp' could not be found
Log: |
...
我的环境如下:
答案 0 :(得分:1)
这个问题的解决方案是从" 0.4.9"升级ember-qunit。到" 0.4.16"。