Merge pull request #823 from hashicorp/chore-filter-deprecations
chore: 🤖 silence deprecation warnings
This commit is contained in:
5 files changed
+70
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { registerDeprecationHandler } from '@ember/debug';
|
||||
import config from 'ember-get-config';
|
||||
|
||||
const isTesting = config.environment === 'test';
|
||||
|
||||
export function initialize(/* application */) {
|
||||
if (isTesting) {
|
||||
// Disable all deprecations for now in tests.
|
||||
registerDeprecationHandler((/*message, options, next*/) => {
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
initialize,
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export { default, initialize } from 'core/initializers/deprecations';
|
||||
@@ -0,0 +1,34 @@
|
||||
import Application from '@ember/application';
|
||||
|
||||
import config from 'dummy/config/environment';
|
||||
import { initialize } from 'dummy/initializers/deprecations';
|
||||
import { module, test } from 'qunit';
|
||||
import Resolver from 'ember-resolver';
|
||||
import { run } from '@ember/runloop';
|
||||
|
||||
module('Unit | Initializer | deprecations', function (hooks) {
|
||||
hooks.beforeEach(function () {
|
||||
this.TestApplication = class TestApplication extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
podModulePrefix = config.podModulePrefix;
|
||||
Resolver = Resolver;
|
||||
};
|
||||
this.TestApplication.initializer({
|
||||
name: 'initializer under test',
|
||||
initialize,
|
||||
});
|
||||
|
||||
this.application = this.TestApplication.create({ autoboot: false });
|
||||
});
|
||||
|
||||
hooks.afterEach(function () {
|
||||
run(this.application, 'destroy');
|
||||
});
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it works', async function (assert) {
|
||||
await this.application.boot();
|
||||
|
||||
assert.ok(true);
|
||||
});
|
||||
});
|
||||
@@ -38,6 +38,7 @@
|
||||
"emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ember-get-config": "^0.3.0",
|
||||
"@babel/core": "^7.15.5",
|
||||
"@ember/optional-features": "^2.0.0",
|
||||
"@ember/test-helpers": "^2.4.2",
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { registerDeprecationHandler } from '@ember/debug';
|
||||
import config from 'ember-get-config';
|
||||
|
||||
const isTesting = config.environment === 'test';
|
||||
|
||||
export function initialize(/* application */) {
|
||||
if (isTesting) {
|
||||
// Disable all deprecations for now in tests.
|
||||
registerDeprecationHandler((/*message, options, next*/) => {
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
initialize,
|
||||
};
|
||||
Reference in new issue
Block a user