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

Drop autorun assertion #16797

Merged
merged 1 commit into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions packages/@ember/runloop/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, deprecate, isTesting } from '@ember/debug';
import { assert, deprecate } from '@ember/debug';
import { onErrorTarget } from 'ember-error-handling';
import { beginPropertyChanges, endPropertyChanges } from 'ember-metal';
import Backburner from 'backburner';
Expand Down Expand Up @@ -325,11 +325,6 @@ export function end() {
@public
*/
export function schedule(queue /*, target, method */) {
assert(
`You have turned on testing mode, which disabled the run-loop's autorun. ` +
`You will need to wrap any code with asynchronous side-effects in a run`,
currentRunLoop || !isTesting()
);
deprecate(`Scheduling into the '${queue}' run loop queue is deprecated.`, queue !== 'sync', {
id: 'ember-metal.run.sync',
until: '3.5.0',
Expand Down Expand Up @@ -398,11 +393,6 @@ export function later(/*target, method*/) {
@public
*/
export function once(...args) {
assert(
`You have turned on testing mode, which disabled the run-loop's autorun. ` +
`You will need to wrap any code with asynchronous side-effects in a run`,
currentRunLoop || !isTesting()
);
args.unshift('actions');
return backburner.scheduleOnce(...args);
}
Expand Down Expand Up @@ -480,11 +470,6 @@ export function once(...args) {
@public
*/
export function scheduleOnce(queue /*, target, method*/) {
assert(
`You have turned on testing mode, which disabled the run-loop's autorun. ` +
`You will need to wrap any code with asynchronous side-effects in a run`,
currentRunLoop || !isTesting()
);
deprecate(`Scheduling into the '${queue}' run loop queue is deprecated.`, queue !== 'sync', {
id: 'ember-metal.run.sync',
until: '3.5.0',
Expand Down
13 changes: 0 additions & 13 deletions packages/@ember/runloop/tests/schedule_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,5 @@ moduleFor(

assert.deepEqual(order, ['sync', 'actions', 'sync', 'actions', 'destroy']);
}

['@test makes sure it does not trigger an autorun during testing']() {
expectAssertion(
() => schedule('actions', () => {}),
/wrap any code with asynchronous side-effects in a run/
);

// make sure not just the first violation is asserted.
expectAssertion(
() => schedule('actions', () => {}),
/wrap any code with asynchronous side-effects in a run/
);
}
}
);