jasmine / jasmine-gem

Jasmine ruby gem
681 stars 275 forks source link

includable jsx file #222

Closed hiphapis closed 10 years ago

hiphapis commented 10 years ago

switch 'jsx' if file.ext is 'jsx'

ragaskar commented 10 years ago

Can you explain why you need to change the text type? What type of file is this?

I think if we do add this functionality, we'd prefer to do it in a re-usable/general way, rather than hardcode support for jsx.

hiphapis commented 10 years ago

Thx for your reply

i used React React is rendering by JSX. jasmine is not acceptable JSX

if js-type == JSX --if <script type="text/jsx"></script> ----render JSX in browser --elsif <script type="text/javascript"></script> ----browser is not rendered JSX --end end

just support JSX type, other types are text/javascript

sample spec:

describe("sample", function () {
  var component = React.addons.TestUtils.renderIntoDocument(<sample type="popular" />);
  $c = $(component.getDOMNode());  
  expect($c.find(".likes_count").length).toEqual(10);
});

hm.. are you understand? sorry about my english ;(

ragaskar commented 10 years ago

Can you just have Sprockets render out raw javascript vs. rendering jsx? E.G. https://github.com/jvatic/react-jsx-sprockets

hiphapis commented 10 years ago

you're right. react-jsx-sprockets is solution. Thanks @ragaskar!!