-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auth.js
More file actions
34 lines (28 loc) · 1 KB
/
Copy pathtest-auth.js
File metadata and controls
34 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Test authentication system
const { registerUser, loginUser } = require('./services/auth');
async function testAuth() {
try {
console.log('Testing authentication system...');
// Test registration
console.log('\n1. Testing user registration...');
const newUser = {
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
password: 'password123',
birthDate: '1990-01-01',
birthTime: '12:00',
birthPlace: 'Istanbul'
};
const registeredUser = await registerUser(newUser);
console.log('Registration successful:', registeredUser);
// Test login
console.log('\n2. Testing user login...');
const loggedInUser = await loginUser('test@example.com', 'password123');
console.log('Login successful:', loggedInUser);
console.log('\nAuthentication tests completed successfully!');
} catch (error) {
console.error('Authentication test failed:', error.message);
}
}
testAuth();