Seems a shame to have to plug (read: hack) around Karma, when the default 
(read: easier to set up) usage gets 99% of the way there. Not to balk at 
your efforts at all - I just think it seems like tackling this problem 
seems preferable to having to inject iframes with custom scripts.

On Tuesday, 20 May 2014 15:47:49 UTC+1, Rob Dodson wrote:
>
> I know the Polymer team uses a plugin they wrote for Karma to run tests in 
> iframes. You can check it out here:
> https://github.com/Polymer/core-tests/tree/master/tests
>
> We haven't written a ton of guidance around it (though I believe Addy is 
> working on an article) but the tools folder in that repo might be enough to 
> get you started. Maybe give it a shot, see how far you get, and we can keep 
> this thread going to work through any issues.
>
> On Tuesday, May 20, 2014 7:37:29 AM UTC-7, keithamus wrote:
>>
>> I've set up a reduced test case on 
>> Github<https://github.com/keithamus/polymer-karma-test>to demonstrate the 
>> problem I'm having.
>>
>> Essentially, Karma <http://karma-runner.github.io/> isn't working with 
>> Polymer - during running of the tests, Polymer complains about duplicate 
>> elements being registered, however, in Karma's debug mode, and in fact 
>> outside of the test environment, the polymer elements work fine.
>>
>> I realise that this sounds pretty much like a Karma bug, but this seems 
>> like a good place to get the ball rolling at least.
>>
>> The error from Polymer is as follows:
>>
>>   Error: DuplicateDefinitionError: a type with name 'a-element' is already 
>> registered
>>   at 
>> /Users/keith/Projects/polymer-karma-test/main/bower_components/platform/platform.js:15
>>
>>
>> Feel free to pull the repo and have a play
>>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/1ea26558-7372-444a-8b35-5bf5cd6ad2bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to