0
votes

I'm having trouble integrating bitovi syn (link), Rails 3 (asset pipeline), Ember and qunit. I want to use syn for browser simulation for testing purposes. Has anyone done this, if so, how?

I'm using the version of syn that was released 11 Mar 2014. When I load it into my app, two things happen:

  1. I get a global failure in qunit that says "TypeError: 'undefined' is not an object (evaluating 'Syn.schedule')", (around this line: syn.js?body=1:1084) and
  2. A div with a form is added to my application.

I'm using qunit for the most part, and I dabbled with using YUI to do browser simulation but it isn't working quite the way I had expected it to. I'd really like to use Syn, but I don't understand why it's not working.

In attempting to get it work, I tried adding this line to the top of the syn.js file: window.Syn = { schedule: function (fn, ms) { Ember.run.later(window, fn, ms); } }; but it didn't do anything much at all.

I'd read on this pull request: https://github.com/bitovi/syn/pull/28 that I could add that piece of code to mount it in a fashion to work with Ember.

Any help would be greatly appreciated!

1

1 Answers

0
votes

So the thing here was simply to load Syn at the bottom of the page. It's potentially a bit broken at the moment in the case where you want to load it in the head (which I probably shouldn't have been doing anyway, but still!) :)