PolymerElements / test-fixture

21 stars 14 forks source link

Bug when running web component tests #20

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi there

I'm running two web component tests and get the following error:

chrome 46                ? Test Suite Initialization

  Failed to execute 'registerElement' on 'Document': Registration failed for type 'test-fixture'. A type with that name is already registered.
    <unknown> at   <unknown> at /components/andorra/dist/bower_components/test-fixture/test-fixture.html:312:0
    <unknown> at   <unknown> at /components/andorra/dist/bower_components/test-fixture/test-fixture.html:315:0

The fixtures have different names. This worked fine with version 1.0.0... Kind regards

ghost commented 8 years ago

Alright I fixed the issue! The problem was some wrong imports:

  1. I imported 'webcomponents.min.js' and I changed this to 'webcomponents-lite.min.js' (in test/index.html)
  2. I changed these imports (in the actual test files):
<script src="../bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="../bower_components/polymer/polymer.html">
<script src="../bower_components/web-component-tester/browser.js"></script>
<script src="../bower_components/test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../bower_components/test-fixture/test-fixture.html">

to these:

<script src="../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../bower_components/polymer/polymer.html">

Hope this helps someone :) closing issue...