diff --git a/test/bootstrap.js b/test/bootstrap.js index f91f4158..eda777a8 100644 --- a/test/bootstrap.js +++ b/test/bootstrap.js @@ -123,7 +123,6 @@ if (typeof window.toolbarButtonsCount !== 'number') { * * @param {number} timeout * @return {*} - * @deprecated Use mockTimers instead and mockTimers().delay */ function delay(timeout) { return new naturalPromise(resolve => { diff --git a/test/tests/acceptance/editor-ready.test.js b/test/tests/acceptance/editor-ready.test.js index 9b386012..0a8f3d75 100644 --- a/test/tests/acceptance/editor-ready.test.js +++ b/test/tests/acceptance/editor-ready.test.js @@ -277,7 +277,9 @@ describe('Readiness', () => { describe('Async init', () => { it('Should return resolved promise', done => { + const timers = mockTimers(); unmockPromise(); + const jodit = getJodit({ events: { createEditor: () => delay(100) @@ -285,10 +287,12 @@ describe('Readiness', () => { }); expect(jodit.isReady).is.false; + timers.delay(700); jodit.waitForReady().then(j => { expect(jodit).eq(j); expect(jodit.isReady).is.true; + timers.cleanup(); done(); }); });