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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
0c6e4b4c
Commit
0c6e4b4c
authored
Mar 13, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve differences in Karma test bundle between CE and EE
parent
1715622c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
26 deletions
+41
-26
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+41
-26
No files found.
spec/javascripts/test_bundle.js
View file @
0c6e4b4c
...
@@ -122,19 +122,25 @@ afterEach(() => {
...
@@ -122,19 +122,25 @@ afterEach(() => {
const
axiosDefaultAdapter
=
getDefaultAdapter
();
const
axiosDefaultAdapter
=
getDefaultAdapter
();
// render all of our tests
// render all of our tests
const
testsContext
=
require
.
context
(
'
.
'
,
true
,
/_spec$/
);
const
testContexts
=
[
testsContext
.
keys
().
forEach
(
function
(
path
)
{
require
.
context
(
'
spec
'
,
true
,
/_spec$/
),
try
{
require
.
context
(
'
ee_spec
'
,
true
,
/_spec$/
),
testsContext
(
path
);
];
}
catch
(
err
)
{
console
.
log
(
err
);
testContexts
.
forEach
(
context
=>
{
console
.
error
(
'
[GL SPEC RUNNER ERROR] Unable to load spec:
'
,
path
);
context
.
keys
().
forEach
(
path
=>
{
describe
(
'
Test bundle
'
,
function
()
{
try
{
it
(
`includes '
${
path
}
'`
,
function
()
{
context
(
path
);
expect
(
err
).
toBeNull
();
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
error
(
'
[GL SPEC RUNNER ERROR] Unable to load spec:
'
,
path
);
describe
(
'
Test bundle
'
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
expect
(
err
).
toBeNull
();
});
});
});
}
);
}
}
}
);
});
});
describe
(
'
test errors
'
,
()
=>
{
describe
(
'
test errors
'
,
()
=>
{
...
@@ -204,24 +210,33 @@ if (process.env.BABEL_ENV === 'coverage') {
...
@@ -204,24 +210,33 @@ if (process.env.BABEL_ENV === 'coverage') {
];
];
describe
(
'
Uncovered files
'
,
function
()
{
describe
(
'
Uncovered files
'
,
function
()
{
const
sourceFiles
=
require
.
context
(
'
~
'
,
true
,
/
\.(
js|vue
)
$/
);
const
sourceFilesContexts
=
[
require
.
context
(
'
~
'
,
true
,
/
\.(
js|vue
)
$/
),
require
.
context
(
'
ee
'
,
true
,
/
\.(
js|vue
)
$/
),
];
const
allTestFiles
=
testContexts
.
reduce
(
(
accumulator
,
context
)
=>
accumulator
.
concat
(
context
.
keys
()),
[],
);
$
.
holdReady
(
true
);
$
.
holdReady
(
true
);
sourceFiles
.
keys
().
forEach
(
function
(
path
)
{
sourceFilesContexts
.
forEach
(
context
=>
{
// ignore if there is a matching spec file
context
.
keys
().
forEach
(
path
=>
{
if
(
testsContext
.
keys
().
indexOf
(
`
${
path
.
replace
(
/
\.(
js|vue
)
$/
,
''
)}
_spec`
)
>
-
1
)
{
// ignore if there is a matching spec file
return
;
if
(
allTestFiles
.
indexOf
(
`
${
path
.
replace
(
/
\.(
js|vue
)
$/
,
''
)}
_spec`
)
>
-
1
)
{
}
return
;
it
(
`includes '
${
path
}
'`
,
function
()
{
try
{
sourceFiles
(
path
);
}
catch
(
err
)
{
if
(
troubleMakers
.
indexOf
(
path
)
===
-
1
)
{
expect
(
err
).
toBeNull
();
}
}
}
it
(
`includes '
${
path
}
'`
,
function
()
{
try
{
context
(
path
);
}
catch
(
err
)
{
if
(
troubleMakers
.
indexOf
(
path
)
===
-
1
)
{
expect
(
err
).
toBeNull
();
}
}
});
});
});
});
});
});
});
...
...
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