Skip to content

Commit 708b6a0

Browse files
committed
test: use close promise support to clean up Ti.UI.View tests
1 parent 7555ee3 commit 708b6a0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/Resources/ti.ui.view.test.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ describe('Titanium.UI.View', function () {
2222

2323
before(finish => {
2424
rootWindow = Ti.UI.createWindow({ exitOnClose: false });
25-
rootWindow.addEventListener('open', () => finish());
26-
rootWindow.open();
25+
rootWindow.open().then(() => finish()).catch(e => finish(e));
2726
});
2827

2928
function closeWindow(win, done) {
3029
if (win && !win.closed) {
31-
win.addEventListener('close', function listener () {
32-
win.removeEventListener('close', listener);
33-
win = null;
34-
done();
35-
});
36-
win.close();
30+
win.close().then(() => done()).catch(_e => done());
3731
} else {
3832
win = null;
3933
done();

0 commit comments

Comments
 (0)