@@ -2801,11 +2801,15 @@ describe('dbAuth', () => {
28012801
28022802 it ( 'throw an error if user is not found' , async ( ) => {
28032803 const data = { id : 999999999999 }
2804- req = {
2805- headers : {
2806- cookie : encryptToCookie ( JSON . stringify ( data ) + ';' + 'token' ) ,
2807- } ,
2804+ const headers = {
2805+ cookie : encryptToCookie ( JSON . stringify ( data ) + ';' + 'token' ) ,
28082806 }
2807+
2808+ const req = new Request ( 'http://localhost:8910/_rw_mw' , {
2809+ method : 'POST' ,
2810+ headers,
2811+ } )
2812+
28092813 const dbAuth = new DbAuthHandler ( req , context , options )
28102814
28112815 try {
@@ -2819,13 +2823,17 @@ describe('dbAuth', () => {
28192823
28202824 it ( 'throws a generic error for an invalid client' , async ( ) => {
28212825 const dbUser = await createDbUser ( )
2822- req = {
2823- headers : {
2824- cookie : encryptToCookie (
2825- JSON . stringify ( { id : dbUser . id } ) + ';' + 'token'
2826- ) ,
2827- } ,
2826+ const headers = {
2827+ cookie : encryptToCookie (
2828+ JSON . stringify ( { id : dbUser . id } ) + ';' + 'token'
2829+ ) ,
28282830 }
2831+
2832+ const req = new Request ( 'http://localhost:8910/_rw_mw' , {
2833+ method : 'POST' ,
2834+ headers,
2835+ } )
2836+
28292837 // invalid db client
28302838 const dbAuth = new DbAuthHandler ( req , context , options )
28312839 dbAuth . dbAccessor = undefined
@@ -2841,13 +2849,17 @@ describe('dbAuth', () => {
28412849
28422850 it ( 'returns the user whos id is in session' , async ( ) => {
28432851 const dbUser = await createDbUser ( )
2844- req = {
2845- headers : {
2846- cookie : encryptToCookie (
2847- JSON . stringify ( { id : dbUser . id } ) + ';' + 'token'
2848- ) ,
2849- } ,
2852+ const headers = {
2853+ cookie : encryptToCookie (
2854+ JSON . stringify ( { id : dbUser . id } ) + ';' + 'token'
2855+ ) ,
28502856 }
2857+
2858+ const req = new Request ( 'http://localhost:8910/_rw_mw' , {
2859+ method : 'POST' ,
2860+ headers,
2861+ } )
2862+
28512863 const dbAuth = new DbAuthHandler ( req , context , options )
28522864 const user = await dbAuth . _getCurrentUser ( )
28532865
0 commit comments