diff --git a/test/unittests.js b/test/unittests.js index 9c1c00a6..e5f89866 100644 --- a/test/unittests.js +++ b/test/unittests.js @@ -32,7 +32,13 @@ if (typeof Promise === 'undefined') { describe('Unit Tests', function () { - if (typeof window !== 'undefined') { afterEach(function () { window.scrollTo(0, document.body.scrollHeight); }); } + if (typeof window !== 'undefined') { + afterEach(function () { + if (window.scrollY >= document.body.scrollHeight - window.innerHeight - 100) { + window.scrollTo(0, document.body.scrollHeight); + } + }); + } require('./crypto'); require('./general');