Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d5c3142

Browse files
committed
Add test coverage for Format Document
1 parent 669e7f8 commit d5c3142

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/test/suite/index.test.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as assert from 'assert';
22
import { before, beforeEach } from 'mocha';
33

44
import * as auto from './automation';
5-
import { TIMEOUT_MS } from './setup';
65

76
// can directly import extension if needed
87
// import * as myExtension from '../../extension';
@@ -17,9 +16,9 @@ end
1716
`;
1817

1918
suite('Syntax Tree', () => {
20-
suite('commands', () => {
21-
beforeEach(auto.reset);
19+
beforeEach(auto.reset);
2220

21+
suite('lifecycle commands', () => {
2322
test('start', async () => {
2423
await auto.start();
2524
const text = await auto.showOutputChannel();
@@ -37,13 +36,18 @@ suite('Syntax Tree', () => {
3736
await auto.restart();
3837
const text = await auto.showOutputChannel();
3938
assert.match(text, /^Restarting language server/m);
39+
assert.match(text, /^Stopping language server/m);
40+
assert.match(text, /^Starting language server/);
4041
})
4142
});
4243

43-
// TODO: figure out re-entrancy issue in CI (prolly two LanguageClient instances at once?)
44-
test.skip('Format Document', async () => {
45-
const editor = await auto.createEditor(UNFORMATTED);
46-
await auto.formatDocument();
47-
assert.equal(editor.document.getText(), FORMATTED);
48-
});
44+
suite('functional commands', () => {
45+
before(auto.start);
46+
47+
test('Format Document', async () => {
48+
const editor = await auto.createEditor(UNFORMATTED);
49+
await auto.formatDocument();
50+
assert.equal(editor.document.getText(), FORMATTED);
51+
});
52+
})
4953
});

0 commit comments

Comments
 (0)