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
fbac16b2
Commit
fbac16b2
authored
Apr 25, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load EE fixtures from ee/ directory in Jest
(cherry picked from commit 2917a28a885922a03f2026ddbb2680bc2b6e5d50)
parent
6e3165f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
spec/frontend/environment.js
spec/frontend/environment.js
+6
-1
spec/frontend/helpers/fixtures.js
spec/frontend/helpers/fixtures.js
+1
-3
No files found.
spec/frontend/environment.js
View file @
fbac16b2
...
@@ -24,8 +24,9 @@ class CustomEnvironment extends JSDOMEnvironment {
...
@@ -24,8 +24,9 @@ class CustomEnvironment extends JSDOMEnvironment {
});
});
const
{
testEnvironmentOptions
}
=
config
;
const
{
testEnvironmentOptions
}
=
config
;
const
{
IS_EE
}
=
testEnvironmentOptions
;
this
.
global
.
gon
=
{
this
.
global
.
gon
=
{
ee
:
testEnvironmentOptions
.
IS_EE
,
ee
:
IS_EE
,
};
};
this
.
rejectedPromises
=
[];
this
.
rejectedPromises
=
[];
...
@@ -33,6 +34,10 @@ class CustomEnvironment extends JSDOMEnvironment {
...
@@ -33,6 +34,10 @@ class CustomEnvironment extends JSDOMEnvironment {
this
.
global
.
promiseRejectionHandler
=
error
=>
{
this
.
global
.
promiseRejectionHandler
=
error
=>
{
this
.
rejectedPromises
.
push
(
error
);
this
.
rejectedPromises
.
push
(
error
);
};
};
this
.
global
.
fixturesBasePath
=
`
${
process
.
cwd
()}
/
${
IS_EE
?
'
ee/
'
:
''
}
spec/javascripts/fixtures`
;
}
}
async
teardown
()
{
async
teardown
()
{
...
...
spec/frontend/helpers/fixtures.js
View file @
fbac16b2
...
@@ -3,10 +3,8 @@ import path from 'path';
...
@@ -3,10 +3,8 @@ import path from 'path';
import
{
ErrorWithStack
}
from
'
jest-util
'
;
import
{
ErrorWithStack
}
from
'
jest-util
'
;
const
fixturesBasePath
=
path
.
join
(
process
.
cwd
(),
'
spec
'
,
'
javascripts
'
,
'
fixtures
'
);
export
function
getFixture
(
relativePath
)
{
export
function
getFixture
(
relativePath
)
{
const
absolutePath
=
path
.
join
(
fixturesBasePath
,
relativePath
);
const
absolutePath
=
path
.
join
(
global
.
fixturesBasePath
,
relativePath
);
if
(
!
fs
.
existsSync
(
absolutePath
))
{
if
(
!
fs
.
existsSync
(
absolutePath
))
{
throw
new
ErrorWithStack
(
throw
new
ErrorWithStack
(
`Fixture file
${
relativePath
}
does not exist.
`Fixture file
${
relativePath
}
does not exist.
...
...
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