@@ -8,24 +8,15 @@ chai.use(require('chai-as-promised'))
8
8
const SUPABASE_URL = process . env . SUPABASE_URL || 'http://localhost:1234'
9
9
const SUPABASE_KEY = process . env . SUPABASE_KEY || 'examplekey'
10
10
11
- console . log ( 'SUPABASE_KEY' , SUPABASE_KEY )
12
-
13
11
describe ( '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 )
18
13
const randomEmail = `a${ Math . random ( ) } @google.com`
19
14
20
15
it ( 'should register a new user' , async ( ) => {
21
16
try {
22
17
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' )
27
19
} catch ( error ) {
28
- // console.log('error', error)
29
20
assert ( ! error , 'sign up returns an error' )
30
21
}
31
22
} )
@@ -35,7 +26,6 @@ describe('test signing up and logging in as a new user', () => {
35
26
const response = await supabase . auth . login ( randomEmail , '11password' )
36
27
assert ( response . body . access_token !== undefined , 'user could not log in' )
37
28
} catch ( error ) {
38
- // console.log('error', error)
39
29
assert ( ! error , 'log in returns an error' )
40
30
}
41
31
} )
@@ -45,7 +35,6 @@ describe('test signing up and logging in as a new user', () => {
45
35
const user = await supabase . auth . user ( )
46
36
assert ( user . email === randomEmail , 'user could not be retrieved' )
47
37
} catch ( error ) {
48
- // console.log('error', error)
49
38
assert ( ! error , 'logged in user returns an error' )
50
39
}
51
40
} )
0 commit comments