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
Boxiang Sun
gitlab-ce
Commits
1941b442
Commit
1941b442
authored
Apr 10, 2018
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prettier
parent
35d754f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+10
-10
No files found.
spec/javascripts/test_bundle.js
View file @
1941b442
...
@@ -23,7 +23,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
...
@@ -23,7 +23,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
};
};
let
hasVueErrors
=
false
;
let
hasVueErrors
=
false
;
Vue
.
config
.
errorHandler
=
function
(
err
)
{
Vue
.
config
.
errorHandler
=
function
(
err
)
{
hasVueErrors
=
true
;
hasVueErrors
=
true
;
fail
(
err
);
fail
(
err
);
};
};
...
@@ -48,7 +48,7 @@ window.gon.test_env = true;
...
@@ -48,7 +48,7 @@ window.gon.test_env = true;
let
hasUnhandledPromiseRejections
=
false
;
let
hasUnhandledPromiseRejections
=
false
;
window
.
addEventListener
(
'
unhandledrejection
'
,
(
event
)
=>
{
window
.
addEventListener
(
'
unhandledrejection
'
,
event
=>
{
hasUnhandledPromiseRejections
=
true
;
hasUnhandledPromiseRejections
=
true
;
console
.
error
(
'
Unhandled promise rejection:
'
);
console
.
error
(
'
Unhandled promise rejection:
'
);
console
.
error
(
event
.
reason
.
stack
||
event
.
reason
);
console
.
error
(
event
.
reason
.
stack
||
event
.
reason
);
...
@@ -69,6 +69,8 @@ beforeEach(() => {
...
@@ -69,6 +69,8 @@ beforeEach(() => {
Vue
.
http
.
interceptors
=
builtinVueHttpInterceptors
.
slice
();
Vue
.
http
.
interceptors
=
builtinVueHttpInterceptors
.
slice
();
});
});
const
axiosDefaultAdapter
=
getDefaultAdapter
();
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef
let
testFile
=
TEST_FILES
;
let
testFile
=
TEST_FILES
;
if
(
testFile
instanceof
Array
&&
testFile
.
length
>
0
)
{
if
(
testFile
instanceof
Array
&&
testFile
.
length
>
0
)
{
...
@@ -79,8 +81,6 @@ if (testFile instanceof Array && testFile.length > 0) {
...
@@ -79,8 +81,6 @@ if (testFile instanceof Array && testFile.length > 0) {
testFile
=
[];
testFile
=
[];
}
}
const
axiosDefaultAdapter
=
getDefaultAdapter
();
// render all of our tests
// render all of our tests
const
testsContext
=
require
.
context
(
'
.
'
,
true
,
/_spec$/
);
const
testsContext
=
require
.
context
(
'
.
'
,
true
,
/_spec$/
);
testsContext
.
keys
().
forEach
(
function
(
path
)
{
testsContext
.
keys
().
forEach
(
function
(
path
)
{
...
@@ -90,8 +90,8 @@ testsContext.keys().forEach(function(path) {
...
@@ -90,8 +90,8 @@ testsContext.keys().forEach(function(path) {
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
'
[ERROR] Unable to load spec:
'
,
path
);
console
.
error
(
'
[ERROR] Unable to load spec:
'
,
path
);
describe
(
'
Test bundle
'
,
function
()
{
describe
(
'
Test bundle
'
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
expect
(
err
).
toBeNull
();
expect
(
err
).
toBeNull
();
});
});
});
});
...
@@ -99,7 +99,7 @@ testsContext.keys().forEach(function(path) {
...
@@ -99,7 +99,7 @@ testsContext.keys().forEach(function(path) {
});
});
describe
(
'
test errors
'
,
()
=>
{
describe
(
'
test errors
'
,
()
=>
{
beforeAll
(
(
done
)
=>
{
beforeAll
(
done
=>
{
if
(
hasUnhandledPromiseRejections
||
hasVueWarnings
||
hasVueErrors
)
{
if
(
hasUnhandledPromiseRejections
||
hasVueWarnings
||
hasVueErrors
)
{
setTimeout
(
done
,
1000
);
setTimeout
(
done
,
1000
);
}
else
{
}
else
{
...
@@ -163,18 +163,18 @@ if (process.env.BABEL_ENV === 'coverage') {
...
@@ -163,18 +163,18 @@ if (process.env.BABEL_ENV === 'coverage') {
'
./issue_show/index.js
'
,
'
./issue_show/index.js
'
,
];
];
describe
(
'
Uncovered files
'
,
function
()
{
describe
(
'
Uncovered files
'
,
function
()
{
const
sourceFiles
=
require
.
context
(
'
~
'
,
true
,
/
\.
js$/
);
const
sourceFiles
=
require
.
context
(
'
~
'
,
true
,
/
\.
js$/
);
$
.
holdReady
(
true
);
$
.
holdReady
(
true
);
sourceFiles
.
keys
().
forEach
(
function
(
path
)
{
sourceFiles
.
keys
().
forEach
(
function
(
path
)
{
// ignore if there is a matching spec file
// ignore if there is a matching spec file
if
(
testsContext
.
keys
().
indexOf
(
`
${
path
.
replace
(
/
\.
js$/
,
''
)}
_spec`
)
>
-
1
)
{
if
(
testsContext
.
keys
().
indexOf
(
`
${
path
.
replace
(
/
\.
js$/
,
''
)}
_spec`
)
>
-
1
)
{
return
;
return
;
}
}
it
(
`includes '
${
path
}
'`
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
try
{
try
{
sourceFiles
(
path
);
sourceFiles
(
path
);
}
catch
(
err
)
{
}
catch
(
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