chore: 🤖 silence deprecation warnings

This commit is contained in:
Randall Morey committed 2021-10-26 09:02:33 -04:00
1 parent 29939f02fe
commit 544531a325
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);
});
});
+1
View File
@@ -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,
};