From 39f80b3661a348b9d778f76af2848ed615582d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Roma=C5=84czyk?= Date: Tue, 10 Dec 2024 21:50:42 +0100 Subject: [PATCH] chore: ignore the warning from setupTests in reanimated plugin (#820) * fix: ignore the warning from setupTests * chore: add changeset --- .changeset/thick-pillows-act.md | 5 +++++ packages/plugin-reanimated/src/plugin.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/thick-pillows-act.md diff --git a/.changeset/thick-pillows-act.md b/.changeset/thick-pillows-act.md new file mode 100644 index 000000000..018a762d2 --- /dev/null +++ b/.changeset/thick-pillows-act.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": patch +--- + +Ignore setUpTests warning from Reanimated by default diff --git a/packages/plugin-reanimated/src/plugin.ts b/packages/plugin-reanimated/src/plugin.ts index db64b5cb2..acf3995c6 100644 --- a/packages/plugin-reanimated/src/plugin.ts +++ b/packages/plugin-reanimated/src/plugin.ts @@ -5,5 +5,13 @@ export class ReanimatedPlugin implements RspackPluginInstance { apply(compiler: Compiler) { // add rules for transpiling wih reanimated loader compiler.options.module.rules.push(reanimatedModuleRules); + + // ignore the 'setUpTests' warning from reanimated which is not relevant + compiler.options.ignoreWarnings = compiler.options.ignoreWarnings ?? []; + compiler.options.ignoreWarnings.push((warning) => + /'`setUpTests` is available only in Jest environment\.'/.test( + warning.message + ) + ); } }