Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d37e8b7b
Commit
d37e8b7b
authored
Feb 11, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix jest time reporting by resetting environment
parent
cacdc619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
spec/frontend/environment.js
spec/frontend/environment.js
+7
-1
No files found.
spec/frontend/environment.js
View file @
d37e8b7b
...
@@ -4,7 +4,10 @@ const path = require('path');
...
@@ -4,7 +4,10 @@ const path = require('path');
const
{
ErrorWithStack
}
=
require
(
'
jest-util
'
);
const
{
ErrorWithStack
}
=
require
(
'
jest-util
'
);
const
JSDOMEnvironment
=
require
(
'
jest-environment-jsdom
'
);
const
JSDOMEnvironment
=
require
(
'
jest-environment-jsdom
'
);
const
{
TEST_HOST
}
=
require
(
'
./__helpers__/test_constants
'
);
const
{
TEST_HOST
}
=
require
(
'
./__helpers__/test_constants
'
);
const
{
setGlobalDateToFakeDate
}
=
require
(
'
./__helpers__/fake_date/fake_date
'
);
const
{
setGlobalDateToFakeDate
,
setGlobalDateToRealDate
,
}
=
require
(
'
./__helpers__/fake_date/fake_date
'
);
const
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
../..
'
);
const
ROOT_PATH
=
path
.
resolve
(
__dirname
,
'
../..
'
);
...
@@ -74,6 +77,9 @@ class CustomEnvironment extends JSDOMEnvironment {
...
@@ -74,6 +77,9 @@ class CustomEnvironment extends JSDOMEnvironment {
}
}
async
teardown
()
{
async
teardown
()
{
// Reset `Date` so that Jest can report timing accurately *roll eyes*...
setGlobalDateToRealDate
();
await
new
Promise
(
setImmediate
);
await
new
Promise
(
setImmediate
);
if
(
this
.
rejectedPromises
.
length
>
0
)
{
if
(
this
.
rejectedPromises
.
length
>
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment