-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing deprecation message for
this.$()
(#153)
Add missing deprecation message for `this.$()`
- Loading branch information
Showing
3 changed files
with
19 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,8 @@ | ||
import QUnit from 'qunit'; | ||
import { registerDeprecationHandler } from '@ember/debug'; | ||
import Application from '../app'; | ||
import config from '../config/environment'; | ||
import { setApplication } from '@ember/test-helpers'; | ||
import { start } from 'ember-qunit'; | ||
|
||
let deprecations; | ||
|
||
registerDeprecationHandler((message, options, next) => { | ||
// in case a deprecation is issued before a test is started | ||
if (!deprecations) { | ||
deprecations = []; | ||
} | ||
|
||
deprecations.push(message); | ||
next(message, options); | ||
}); | ||
|
||
QUnit.testStart(function() { | ||
deprecations = []; | ||
}); | ||
|
||
QUnit.assert.noDeprecations = async function(callback) { | ||
let originalDeprecations = deprecations; | ||
deprecations = []; | ||
|
||
await callback(); | ||
this.deepEqual(deprecations, [], 'Expected no deprecations during test.'); | ||
|
||
deprecations = originalDeprecations; | ||
}; | ||
|
||
setApplication(Application.create(config.APP)); | ||
|
||
start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters