api tests - more use of promises in mocha

This commit is contained in:
Benjamin Pasero
2015-11-25 12:04:21 +01:00
parent f924875c00
commit 052a1dc8a0
3 changed files with 13 additions and 21 deletions

View File

@@ -14,12 +14,10 @@ import {join} from 'path';
suite("editor tests", () => {
teardown((done) => {
cleanUp().then(() => done(), (error) => done(error));
});
teardown(cleanUp);
test('make edit', (done) => {
createRandomFile().then(file => {
test('make edit', () => {
return createRandomFile().then(file => {
return workspace.openTextDocument(file).then(doc => {
return window.showTextDocument(doc).then((editor) => {
return editor.edit((builder) => {
@@ -38,6 +36,6 @@ suite("editor tests", () => {
});
});
});
}).then(() => done(), (error) => done(error));
});
});
});