Closed hiphapis closed 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.
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 ;(
Can you just have Sprockets render out raw javascript vs. rendering jsx? E.G. https://github.com/jvatic/react-jsx-sprockets
you're right. react-jsx-sprockets is solution. Thanks @ragaskar!!
switch 'jsx' if file.ext is 'jsx'