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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
89142f98
Commit
89142f98
authored
Jul 17, 2019
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move frontend fixtures to tmp/tests
parent
faa17d52
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
config/karma.config.js
config/karma.config.js
+8
-2
spec/frontend/environment.js
spec/frontend/environment.js
+2
-1
spec/frontend/helpers/fixtures.js
spec/frontend/helpers/fixtures.js
+4
-1
spec/javascripts/test_constants.js
spec/javascripts/test_constants.js
+1
-3
spec/support/helpers/javascript_fixtures_helpers.rb
spec/support/helpers/javascript_fixtures_helpers.rb
+1
-1
No files found.
config/karma.config.js
View file @
89142f98
...
...
@@ -107,7 +107,8 @@ if (specFilters.length) {
module
.
exports
=
function
(
config
)
{
process
.
env
.
TZ
=
'
Etc/UTC
'
;
const
fixturesPath
=
`
${
IS_EE
?
'
ee/
'
:
''
}
spec/javascripts/fixtures`
;
const
fixturesPath
=
`tmp/tests/frontend/fixtures
${
IS_EE
?
'
-ee
'
:
''
}
`
;
const
staticFixturesPath
=
'
spec/javascripts/fixtures/static
'
;
const
karmaConfig
=
{
basePath
:
ROOT_PATH
,
...
...
@@ -131,8 +132,13 @@ module.exports = function(config) {
frameworks
:
[
'
jasmine
'
],
files
:
[
{
pattern
:
'
spec/javascripts/test_bundle.js
'
,
watched
:
false
},
{
pattern
:
`
${
fixturesPath
}
/**/*@(.json|.html|.png|.bmpr|.pdf)`
,
included
:
false
},
{
pattern
:
`
${
fixturesPath
}
/**/*`
,
included
:
false
},
{
pattern
:
`
${
staticFixturesPath
}
/**/*`
,
included
:
false
},
],
proxies
:
{
'
/fixtures/
'
:
`/base/
${
fixturesPath
}
/`
,
'
/fixtures/static/
'
:
`/base/
${
staticFixturesPath
}
/`
,
},
preprocessors
:
{
'
spec/javascripts/**/*.js
'
:
[
'
webpack
'
,
'
sourcemap
'
],
'
ee/spec/javascripts/**/*.js
'
:
[
'
webpack
'
,
'
sourcemap
'
],
...
...
spec/frontend/environment.js
View file @
89142f98
...
...
@@ -38,7 +38,8 @@ class CustomEnvironment extends JSDOMEnvironment {
this
.
rejectedPromises
.
push
(
error
);
};
this
.
global
.
fixturesBasePath
=
`
${
ROOT_PATH
}
/
${
IS_EE
?
'
ee/
'
:
''
}
spec/javascripts/fixtures`
;
this
.
global
.
fixturesBasePath
=
`
${
ROOT_PATH
}
/tmp/tests/frontend/fixtures
${
IS_EE
?
'
-ee
'
:
''
}
`
;
this
.
global
.
staticFixturesBasePath
=
`
${
ROOT_PATH
}
/spec/javascripts/fixtures`
;
// Not yet supported by JSDOM: https://github.com/jsdom/jsdom/issues/317
this
.
global
.
document
.
createRange
=
()
=>
({
...
...
spec/frontend/helpers/fixtures.js
View file @
89142f98
...
...
@@ -4,7 +4,10 @@ import path from 'path';
import
{
ErrorWithStack
}
from
'
jest-util
'
;
export
function
getFixture
(
relativePath
)
{
const
absolutePath
=
path
.
join
(
global
.
fixturesBasePath
,
relativePath
);
const
basePath
=
relativePath
.
startsWith
(
'
static/
'
)
?
global
.
staticFixturesBasePath
:
global
.
fixturesBasePath
;
const
absolutePath
=
path
.
join
(
basePath
,
relativePath
);
if
(
!
fs
.
existsSync
(
absolutePath
))
{
throw
new
ErrorWithStack
(
`Fixture file
${
relativePath
}
does not exist.
...
...
spec/javascripts/test_constants.js
View file @
89142f98
export
const
FIXTURES_PATH
=
`/base/
${
process
.
env
.
IS_GITLAB_EE
?
'
ee/
'
:
''
}
spec/javascripts/fixtures`
;
export
const
FIXTURES_PATH
=
`/fixtures`
;
export
const
TEST_HOST
=
'
http://test.host
'
;
export
const
DUMMY_IMAGE_URL
=
`
${
FIXTURES_PATH
}
/static/images/one_white_pixel.png`
;
...
...
spec/support/helpers/javascript_fixtures_helpers.rb
View file @
89142f98
...
...
@@ -19,7 +19,7 @@ module JavaScriptFixturesHelpers
end
def
fixture_root_path
(
Gitlab
.
ee?
?
'ee/'
:
''
)
+
'spec/javascripts/fixtures'
'tmp/tests/frontend/fixtures'
+
(
Gitlab
.
ee?
?
'-ee'
:
''
)
end
# Public: Removes all fixture files from given directory
...
...
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