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
Jérome Perrin
gitlab-ce
Commits
e5a91870
Commit
e5a91870
authored
Jun 16, 2017
by
Mike Greiling
Committed by
Clement Ho
Jun 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase karma socket timeout
parent
f2505eb6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
36 deletions
+49
-36
config/karma.config.js
config/karma.config.js
+1
-0
spec/javascripts/project_title_spec.js
spec/javascripts/project_title_spec.js
+40
-36
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+8
-0
No files found.
config/karma.config.js
View file @
e5a91870
...
...
@@ -54,6 +54,7 @@ module.exports = function(config) {
subdir
:
'
.
'
,
fixWebpackSourcePaths
:
true
};
karmaConfig
.
browserNoActivityTimeout
=
60000
;
// 60 seconds
}
if
(
process
.
env
.
DEBUG
)
{
...
...
spec/javascripts/project_title_spec.js
View file @
e5a91870
/* eslint-disable space-before-function-paren, no-unused-expressions, no-return-assign, no-param-reassign, no-var, new-cap, wrap-iife, no-unused-vars, quotes, jasmine/no-expect-in-setup-teardown, max-len */
/* global Project */
import
'
select2/select2
'
;
...
...
@@ -7,47 +6,52 @@ import '~/api';
import
'
~/project_select
'
;
import
'
~/project
'
;
(
function
()
{
describe
(
'
Project Title
'
,
function
()
{
describe
(
'
Project Title
'
,
()
=>
{
preloadFixtures
(
'
issues/open-issue.html.raw
'
);
loadJSONFixtures
(
'
projects.json
'
);
beforeEach
(
function
()
{
beforeEach
(()
=>
{
loadFixtures
(
'
issues/open-issue.html.raw
'
);
window
.
gon
=
{};
window
.
gon
.
api_version
=
'
v3
'
;
return
this
.
project
=
new
Project
();
// eslint-disable-next-line no-new
new
Project
();
});
describe
(
'
project list
'
,
function
()
{
var
fakeAjaxResponse
=
function
fakeAjaxResponse
(
req
)
{
var
d
;
expect
(
req
.
url
).
toBe
(
'
/api/v3/projects.json?simple=true
'
);
expect
(
req
.
data
).
toEqual
({
search
:
''
,
order_by
:
'
last_activity_at
'
,
per_page
:
20
,
membership
:
true
});
d
=
$
.
Deferred
();
d
.
resolve
(
this
.
projects_data
);
return
d
.
promise
();
};
beforeEach
((
function
(
_this
)
{
return
function
()
{
_this
.
projects_data
=
getJSONFixture
(
'
projects.json
'
);
return
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
(
fakeAjaxResponse
.
bind
(
_this
));
};
})(
this
));
it
(
'
toggles dropdown
'
,
function
()
{
var
menu
=
$
(
'
.js-dropdown-menu-projects
'
);
describe
(
'
project list
'
,
()
=>
{
let
reqUrl
;
let
reqData
;
beforeEach
(()
=>
{
const
fakeResponseData
=
getJSONFixture
(
'
projects.json
'
);
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
req
)
=>
{
const
def
=
$
.
Deferred
();
reqUrl
=
req
.
url
;
reqData
=
req
.
data
;
def
.
resolve
(
fakeResponseData
);
return
def
.
promise
();
});
});
it
(
'
toggles dropdown
'
,
()
=>
{
const
$menu
=
$
(
'
.js-dropdown-menu-projects
'
);
$
(
'
.js-projects-dropdown-toggle
'
).
click
();
expect
(
menu
).
toHaveClass
(
'
open
'
);
menu
.
find
(
'
.dropdown-menu-close-icon
'
).
click
();
expect
(
menu
).
not
.
toHaveClass
(
'
open
'
);
expect
(
$menu
).
toHaveClass
(
'
open
'
);
expect
(
reqUrl
).
toBe
(
'
/api/v3/projects.json?simple=true
'
);
expect
(
reqData
).
toEqual
({
search
:
''
,
order_by
:
'
last_activity_at
'
,
per_page
:
20
,
membership
:
true
,
});
$menu
.
find
(
'
.dropdown-menu-close-icon
'
).
click
();
expect
(
$menu
).
not
.
toHaveClass
(
'
open
'
);
});
});
afterEach
(()
=>
{
window
.
gon
=
{};
});
});
}).
call
(
window
);
});
spec/javascripts/test_bundle.js
View file @
e5a91870
...
...
@@ -16,6 +16,14 @@ window.gl = window.gl || {};
window
.
gl
.
TEST_HOST
=
'
http://test.host
'
;
window
.
gon
=
window
.
gon
||
{};
// HACK: Chrome 59 disconnects if there are too many synchronous tests in a row
// because it appears to lock up the thread that communicates to Karma's socket
// This async beforeEach gets called on every spec and releases the JS thread long
// enough for the socket to continue to communicate.
// The downside is that it creates a minor performance penalty in the time it takes
// to run our unit tests.
beforeEach
(
done
=>
done
());
// eslint-disable-line jasmine/no-global-setup
// render all of our tests
const
testsContext
=
require
.
context
(
'
.
'
,
true
,
/_spec$/
);
testsContext
.
keys
().
forEach
(
function
(
path
)
{
...
...
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