mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Make sure ts extension has loaded before running on-enter tests
Fixes #101922 Also adds back a test that was incorrectly removed
This commit is contained in:
@@ -28,6 +28,11 @@ const type = async (document: vscode.TextDocument, text: string): Promise<vscode
|
||||
};
|
||||
|
||||
suite('OnEnter', () => {
|
||||
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 = <div onclick={bla}>${CURSOR}`, 'jsx', async (_editor, document) => {
|
||||
await type(document, '\nx');
|
||||
assert.strictEqual(
|
||||
document.getText(),
|
||||
joinLines(
|
||||
`const a = <div onclick={bla}>`,
|
||||
` x`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user