DEV: Don't print uppy warnings in test env (#17121)

This commit is contained in:
Jarek Radosz 2022-06-17 13:44:52 +02:00 committed by GitHub
parent e0ff367b49
commit f27f95b2e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import { BasePlugin } from "@uppy/core";
import { Promise } from "rsvp";
import { warn } from "@ember/debug";
import { isTesting } from "discourse-common/config/environment";
export class UppyPluginBase extends BasePlugin {
constructor(uppy, opts) {
@ -9,7 +10,9 @@ export class UppyPluginBase extends BasePlugin {
}
_consoleWarn(msg) {
warn(`[${this.id}] ${msg}`, { id: `discourse.${this.id}` });
if (!isTesting()) {
warn(`[${this.id}] ${msg}`, { id: `discourse.${this.id}` });
}
}
_consoleDebug(msg) {