Skip to content

Commit 42cfef6

Browse files
authored
fix: poison pill warning in test environments (#59)
1 parent 0cc2517 commit 42cfef6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/poison.pill.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
throw new Error(`react-native-css has encountered a setup error.
1+
const canWarn = process.env.NODE_ENV !== "test";
2+
3+
if (canWarn) {
4+
throw new Error(`react-native-css has encountered a setup error.
25
36
┌─────-─┐
47
| Metro |
@@ -28,5 +31,6 @@ If you are using NativeWind with the 'withNativeWind' function, follow the Metro
2831
2932
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.
3033
`);
34+
}
3135

3236
export {};

0 commit comments

Comments
 (0)