From 4d0ac376c79b0e3a087bf97d52e18f0aa04c7c6b Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 24 Jun 2021 17:11:10 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20fix=20jest=20tests=20that=20use?= =?UTF-8?q?=20the=20new=20@sinonjs/fake-timers=20(https://github.com/faceb?= =?UTF-8?q?ook/jest/issues/11447#issuecomment-849477750)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements/dev.txt | 28 +++--- requirements/prod.txt | 104 +++++++++++--------- test/js/components/jobs/progressBar.test.js | 1 + test/js/components/jobs/shareModal.test.js | 1 + test/js/utils/websockets.test.js | 1 + 5 files changed, 72 insertions(+), 63 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 58fe76ca85..fa5f089665 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --allow-unsafe requirements/dev.in @@ -47,12 +47,12 @@ coveralls==3.1.0 # via -r requirements/dev.in decorator==5.0.9 # via ipython -django-extensions==3.1.3 - # via -r requirements/dev.in django==3.1.12 # via # -c requirements/prod.txt # django-extensions +django-extensions==3.1.3 + # via -r requirements/dev.in docopt==0.6.2 # via coveralls docutils==0.16 @@ -63,7 +63,7 @@ factory-boy==3.2.0 # via # -r requirements/dev.in # pytest-factoryboy -faker==8.6.0 +faker==8.8.2 # via # -c requirements/prod.txt # factory-boy @@ -80,10 +80,10 @@ inflection==0.5.1 # via pytest-factoryboy iniconfig==1.1.1 # via pytest -ipython-genutils==0.2.0 - # via traitlets ipython==7.24.1 # via -r requirements/dev.in +ipython-genutils==0.2.0 + # via traitlets isort==5.9.1 # via -r requirements/dev.in jedi==0.18.0 @@ -141,6 +141,14 @@ pyparsing==2.4.7 # via # -c requirements/prod.txt # packaging +pytest==6.2.4 + # via + # -r requirements/dev.in + # pytest-asyncio + # pytest-cov + # pytest-django + # pytest-factoryboy + # pytest-mock pytest-asyncio==0.15.1 # via -r requirements/dev.in pytest-cov==2.12.1 @@ -151,14 +159,6 @@ pytest-factoryboy==2.1.0 # via -r requirements/dev.in pytest-mock==3.6.1 # via -r requirements/dev.in -pytest==6.2.4 - # via - # -r requirements/dev.in - # pytest-asyncio - # pytest-cov - # pytest-django - # pytest-factoryboy - # pytest-mock python-dateutil==2.8.1 # via # -c requirements/prod.txt diff --git a/requirements/prod.txt b/requirements/prod.txt index de6b3eee59..7d6e040def 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --allow-unsafe requirements/prod.in @@ -39,9 +39,9 @@ bleach==3.3.0 # via # -r requirements/prod.in # sfdo-template-helpers -boto3==1.17.98 +boto3==1.17.100 # via -r requirements/prod.in -botocore==1.20.98 +botocore==1.20.100 # via # boto3 # s3transfer @@ -54,12 +54,12 @@ cffi==1.14.5 # via # cryptography # cumulusci -channels-redis==3.2.0 - # via -r requirements/prod.in channels==3.0.3 # via # -r requirements/prod.in # channels-redis +channels-redis==3.2.0 + # via -r requirements/prod.in chardet==4.0.0 # via # cumulusci @@ -69,10 +69,12 @@ click==7.1.2 # cumulusci # rq # snowfakery -coloredlogs==15.0 +coloredlogs==15.0.1 # via cumulusci constantly==15.1.0 # via twisted +contextvars==2.4 + # via cumulusci croniter==1.0.13 # via # django-rq-scheduler @@ -87,7 +89,7 @@ cryptography==3.4.7 # pyopenssl # service-identity # sfdo-template-helpers -cumulusci==3.37.0 +cumulusci==3.38.0 # via -r requirements/prod.in daphne==3.0.2 # via channels @@ -99,6 +101,23 @@ deprecated==1.2.12 # jwcrypto dj-database-url==0.5.0 # via -r requirements/prod.in +django==3.1.12 + # via + # -r requirements/prod.in + # channels + # django-allauth + # django-binary-database-files + # django-filter + # django-hashid-field + # django-js-reverse + # django-log-request-id + # django-model-utils + # django-redis + # django-rq + # django-rq-scheduler + # django-storages + # djangorestframework + # sfdo-template-helpers django-allauth==0.44.0 # via -r requirements/prod.in django-binary-database-files==1.0.15 @@ -123,38 +142,21 @@ django-parler==2.2 # via -r requirements/prod.in django-redis==5.0.0 # via -r requirements/prod.in -django-rq-scheduler==1.1.3 - # via -r requirements/prod.in django-rq==2.4.1 # via # -r requirements/prod.in # django-rq-scheduler +django-rq-scheduler==1.1.3 + # via -r requirements/prod.in django-storages==1.11.1 # via -r requirements/prod.in -django==3.1.12 - # via - # -r requirements/prod.in - # channels - # django-allauth - # django-binary-database-files - # django-filter - # django-hashid-field - # django-js-reverse - # django-log-request-id - # django-model-utils - # django-redis - # django-rq - # django-rq-scheduler - # django-storages - # djangorestframework - # sfdo-template-helpers djangorestframework==3.12.4 # via # -r requirements/prod.in # sfdo-template-helpers docutils==0.16 # via cumulusci -faker==8.6.0 +faker==8.8.2 # via # cumulusci # snowfakery @@ -178,7 +180,7 @@ hiredis==2.0.0 # via aioredis honcho==1.0.1 # via -r requirements/prod.in -humanfriendly==9.1 +humanfriendly==9.2 # via # coloredlogs # cumulusci @@ -192,6 +194,10 @@ idna==2.10 # hyperlink # requests # twisted +immutables==0.15 + # via + # contextvars + # cumulusci importlib-metadata==4.5.0 # via # cumulusci @@ -206,7 +212,7 @@ jmespath==0.10.0 # via # boto3 # botocore -jwcrypto==0.9 +jwcrypto==0.9.1 # via # cumulusci # github3.py @@ -226,7 +232,7 @@ markupsafe==1.1.1 # jinja2 msgpack==1.0.2 # via channels-redis -newrelic==6.4.2.159 +newrelic==6.4.3.160 # via -r requirements/prod.in oauthlib==3.1.1 # via requests-oauthlib @@ -236,12 +242,12 @@ pillow==8.2.0 # via -r requirements/prod.in psycopg2-binary==2.9.1 # via -r requirements/prod.in -pyasn1-modules==0.2.8 - # via service-identity pyasn1==0.4.8 # via # pyasn1-modules # service-identity +pyasn1-modules==0.2.8 + # via service-identity pycparser==2.20 # via # cffi @@ -284,10 +290,6 @@ redis==3.5.3 # django-redis # django-rq # rq -requests-futures==1.0.0 - # via cumulusci -requests-oauthlib==1.3.0 - # via django-allauth requests==2.25.1 # via # cumulusci @@ -298,11 +300,23 @@ requests==2.25.1 # robotframework-requests # salesforce-bulk # simple-salesforce +requests-futures==1.0.0 + # via cumulusci +requests-oauthlib==1.3.0 + # via django-allauth +robotframework==4.0.3 + # via + # cumulusci + # robotframework-lint + # robotframework-pabot + # robotframework-requests + # robotframework-seleniumlibrary + # robotframework-stacktrace robotframework-lint==1.1 # via cumulusci robotframework-pabot==2.0.0 # via cumulusci -robotframework-pythonlibcore==2.2.1 +robotframework-pythonlibcore==3.0.0 # via # cumulusci # robotframework-seleniumlibrary @@ -314,21 +328,13 @@ robotframework-stacktrace==0.4.0 # via # cumulusci # robotframework-pabot -robotframework==4.0.3 - # via - # cumulusci - # robotframework-lint - # robotframework-pabot - # robotframework-requests - # robotframework-seleniumlibrary - # robotframework-stacktrace -rq-scheduler==0.11.0 - # via django-rq-scheduler rq==1.8.1 # via # -r requirements/prod.in # django-rq # rq-scheduler +rq-scheduler==0.11.0 + # via django-rq-scheduler rst2ansi==0.1.5 # via cumulusci s3transfer==0.4.2 @@ -347,7 +353,7 @@ service-identity==21.1.0 # via # -r requirements/prod.in # twisted -simple-salesforce==1.11.1 +simple-salesforce==1.11.2 # via # cumulusci # salesforce-bulk @@ -364,7 +370,7 @@ six==1.16.0 # service-identity snowfakery==1.12 # via cumulusci -sqlalchemy==1.4.17 +sqlalchemy==1.4.19 # via # cumulusci # snowfakery diff --git a/test/js/components/jobs/progressBar.test.js b/test/js/components/jobs/progressBar.test.js index 9bae956cc3..03db60cfae 100644 --- a/test/js/components/jobs/progressBar.test.js +++ b/test/js/components/jobs/progressBar.test.js @@ -32,6 +32,7 @@ describe('', () => { describe('step progress', () => { beforeEach(() => { jest.useFakeTimers(); + jest.spyOn(window, 'clearInterval'); }); test('shows incremental progress within steps', () => { diff --git a/test/js/components/jobs/shareModal.test.js b/test/js/components/jobs/shareModal.test.js index 283063abd3..9e95615651 100644 --- a/test/js/components/jobs/shareModal.test.js +++ b/test/js/components/jobs/shareModal.test.js @@ -66,6 +66,7 @@ describe('', () => { beforeEach(() => { jest.useFakeTimers(); + jest.spyOn(window, 'setTimeout'); }); describe('with error', () => { diff --git a/test/js/utils/websockets.test.js b/test/js/utils/websockets.test.js index cda5cf5360..c24c40916a 100644 --- a/test/js/utils/websockets.test.js +++ b/test/js/utils/websockets.test.js @@ -239,6 +239,7 @@ describe('createSocket', () => { test('dispatches disconnectSocket action after 5 seconds', () => { jest.useFakeTimers(); + jest.spyOn(window, 'setTimeout'); socketInstance.onopen(); socketInstance.onclose();