Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember integration breaks the ember test environment #1708

Closed
oskarrough opened this issue Oct 30, 2018 · 1 comment
Closed

Ember integration breaks the ember test environment #1708

oskarrough opened this issue Oct 30, 2018 · 1 comment

Comments

@oskarrough
Copy link

Package + Version

  • @sentry/browser: 4.1.1
  • ember-cli: 3.4.5

Description

When the Sentry.Ember integration is added to a fresh project the tests will fail with:

ember-qunit: Ember.onerror validation: Ember.onerror is functioning properly
    ✘ Ember.onerror handler with invalid testing behavior detected. An Ember.onerror handler _must_ r
ethrow exceptions when `Ember.testing` is `true` or the test suite is unreliable. See https://git.io/
vbine for more details.

I followed https://docs.sentry.io/platforms/javascript/ember/ and did

// app/app.js
import * as Sentry from '@sentry/browser'

if (!ENV.environment === 'test') {
	Sentry.init({
		dsn: 'abc123',
		integrations: [new Sentry.Integrations.Ember()]
	})
}

To fix it, I added a conditional to not load sentry while testing.

import ENV from 'my-app/config/environment'
if (!ENV.environment === 'test') {
	Sentry.init({
		dsn: 'abc123',
		integrations: [new Sentry.Integrations.Ember()]
	})
}`

Should this be handled in the integration or just update the docs?

@Turbo87
Copy link
Contributor

Turbo87 commented Oct 30, 2018

see #1696 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants