Skip to content

Commit

Permalink
Add slight delay to test
Browse files Browse the repository at this point in the history
For microsoft#101922

I can't repo this locally but suspect it may be timing related
  • Loading branch information
mjbvz authored and gjsjohnmurray committed Jul 9, 2020
1 parent 1e19239 commit 2518465
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions extensions/typescript-language-features/src/test/onEnter.test.ts
Expand Up @@ -6,7 +6,7 @@
import * as assert from 'assert';
import 'mocha';
import * as vscode from 'vscode';
import { CURSOR, withRandomFileEditor, joinLines } from './testUtils';
import { CURSOR, withRandomFileEditor, wait, joinLines } from './testUtils';

const onDocumentChange = (doc: vscode.TextDocument): Promise<vscode.TextDocument> => {
return new Promise<vscode.TextDocument>(resolve => {
Expand Down Expand Up @@ -42,22 +42,13 @@ suite('OnEnter', () => {
test('should indent within empty object literal', () => {
return withRandomFileEditor(`({${CURSOR}})`, 'js', async (_editor, document) => {
await type(document, '\nx');
await wait(500);

assert.strictEqual(
document.getText(),
joinLines(`({`,
` x`,
`})`));
});
});

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`));
});
});
});

0 comments on commit 2518465

Please sign in to comment.