diff --git a/packages/-ember-data/tests/unit/model-test.js b/packages/-ember-data/tests/unit/model-test.js index f01c4b3077a..7d815a771f2 100644 --- a/packages/-ember-data/tests/unit/model-test.js +++ b/packages/-ember-data/tests/unit/model-test.js @@ -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'; @@ -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(); diff --git a/packages/store/addon/-private/system/deprecated-evented.js b/packages/store/addon/-private/system/deprecated-evented.js index fd7e59e54a2..157b7fc7580 100644 --- a/packages/store/addon/-private/system/deprecated-evented.js +++ b/packages/store/addon/-private/system/deprecated-evented.js @@ -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; },