Skip to content

Commit 1566bbd

Browse files
committed
test: use close promise support to clean up Ti.UI.View tests
1 parent e7934df commit 1566bbd

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
@@ -23,18 +23,12 @@ describe('Titanium.UI.View', function () {
2323

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

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

0 commit comments

Comments
 (0)