From 26ef09977bea93d99d6a630d2498e4660c14c279 Mon Sep 17 00:00:00 2001 From: Mark Lawlor Date: Wed, 6 Aug 2025 14:27:25 +1000 Subject: [PATCH] fix: poison pill warning in test environments --- src/poison.pill.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/poison.pill.ts b/src/poison.pill.ts index c5cf459a..d625e9ae 100644 --- a/src/poison.pill.ts +++ b/src/poison.pill.ts @@ -1,4 +1,7 @@ -throw new Error(`react-native-css has encountered a setup error. +const canWarn = process.env.NODE_ENV !== "test"; + +if (canWarn) { + throw new Error(`react-native-css has encountered a setup error. ┌─────-─┐ | Metro | @@ -28,5 +31,6 @@ If you are using NativeWind with the 'withNativeWind' function, follow the Metro If you are using another bundler (Vite, Webpack, etc), or non-Metro framework (Next.js, Remix, etc), please ensure you have included 'react-native-css/babel' as a babel preset. `); +} export {};