Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
bf1f5780
Commit
bf1f5780
authored
Jan 25, 2023
by
Justin Coyne
Committed by
Chris Beer
Jan 25, 2023
Browse files
Options
Downloads
Patches
Plain Diff
enableFetchMock
parent
9c0fce27
No related branches found
No related tags found
1 merge request
!12
Update from upstream
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
setupJest.js
+2
-3
2 additions, 3 deletions
setupJest.js
with
2 additions
and
3 deletions
setupJest.js
+
2
−
3
View file @
bf1f5780
// Setup Jest to mock fetch
// Setup Jest to mock fetch
import
{
JSDOM
}
from
'
jsdom
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
{
JSDOM
}
from
'
jsdom
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
fetch
from
'
jest-fetch-mock
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
fetch
Mock
from
'
jest-fetch-mock
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
Enzyme
from
'
enzyme
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
Enzyme
from
'
enzyme
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
Adapter
from
'
enzyme-adapter-react-16
'
;
// eslint-disable-line import/no-extraneous-dependencies
import
Adapter
from
'
enzyme-adapter-react-16
'
;
// eslint-disable-line import/no-extraneous-dependencies
...
@@ -11,8 +11,7 @@ const { window } = jsdom;
...
@@ -11,8 +11,7 @@ const { window } = jsdom;
jest
.
setTimeout
(
10000
);
jest
.
setTimeout
(
10000
);
window
.
HTMLCanvasElement
.
prototype
.
getContext
=
()
=>
{};
window
.
HTMLCanvasElement
.
prototype
.
getContext
=
()
=>
{};
jest
.
setMock
(
'
isomorphic-unfetch
'
,
fetch
);
fetchMock
.
enableMocks
();
require
(
'
jest-fetch-mock
'
).
enableMocks
();
// eslint-disable-line import/no-extraneous-dependencies
global
.
window
=
window
;
global
.
window
=
window
;
global
.
navigator
=
{
global
.
navigator
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment