1- import { createCookieSessionStorage } from "@remix-run/cloudflare" ;
21import { Context } from "hono" ;
2+ import { createCookieSessionStorage } from "react-router" ;
33import { describe , test , expect , vi , beforeEach , afterAll } from "vitest" ;
44
55import { getSession , getSessionStorage , session } from "../src/session" ;
66
7- vi . mock ( "@remix-run /node" , ( ) => {
7+ vi . mock ( "@react-router /node" , ( ) => {
88 return {
99 createCookieSessionStorage : vi . fn ( ) ,
1010 } ;
@@ -64,7 +64,7 @@ describe(session.name, () => {
6464 expect ( createSessionStorage ) . toHaveBeenCalledOnce ( ) ;
6565 expect ( c . set ) . toHaveBeenNthCalledWith (
6666 1 ,
67- expect . any ( Symbol ) ,
67+ expect . any ( String ) ,
6868 sessionStorage ,
6969 ) ;
7070 expect ( next ) . toHaveBeenCalledOnce ( ) ;
@@ -84,7 +84,7 @@ describe(session.name, () => {
8484 expect ( createSessionStorage ) . toHaveBeenCalledOnce ( ) ;
8585 expect ( c . set ) . toHaveBeenNthCalledWith (
8686 1 ,
87- expect . any ( Symbol ) ,
87+ expect . any ( String ) ,
8888 sessionStorage ,
8989 ) ;
9090 expect ( spy . getSession ) . toHaveBeenCalledOnce ( ) ;
@@ -93,7 +93,7 @@ describe(session.name, () => {
9393
9494 expect ( c . set ) . toHaveBeenNthCalledWith (
9595 2 ,
96- expect . any ( Symbol ) ,
96+ expect . any ( String ) ,
9797 sessionInContext ,
9898 ) ;
9999 expect ( next ) . toHaveBeenCalledOnce ( ) ;
@@ -121,7 +121,7 @@ describe(getSessionStorage.name, () => {
121121 "A session middleware was not set." ,
122122 ) ;
123123
124- expect ( c . get ) . toHaveBeenCalledWith ( expect . any ( Symbol ) ) ;
124+ expect ( c . get ) . toHaveBeenCalledWith ( expect . any ( String ) ) ;
125125 } ) ;
126126
127127 test ( "returns session storage" , async ( ) => {
@@ -147,7 +147,7 @@ describe(getSession.name, () => {
147147 "A session middleware was not set." ,
148148 ) ;
149149
150- expect ( c . get ) . toHaveBeenCalledWith ( expect . any ( Symbol ) ) ;
150+ expect ( c . get ) . toHaveBeenCalledWith ( expect . any ( String ) ) ;
151151 } ) ;
152152
153153 test ( "returns session" , async ( ) => {
0 commit comments