From fb1d2cf42cd6e1b30fe91ecc04aca624f6fb5ea9 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 7 Oct 2015 15:48:53 -0700 Subject: [PATCH] address PR feedback --- tests/cases/unittests/transpile.ts | 54 ++---------------------------- 1 file changed, 3 insertions(+), 51 deletions(-) diff --git a/tests/cases/unittests/transpile.ts b/tests/cases/unittests/transpile.ts index 0dd3125cda1..1d688f091a4 100644 --- a/tests/cases/unittests/transpile.ts +++ b/tests/cases/unittests/transpile.ts @@ -276,59 +276,11 @@ var x = 0;`, }); it("transpile file as 'tsx' if 'jsx' is specified", () => { - let input = `import * as React from 'react';\r\n` + -`export default class Test extends React.Component {\r\n` + -` constructor(props: any) {\r\n` + -` this.state = {\r\n` + -` text : undefined\r\n` + -` };\r\n` + -` super();\r\n` + -` }\r\n` + -` handleClick(e) {\r\n` + -` e.preventDefault();\r\n` + -` this.setState({\r\n` + -` text : 'just testing'\r\n` + -` });\r\n` + -` }\r\n` + -` render() {\r\n` + -` return (\r\n` + -`
\r\n` + -` \r\n` + -` {'test'}\r\n` + -` \r\n` + -`
\r\n` + -` );\r\n` + -` }\r\n` + -`}`; - let output = `var __extends = (this && this.__extends) || function (d, b) {\r\n` + -` for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n` + -` function __() { this.constructor = d; }\r\n` + -` d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n` + -`};\r\n` + -`var React = require('react');\r\n` + -`var Test = (function (_super) {\r\n` + -` __extends(Test, _super);\r\n` + -` function Test(props) {\r\n` + -` this.state = {\r\n` + -` text: undefined\r\n` + -` };\r\n` + -` _super.call(this);\r\n` + -` }\r\n` + -` Test.prototype.handleClick = function (e) {\r\n` + -` e.preventDefault();\r\n` + -` this.setState({\r\n` + -` text: 'just testing'\r\n` + -` });\r\n` + -` };\r\n` + -` Test.prototype.render = function () {\r\n` + -` return (React.createElement("div", null, React.createElement("a", {"href": "#", "onClick": this.handleClick}, 'test')));\r\n` + -` };\r\n` + -` return Test;\r\n` + -`})(React.Component);\r\n` + -`exports["default"] = Test;\r\n`; + let input = `var x =
`; + let output = `var x = React.createElement("div", null);\n`; test(input, { expectedOutput: output, - options: { compilerOptions: { jsx: JsxEmit.React, newLine: NewLineKind.CarriageReturnLineFeed } } + options: { compilerOptions: { jsx: JsxEmit.React, newLine: NewLineKind.LineFeed } } }) }); });