diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-18 16:00:12 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-18 16:00:12 -0500 |
commit | 3695c6bc6d95e650600441ccfa382c682ace5558 (patch) | |
tree | 43142165a5b260e80a8f9c1349116a5f2f7ba38b /spec/javascripts/repo | |
parent | 63812b2fb2dc53f94ab452761553e8cc5f046f2c (diff) | |
download | gitlab-ce-3695c6bc6d95e650600441ccfa382c682ace5558.tar.gz |
fix monaco loader test to not break with statically analyzed import statements
Diffstat (limited to 'spec/javascripts/repo')
-rw-r--r-- | spec/javascripts/repo/monaco_loader_spec.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/spec/javascripts/repo/monaco_loader_spec.js b/spec/javascripts/repo/monaco_loader_spec.js index be6e779c50f..1c6d70f9271 100644 --- a/spec/javascripts/repo/monaco_loader_spec.js +++ b/spec/javascripts/repo/monaco_loader_spec.js @@ -1,17 +1,15 @@ /* 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); }); }); |