File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export const createAuthFormWithFallback = async () => {
3333
3434 return result ;
3535 } catch ( error ) {
36- if ( import . meta . env . DEV ) {
36+ if ( isDevelopmentMode ( ) ) {
3737 console . warn ( `Failed to ${ strategy . name } ` ) ;
3838
3939 if ( error instanceof Error ) {
@@ -94,7 +94,7 @@ export const validateAuthFormWithFallback = async (request: Request) => {
9494
9595 return result . form ;
9696 } catch ( error ) {
97- if ( import . meta . env . DEV ) {
97+ if ( isDevelopmentMode ( ) ) {
9898 console . warn ( `Failed to ${ strategy . name } ` ) ;
9999
100100 if ( error instanceof Error ) {
@@ -146,6 +146,14 @@ const formValidationStrategies = [
146146 } ,
147147] ;
148148
149+ /**
150+ * Helper function to validate if we're in development mode
151+ * This can be mocked in tests to control logging behavior
152+ */
153+ export const isDevelopmentMode = ( ) : boolean => {
154+ return import . meta. env . DEV ;
155+ } ;
156+
149157/**
150158 * Common form structure for authentication forms
151159 * Contains constraints and shape definitions used across different form strategies
You can’t perform that action at this time.
0 commit comments