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
c635e801
Commit
c635e801
authored
Aug 22, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update-monaco-loader-test' into 'master'
Fix monaco loader test See merge request !13682
parents
27bdc4bb
a7eb806e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
13 deletions
+8
-13
.eslintrc
.eslintrc
+1
-0
app/assets/javascripts/repo/monaco_loader.js
app/assets/javascripts/repo/monaco_loader.js
+2
-4
app/assets/javascripts/webpack.js
app/assets/javascripts/webpack.js
+1
-1
spec/javascripts/repo/monaco_loader_spec.js
spec/javascripts/repo/monaco_loader_spec.js
+4
-8
No files found.
.eslintrc
View file @
c635e801
...
...
@@ -6,6 +6,7 @@
},
"extends": "airbnb-base",
"globals": {
"__webpack_public_path__": true,
"_": false,
"gl": false,
"gon": false,
...
...
app/assets/javascripts/repo/monaco_loader.js
View file @
c635e801
/* eslint-disable no-underscore-dangle, camelcase */
/* global __webpack_public_path__ */
import
monacoContext
from
'
monaco-editor/dev/vs/loader
'
;
monacoContext
.
require
.
config
({
paths
:
{
vs
:
`
${
__webpack_public_path__
}
monaco-editor/vs`
,
vs
:
`
${
__webpack_public_path__
}
monaco-editor/vs`
,
// eslint-disable-line camelcase
},
});
// eslint-disable-next-line no-underscore-dangle
window
.
__monaco_context__
=
monacoContext
;
export
default
monacoContext
.
require
;
app/assets/javascripts/webpack.js
View file @
c635e801
...
...
@@ -5,5 +5,5 @@
*/
if
(
gon
&&
gon
.
webpack_public_path
)
{
__webpack_public_path__
=
gon
.
webpack_public_path
;
// eslint-disable-line
__webpack_public_path__
=
gon
.
webpack_public_path
;
// eslint-disable-line
camelcase
}
spec/javascripts/repo/monaco_loader_spec.js
View file @
c635e801
/* global __webpack_public_path__ */
import
monacoContext
from
'
monaco-editor/dev/vs/loader
'
;
import
monacoLoader
from
'
~/repo/monaco_loader
'
;
describe
(
'
MonacoLoader
'
,
()
=>
{
it
(
'
calls require.config and exports require
'
,
()
=>
{
spyOn
(
monacoContext
.
require
,
'
config
'
);
const
monacoLoader
=
require
(
'
~/repo/monaco_loader
'
);
// eslint-disable-line global-require
expect
(
monacoContext
.
require
.
config
).
toHaveBeenCalledWith
({
expect
(
monacoContext
.
require
.
getConfig
()).
toEqual
(
jasmine
.
objectContaining
({
paths
:
{
vs
:
`
${
__webpack_public_path__
}
monaco-editor/vs`
,
// eslint-disable-line camelcase
},
});
expect
(
monacoLoader
.
default
).
toBe
(
monacoContext
.
require
);
})
)
;
expect
(
monacoLoader
).
toBe
(
monacoContext
.
require
);
});
});
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