Skip to content

Commit

Permalink
[DOC] Added documentation URL to evented deprecation warnings (#6396)
Browse files Browse the repository at this point in the history
* Added deprecations app URL to evented usage api warnings

* Reverted deprecation warning id

* Added DEBUG import
  • Loading branch information
yohanmishkin authored and runspired committed Sep 21, 2019
1 parent a968d12 commit af1d77e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/-ember-data/tests/unit/model-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DEBUG } from '@glimmer/env';
import { guidFor } from '@ember/object/internals';
import { resolve, reject } from 'rsvp';
import { set, get, observer, computed } from '@ember/object';
Expand Down Expand Up @@ -607,11 +608,17 @@ module('unit/model - Model', function(hooks) {
let record = store.createRecord('person');

record.on('event!', F);

if (DEBUG) {
assert.expectDeprecation(/Called event! on person/);
}

record.trigger('event!');

await settled();

assert.equal(count, 1, 'the event was triggered');

record.trigger('event!');

await settled();
Expand Down
1 change: 1 addition & 0 deletions packages/store/addon/-private/system/deprecated-evented.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if (DEBUG) {
deprecate(deprecationMessage, deprecations[eventName], {
id: 'ember-data:evented-api-usage',
until: '4.0',
url: 'https://deprecations.emberjs.com/ember-data/v3.x/#deprecatingrecordlifecycleeventmethods',
});
deprecations[eventName] = true;
},
Expand Down

0 comments on commit af1d77e

Please sign in to comment.