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