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

Ability to disable clock to run Ember Acceptance tests #7

Merged
merged 4 commits into from
Jul 30, 2018

Conversation

rbezemer
Copy link
Contributor

WIth new versions of ember it is discouraged to mock services. This changes allows a user to disable the updating of the clock service run loop while running acceptance tests.

import Service from 'ember-clock/services/clock'
export default Service.extend({
disabled: ENV['ember-clock'] && ENV['ember-clock'].disabled
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbezemer When I run the tests I get this error

Only string, number, symbol, boolean, null, undefined, and function are allowed as default properties (ember/avoid-leaking-state-in-ember-objects)

Can you set the disabled flag in a constant like this:

const disabled = ENV['ember-clock'] && ENV['ember-clock'].disabled

export default Service.extend({
  disabled
})

Copy link
Owner

@lozjackson lozjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbezemer Thanks for submitting this PR. Sorry its taken me a while to get around to reviewing this.

I've left a comment in the code requesting a minor change.

@rbezemer
Copy link
Contributor Author

Sorry about that, the lint should be gone now.

Copy link
Owner

@lozjackson lozjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@lozjackson lozjackson merged commit 68952fa into lozjackson:master Jul 30, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants