Skip to content

Commit

Permalink
chore(plugin-kit): update log condition to exclude only during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Oct 19, 2023
1 parent 0035a16 commit 95dde09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/plugin-kit/src/createSliceMachinePluginRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ export class SliceMachinePluginRunner {
)(resolve);
plugin = raw.default || raw;
} catch (error) {
// Only log in development and when plugin is unavailable through native plugins library (to prevent noise)
if (import.meta.env.DEV && !(resolve in this._nativePlugins)) {
// Only log in development, but not during tests when a native plugin matches.
if (
import.meta.env.DEV &&
!(import.meta.env.TEST && resolve in this._nativePlugins)
) {
console.error(error);
}
}
Expand Down

0 comments on commit 95dde09

Please sign in to comment.