私はポリマーアプリを書いており、ポリマーの要素によって使用されるサービスを持っています。私はこのサービスをテストしたいのですが、どのように考え出すことはできません。ポリマーでサービスをテストするにはどうすればよいですか?
は、ここで私はサービスに持っているものです。
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../test-service.html">
<script>
define('test-service',() => {
class TestService {
constructor(componentA, componentB) {
this.componentA = componentA;
this.componentB = componentB;
}
}
return TestService;
});
</script>
は、どのように私はこれをテストすることができますか?単純に.htmlファイルを含めると、TestServiceにアクセスすることはできません。
'web-component-tester'を試したことがありますか? – a1626
うん、それは私が使っているもので、私のトラブルはどこから来ているのか。それに応じて問題の説明を更新しました。 – horstwilhelm