diff --git a/extensions/typescript-language-features/src/test/onEnter.test.ts b/extensions/typescript-language-features/src/test/onEnter.test.ts index 72e59b4482f..5ec03f5c40a 100644 --- a/extensions/typescript-language-features/src/test/onEnter.test.ts +++ b/extensions/typescript-language-features/src/test/onEnter.test.ts @@ -28,6 +28,11 @@ const type = async (document: vscode.TextDocument, text: string): Promise { + setup(async () => { + // the tests make the assumption that language rules are registered + await vscode.extensions.getExtension('vscode.typescript-language-features')!.activate(); + }); + test('should indent after if block with braces', () => { return withRandomFileEditor(`if (true) {${CURSOR}`, 'js', async (_editor, document) => { await type(document, '\nx'); @@ -51,4 +56,15 @@ suite('OnEnter', () => { `})`)); }); }); + + test('should indent after simple jsx tag with attributes', () => { + return withRandomFileEditor(`const a =
${CURSOR}`, 'jsx', async (_editor, document) => { + await type(document, '\nx'); + assert.strictEqual( + document.getText(), + joinLines( + `const a =
`, + ` x`)); + }); + }); });