Skip to content

Commit

Permalink
📦 fix jest tests that use the new @sinonjs/fake-timers (jestjs/jest#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Glick committed Jun 24, 2021
1 parent 6a6f7d1 commit 4d0ac37
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 63 deletions.
28 changes: 14 additions & 14 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
104 changes: 55 additions & 49 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -192,6 +194,10 @@ idna==2.10
# hyperlink
# requests
# twisted
immutables==0.15
# via
# contextvars
# cumulusci
importlib-metadata==4.5.0
# via
# cumulusci
Expand All @@ -206,7 +212,7 @@ jmespath==0.10.0
# via
# boto3
# botocore
jwcrypto==0.9
jwcrypto==0.9.1
# via
# cumulusci
# github3.py
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/js/components/jobs/progressBar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('<ProgressBar />', () => {
describe('step progress', () => {
beforeEach(() => {
jest.useFakeTimers();
jest.spyOn(window, 'clearInterval');
});

test('shows incremental progress within steps', () => {
Expand Down
1 change: 1 addition & 0 deletions test/js/components/jobs/shareModal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ describe('<ShareModal />', () => {

beforeEach(() => {
jest.useFakeTimers();
jest.spyOn(window, 'setTimeout');
});

describe('with error', () => {
Expand Down
1 change: 1 addition & 0 deletions test/js/utils/websockets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ describe('createSocket', () => {

test('dispatches disconnectSocket action after 5 seconds', () => {
jest.useFakeTimers();
jest.spyOn(window, 'setTimeout');
socketInstance.onopen();
socketInstance.onclose();

Expand Down

0 comments on commit 4d0ac37

Please sign in to comment.