Beispiel #1
0
 def test_transform_string_strip_types(self):
     result = jsx.transform_string('var x: Number = 1', strip_types=True)
     self.assertEquals(result, 'var x         = 1')
Beispiel #2
0
 def test_transform_string(self):
     result = jsx.transform_string('<div />')
     self.assertEquals(result, 'React.createElement("div", null)')
Beispiel #3
0
 def test_transform_string_harmony(self):
     result = jsx.transform_string('var {x} = y', harmony=True)
     self.assertEquals(result, 'var $__0=  y,x=$__0.x')
Beispiel #4
0
 def output(self, _in, out, **kwargs):
     out.write(jsx.transform_string(_in.read().encode("utf-8")))
Beispiel #5
0
 def input(self, **kwargs):
     return jsx.transform_string(self.content)
Beispiel #6
0
 def test_transform_string_strip_types(self):
     result = jsx.transform_string('var x: Number = 1', strip_types=True)
     self.assertEquals(result, 'var x         = 1')
Beispiel #7
0
 def test_transform_string_harmony(self):
     result = jsx.transform_string('var {x} = y', harmony=True)
     self.assertEquals(result, 'var $__0=  y,x=$__0.x')
Beispiel #8
0
 def test_transform_string(self):
     result = jsx.transform_string('<div />')
     self.assertEquals(result, 'React.createElement("div", null)')