Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강동현
2021-06-09 22:45:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22f6056faf998f4b67173176f3228ce7e624b2a6
22f6056f
1 parent
9e57e5d3
로그인 성공시 username이 반환되지 않던 문제 해결
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
server/connection/Connection.ts
server/test/login.test.ts
server/connection/Connection.ts
View file @
22f6056
...
...
@@ -84,7 +84,7 @@ export class Connection {
this
.
user
=
new
User
(
message
.
nickname
,
this
);
// console.log(`User ${message.username} has logged in!`);
return
{
ok
:
true
};
return
{
ok
:
true
,
result
:
this
.
user
.
username
};
}
public
handleDisconnect
():
void
{
...
...
server/test/login.test.ts
View file @
22f6056
...
...
@@ -6,7 +6,8 @@ describe("로그인", () => {
it
(
"닉네임으로 로그인합니다"
,
()
=>
{
const
roomManager
=
new
RoomManager
();
const
socket
=
new
SocketTester
(
roomManager
);
socket
.
testOk
(
"login"
,
{
nickname
:
"guest"
});
const
response
=
socket
.
test
(
"login"
,
{
nickname
:
"guest"
});
expect
(
response
.
result
!==
undefined
).
eq
(
true
);
expect
(
socket
.
connection
.
user
?.
nickname
).
eq
(
"guest"
);
});
it
(
"빈 닉네임으로 로그인할 수 없습니다"
,
()
=>
{
...
...
Please
register
or
login
to post a comment