mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-25 12:40:05 -05:00
Add test
This commit is contained in:
@@ -1132,6 +1132,12 @@ function [#|f|]() {
|
||||
const [#|foo|] = function () {
|
||||
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
|
||||
}
|
||||
`);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_simpleFunctionExpressionWithName", `
|
||||
const foo = function [#|f|]() {
|
||||
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
|
||||
}
|
||||
`);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_catchBlockUniqueParams", `
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// ==ORIGINAL==
|
||||
|
||||
const foo = function /*[#|*/f/*|]*/() {
|
||||
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
|
||||
}
|
||||
|
||||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
const foo = async function f() {
|
||||
const result = await fetch('https://typescriptlang.org');
|
||||
console.log(result);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// ==ORIGINAL==
|
||||
|
||||
const foo = function /*[#|*/f/*|]*/() {
|
||||
return fetch('https://typescriptlang.org').then(result => { console.log(result) });
|
||||
}
|
||||
|
||||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
const foo = async function f() {
|
||||
const result = await fetch('https://typescriptlang.org');
|
||||
console.log(result);
|
||||
}
|
||||
Reference in New Issue
Block a user