diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-21 15:38:03 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-21 15:38:03 +0300 |
commit | ef73fe300c047d659c5bb665f200531efa95ac0b (patch) | |
tree | 15ba8daa1509d6a934567275d99ec10054e6fef4 /spec/javascripts/raven/raven_config_spec.js | |
parent | a9a603e707b2e56416a96f1db041f264d79166cb (diff) |
Use Gitlab::REVISION over reading HEAD sha from git
Diffstat (limited to 'spec/javascripts/raven/raven_config_spec.js')
-rw-r--r-- | spec/javascripts/raven/raven_config_spec.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/spec/javascripts/raven/raven_config_spec.js b/spec/javascripts/raven/raven_config_spec.js index d2f4f9ac6fb..b31a7c28ebe 100644 --- a/spec/javascripts/raven/raven_config_spec.js +++ b/spec/javascripts/raven/raven_config_spec.js @@ -25,7 +25,9 @@ describe('RavenConfig', () => { }); describe('init', () => { - const options = {}; + const options = { + currentUserId: 1, + }; beforeEach(() => { spyOn(RavenConfig, 'configure'); @@ -54,34 +56,28 @@ describe('RavenConfig', () => { it('should not call setUser if there is no current user ID', () => { RavenConfig.setUser.calls.reset(); - RavenConfig.init({ - sentryDsn: '//sentryDsn', - ravenAssetUrl: '//ravenAssetUrl', - currentUserId: undefined, - whitelistUrls: ['//gitlabUrl'], - isProduction: true, - }); + options.currentUserId = undefined; + + RavenConfig.init(options); expect(RavenConfig.setUser).not.toHaveBeenCalled(); }); }); describe('configure', () => { - let options; let raven; let ravenConfig; + const options = { + sentryDsn: '//sentryDsn', + whitelistUrls: ['//gitlabUrl'], + isProduction: true, + release: 'revision', + tags: { + revision: 'revision', + }, + }; beforeEach(() => { - options = { - sentryDsn: '//sentryDsn', - whitelistUrls: ['//gitlabUrl'], - isProduction: true, - release: 'release', - tags: { - HEAD_COMMIT_SHA: 'headCommitSha', - }, - }; - ravenConfig = jasmine.createSpyObj('ravenConfig', ['shouldSendSample']); raven = jasmine.createSpyObj('raven', ['install']); @@ -116,6 +112,8 @@ describe('RavenConfig', () => { RavenConfig.configure.call(ravenConfig); expect(Raven.config).toHaveBeenCalledWith(options.sentryDsn, { + release: options.release, + tags: options.tags, whitelistUrls: options.whitelistUrls, environment: 'development', ignoreErrors: ravenConfig.IGNORE_ERRORS, |