Skip to content

Commit

Permalink
fix: use same deprecation message everywhere, correct tests for new m…
Browse files Browse the repository at this point in the history
…essage
  • Loading branch information
mikehardy committed Feb 8, 2025
1 parent cbda9e5 commit 684081b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/app/lib/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,8 @@ export function warnIfNotModularCall(args, replacementMethodName = '') {
return;
}
}
let message =
'This v8 method is deprecated and will be removed in the next major release ' +
'as part of move to match Firebase Web modular v9 SDK API.';

let message = v8deprecationMessage;
if (replacementMethodName.length > 0) {
message += ` Please use \`${replacementMethodName}\` instead.`;
}
Expand Down
5 changes: 2 additions & 3 deletions packages/crashlytics/e2e/crashlytics.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ describe('crashlytics()', function () {
// eslint-disable-next-line no-console
console.warn = msg => {
// we console.warn for deprecated API, can be removed when we move to v9
if (!msg.includes('v8 method is deprecated')) {
if (!msg.includes('method is deprecated')) {
msg.should.containEql('expects an instance of Error');
logged = true;
// eslint-disable-next-line no-console
console.warn = orig;
}
};

firebase.crashlytics().recordError(1337);
should.equal(logged, true);
});
Expand Down Expand Up @@ -265,7 +264,7 @@ describe('crashlytics()', function () {
// eslint-disable-next-line no-console
console.warn = msg => {
// we console.warn for deprecated API, can be removed when we move to v9
if (!msg.includes('v8 method is deprecated')) {
if (!msg.includes('method is deprecated')) {
msg.should.containEql('expects an instance of Error');
logged = true;
// eslint-disable-next-line no-console
Expand Down

0 comments on commit 684081b

Please sign in to comment.