Skip to content

Commit

Permalink
chore: ignore the warning from setupTests in reanimated plugin (#820)
Browse files Browse the repository at this point in the history
* fix: ignore the warning from setupTests

* chore: add changeset
  • Loading branch information
jbroma authored Dec 10, 2024
1 parent 9890400 commit 39f80b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-pillows-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": patch
---

Ignore setUpTests warning from Reanimated by default
8 changes: 8 additions & 0 deletions packages/plugin-reanimated/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
);
}
}

0 comments on commit 39f80b3

Please sign in to comment.