提交 308a4f6a 编写于 作者: M Matt Bierner

Make sure ts extension has loaded before running on-enter tests

Fixes #101922

Also adds back a test that was incorrectly removed
上级 d87041ed
......@@ -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`));
});
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册