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
Tatuya Kamada
gitlab-ce
Commits
a8078d62
Commit
a8078d62
authored
Jan 06, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate all tests into a single webpack bundle
parent
b0341c14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
config/karma.config.js
config/karma.config.js
+1
-2
spec/javascripts/.eslintrc
spec/javascripts/.eslintrc
+3
-2
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+15
-4
No files found.
config/karma.config.js
View file @
a8078d62
...
...
@@ -8,8 +8,7 @@ module.exports = function(config) {
basePath
:
ROOT_PATH
,
frameworks
:
[
'
jasmine
'
],
files
:
[
'
spec/javascripts/spec_helper.js
'
,
'
spec/javascripts/**/*_spec.js?(.es6)
'
,
'
spec/javascripts/test_bundle.js
'
,
{
pattern
:
'
spec/javascripts/fixtures/**/*@(.json|.html|.html.raw)
'
,
included
:
false
},
],
preprocessors
:
{
...
...
spec/javascripts/.eslintrc
View file @
a8078d62
...
...
@@ -22,7 +22,8 @@
},
"plugins": ["jasmine"],
"rules": {
"prefer-arrow-callback": 0,
"func-names": 0
"func-names": 0,
"no-console": 0,
"prefer-arrow-callback": 0
}
}
spec/javascripts/
spec_helper
.js
→
spec/javascripts/
test_bundle
.js
View file @
a8078d62
// enable test fixtures
require
(
'
jasmine-jquery
'
);
jasmine
.
getFixtures
().
fixturesPath
=
'
base/spec/javascripts/fixtures
'
;
jasmine
.
getJSONFixtures
().
fixturesPath
=
'
base/spec/javascripts/fixtures
'
;
// include common libraries
window
.
$
=
window
.
jQuery
=
require
(
'
jquery
'
);
window
.
_
=
require
(
'
underscore
'
);
...
...
@@ -21,11 +25,18 @@ require('bootstrap/js/transition');
require
(
'
bootstrap/js/tooltip
'
);
require
(
'
bootstrap/js/popover
'
);
// configure jasmine
jasmine
.
getFixtures
().
fixturesPath
=
'
base/spec/javascripts/fixtures
'
;
jasmine
.
getJSONFixtures
().
fixturesPath
=
'
base/spec/javascripts/fixtures
'
;
// stub expected globals
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
TEST_HOST
=
'
http://test.host
'
;
window
.
gon
=
window
.
gon
||
{};
// render all of our tests
const
testsContext
=
require
.
context
(
'
.
'
,
true
,
/_spec$/
);
testsContext
.
keys
().
forEach
(
function
(
path
)
{
try
{
testsContext
(
path
);
}
catch
(
err
)
{
console
.
error
(
'
[ERROR] WITH SPEC FILE:
'
,
path
);
console
.
error
(
err
);
}
});
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