@@ -276,59 +276,11 @@ var x = 0;`,
276
276
} ) ;
277
277
278
278
it ( "transpile file as 'tsx' if 'jsx' is specified" , ( ) => {
279
- let input = `import * as React from 'react';\r\n` +
280
- `export default class Test extends React.Component<any, any> {\r\n` +
281
- ` constructor(props: any) {\r\n` +
282
- ` this.state = {\r\n` +
283
- ` text : undefined\r\n` +
284
- ` };\r\n` +
285
- ` super();\r\n` +
286
- ` }\r\n` +
287
- ` handleClick(e) {\r\n` +
288
- ` e.preventDefault();\r\n` +
289
- ` this.setState({\r\n` +
290
- ` text : 'just testing'\r\n` +
291
- ` });\r\n` +
292
- ` }\r\n` +
293
- ` render() {\r\n` +
294
- ` return (\r\n` +
295
- ` <div>\r\n` +
296
- ` <a href="#" onClick={this.handleClick}>\r\n` +
297
- ` {'test'}\r\n` +
298
- ` </a>\r\n` +
299
- ` </div>\r\n` +
300
- ` );\r\n` +
301
- ` }\r\n` +
302
- `}` ;
303
- let output = `var __extends = (this && this.__extends) || function (d, b) {\r\n` +
304
- ` for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n` +
305
- ` function __() { this.constructor = d; }\r\n` +
306
- ` d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n` +
307
- `};\r\n` +
308
- `var React = require('react');\r\n` +
309
- `var Test = (function (_super) {\r\n` +
310
- ` __extends(Test, _super);\r\n` +
311
- ` function Test(props) {\r\n` +
312
- ` this.state = {\r\n` +
313
- ` text: undefined\r\n` +
314
- ` };\r\n` +
315
- ` _super.call(this);\r\n` +
316
- ` }\r\n` +
317
- ` Test.prototype.handleClick = function (e) {\r\n` +
318
- ` e.preventDefault();\r\n` +
319
- ` this.setState({\r\n` +
320
- ` text: 'just testing'\r\n` +
321
- ` });\r\n` +
322
- ` };\r\n` +
323
- ` Test.prototype.render = function () {\r\n` +
324
- ` return (React.createElement("div", null, React.createElement("a", {"href": "#", "onClick": this.handleClick}, 'test')));\r\n` +
325
- ` };\r\n` +
326
- ` return Test;\r\n` +
327
- `})(React.Component);\r\n` +
328
- `exports["default"] = Test;\r\n` ;
279
+ let input = `var x = <div/>` ;
280
+ let output = `var x = React.createElement("div", null);\n` ;
329
281
test ( input , {
330
282
expectedOutput : output ,
331
- options : { compilerOptions : { jsx : JsxEmit . React , newLine : NewLineKind . CarriageReturnLineFeed } }
283
+ options : { compilerOptions : { jsx : JsxEmit . React , newLine : NewLineKind . LineFeed } }
332
284
} )
333
285
} ) ;
334
286
} ) ;
0 commit comments