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
85f65f5f
Commit
85f65f5f
authored
Jun 28, 2019
by
Paul Slaughter
Committed by
Lukas Eipert
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set logModifiedComponents in jest and karma
Also: - stub MutationObserver in Jest
parent
7d00eea6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
spec/frontend/test_setup.js
spec/frontend/test_setup.js
+13
-0
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+4
-0
No files found.
spec/frontend/test_setup.js
View file @
85f65f5f
...
...
@@ -3,6 +3,7 @@ import * as jqueryMatchers from 'custom-jquery-matchers';
import
$
from
'
jquery
'
;
import
Translate
from
'
~/vue_shared/translate
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
config
as
testUtilsConfig
}
from
'
@vue/test-utils
'
;
import
{
initializeTestTimeout
}
from
'
./helpers/timeout
'
;
import
{
loadHTMLFixture
,
setHTMLFixture
}
from
'
./helpers/fixtures
'
;
...
...
@@ -60,9 +61,21 @@ Object.assign(global, {
preloadFixtures
()
{},
});
Object
.
assign
(
global
,
{
MutationObserver
()
{
return
{
disconnect
()
{},
observe
()
{},
};
},
});
// custom-jquery-matchers was written for an old Jest version, we need to make it compatible
Object
.
entries
(
jqueryMatchers
).
forEach
(([
matcherName
,
matcherFactory
])
=>
{
expect
.
extend
({
[
matcherName
]:
matcherFactory
().
compare
,
});
});
// Tech debt issue TBD
testUtilsConfig
.
logModifiedComponents
=
false
;
spec/javascripts/test_bundle.js
View file @
85f65f5f
...
...
@@ -10,12 +10,16 @@ import VueResource from 'vue-resource';
import
Translate
from
'
~/vue_shared/translate
'
;
import
CheckEE
from
'
~/vue_shared/mixins/is_ee
'
;
import
jasmineDiff
from
'
jasmine-diff
'
;
import
{
config
as
testUtilsConfig
}
from
'
@vue/test-utils
'
;
import
{
getDefaultAdapter
}
from
'
~/lib/utils/axios_utils
'
;
import
{
FIXTURES_PATH
,
TEST_HOST
}
from
'
./test_constants
'
;
import
customMatchers
from
'
./matchers
'
;
// Tech debt issue TBD
testUtilsConfig
.
logModifiedComponents
=
false
;
const
isHeadlessChrome
=
/
\b
HeadlessChrome
\/
/
.
test
(
navigator
.
userAgent
);
Vue
.
config
.
devtools
=
!
isHeadlessChrome
;
Vue
.
config
.
productionTip
=
false
;
...
...
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