mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 02:15:12 -06:00
Merge pull request #2711 from SaschaNaz/formatChainedCallbacks
Formatting test for callback function chaining
This commit is contained in:
commit
f77776200c
40
tests/cases/fourslash/formattingOnChainedCallbacks.ts
Normal file
40
tests/cases/fourslash/formattingOnChainedCallbacks.ts
Normal file
@ -0,0 +1,40 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////Promise
|
||||
//// .resolve()
|
||||
//// .then(() => {/*1*/""/*2*/
|
||||
////}).then(() => {/*3*//*4*/
|
||||
////})/*semi1*/ /*semi2*/
|
||||
|
||||
////function foo() {
|
||||
//// return Promise.resolve()
|
||||
//// .then(function () {
|
||||
//// ""/*a*/
|
||||
//// })/*b*/
|
||||
////}
|
||||
|
||||
goTo.marker('1');
|
||||
edit.insertLine('');
|
||||
goTo.marker('2');
|
||||
// Expected, with bug 1888: verify.currentLineContentIs(' ""');
|
||||
verify.currentLineContentIs(' ""');
|
||||
goTo.marker('4');
|
||||
edit.insertLine('');
|
||||
goTo.marker('3');
|
||||
verify.currentLineContentIs(' }).then(() => {');
|
||||
|
||||
goTo.marker("semi1");
|
||||
edit.insert(';');
|
||||
// Expected, with bug 1888: verify.currentLineContentIs(' });');
|
||||
verify.currentLineContentIs('}); ');
|
||||
goTo.marker("semi2");
|
||||
edit.insert(';');
|
||||
verify.currentLineContentIs(' });;');
|
||||
|
||||
goTo.marker('a');
|
||||
edit.insert(';');
|
||||
verify.currentLineContentIs(' "";');
|
||||
goTo.marker('b');
|
||||
edit.insert(';');
|
||||
// Expected, with bug 1888: verify.currentLineContentIs(' });');
|
||||
verify.currentLineContentIs(' });');
|
||||
Loading…
x
Reference in New Issue
Block a user