better cleanup for api tests

This commit is contained in:
Joao Moreno
2015-11-25 11:55:52 +01:00
parent c37136730f
commit aba9d6bf3f
2 changed files with 39 additions and 11 deletions

View File

@@ -14,9 +14,7 @@ import * as os from 'os';
suite('workspace-namespace', () => {
teardown((done) => {
cleanUp().then(() => done(), (error) => done(error));
});
teardown(cleanUp);
test('textDocuments', () => {
assert.ok(Array.isArray(workspace.textDocuments));
@@ -28,12 +26,9 @@ suite('workspace-namespace', () => {
assert.throws(() => workspace.rootPath = 'farboo');
});
test('openTextDocument', done => {
workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
test('openTextDocument', () => {
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
assert.ok(doc);
done();
}, err => {
done(err);
});
});