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
fac4d54f
Commit
fac4d54f
authored
Sep 06, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail long running tests
parent
ca3603de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
jest.config.js
jest.config.js
+1
-0
spec/frontend/test_setup.js
spec/frontend/test_setup.js
+16
-0
No files found.
jest.config.js
View file @
fac4d54f
...
@@ -24,4 +24,5 @@ module.exports = {
...
@@ -24,4 +24,5 @@ module.exports = {
cacheDirectory
:
'
<rootDir>/tmp/cache/jest
'
,
cacheDirectory
:
'
<rootDir>/tmp/cache/jest
'
,
modulePathIgnorePatterns
:
[
'
<rootDir>/.yarn-cache/
'
],
modulePathIgnorePatterns
:
[
'
<rootDir>/.yarn-cache/
'
],
reporters
,
reporters
,
setupTestFrameworkScriptFile
:
'
<rootDir>/spec/frontend/test_setup.js
'
,
};
};
spec/frontend/test_setup.js
0 → 100644
View file @
fac4d54f
const
testTimeoutInMs
=
0
;
jest
.
setTimeout
(
testTimeoutInMs
);
let
testStartTime
;
// https://github.com/facebook/jest/issues/6947
beforeEach
(()
=>
{
testStartTime
=
Date
.
now
();
});
afterEach
(()
=>
{
const
elapsedTimeInMs
=
Date
.
now
()
-
testStartTime
;
if
(
elapsedTimeInMs
>
testTimeoutInMs
)
{
throw
new
Error
(
`Test took too long (
${
elapsedTimeInMs
}
ms >
${
testTimeoutInMs
}
ms)!`
);
}
});
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