TypeScript/tests/cases/fourslash/convertFunctionToEs6Class-propertyMember.ts
Jack Works 6f7faa7636
Fix: convertFunctionToEs6Class cannot recognize x.prototype = {} pattern (#35219)
* fix: convertFunctionToEs6Class cannot recognize `x.prototype = {}` pattern

* test: add test for convert fn to es6

* chore: add more tests

* chore: move tests around

* chore: make code more clear
2020-04-30 11:06:46 -07:00

32 lines
556 B
TypeScript

// @allowNonTsExtensions: true
// @Filename: test123.js
/// <reference path="./fourslash.ts" />
//// // Comment
//// function /*1*/fn() {
//// this.baz = 10;
//// }
//// fn.prototype = {
//// /** JSDoc */
//// bar: function () {
//// console.log('hello world');
//// }
//// }
verify.codeFix({
description: "Convert function to an ES2015 class",
newFileContent:
`// Comment
class fn {
constructor() {
this.baz = 10;
}
/** JSDoc */
bar() {
console.log('hello world');
}
}
`,
});