Skip to content

Commit

Permalink
Ignore some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Mar 4, 2021
1 parent dd3db0c commit 375196a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/helpers/setup-no-deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import { registerDeprecationHandler } from '@ember/debug';
let isRegistered = false;
let deprecations;

// Ignore deprecations that are not caused by our own code, and which we cannot fix easily.
const ignoredDeprecations = [/Versions of modifier manager capabilities prior to 3\.22 have been deprecated/];

export default function setupNoDeprecations({ beforeEach, afterEach }) {
beforeEach(function () {
deprecations = [];
if (!isRegistered) {
registerDeprecationHandler((message, options, next) => {
deprecations.push(message);
if (!ignoredDeprecations.some((regex) => message.match(regex))) {
deprecations.push(message);
}
next(message, options);
});
isRegistered = true;
Expand Down

0 comments on commit 375196a

Please sign in to comment.