@@ -8,24 +8,15 @@ chai.use(require('chai-as-promised'))
88const SUPABASE_URL = process . env . SUPABASE_URL || 'http://localhost:1234'
99const SUPABASE_KEY = process . env . SUPABASE_KEY || 'examplekey'
1010
11- console . log ( 'SUPABASE_KEY' , SUPABASE_KEY )
12-
1311describe ( 'test signing up and logging in as a new user' , ( ) => {
14- const supabase = createClient (
15- 'https://nuaqAUDnliweFqRoinst.supabase.net' ,
16- 'ucHLLNUUFXVn2o6pRCcQOW82KF0RAs'
17- )
12+ const supabase = createClient ( SUPABASE_URL , SUPABASE_KEY )
1813 const randomEmail = `a${ Math . random ( ) } @google.com`
1914
2015 it ( 'should register a new user' , async ( ) => {
2116 try {
2217 const response = await supabase . auth . signup ( randomEmail , '11password' )
23- console . log ( 'response' , response )
24- const { body :countries } = await supabase . from ( 'countries' ) . select ( '*' ) . limit ( 1 )
25- console . log ( 'countries' , countries )
26- assert ( response . email === randomEmail , 'user could not sign up' )
18+ assert ( response . body . email === randomEmail , 'user could not sign up' )
2719 } catch ( error ) {
28- // console.log('error', error)
2920 assert ( ! error , 'sign up returns an error' )
3021 }
3122 } )
@@ -35,7 +26,6 @@ describe('test signing up and logging in as a new user', () => {
3526 const response = await supabase . auth . login ( randomEmail , '11password' )
3627 assert ( response . body . access_token !== undefined , 'user could not log in' )
3728 } catch ( error ) {
38- // console.log('error', error)
3929 assert ( ! error , 'log in returns an error' )
4030 }
4131 } )
@@ -45,7 +35,6 @@ describe('test signing up and logging in as a new user', () => {
4535 const user = await supabase . auth . user ( )
4636 assert ( user . email === randomEmail , 'user could not be retrieved' )
4737 } catch ( error ) {
48- // console.log('error', error)
4938 assert ( ! error , 'logged in user returns an error' )
5039 }
5140 } )
0 commit comments