unit test on connect is working, lets start the worst ....
This commit is contained in:
parent
e3b0f99f04
commit
4bc23ede90
4 changed files with 143 additions and 30 deletions
|
@ -29,15 +29,31 @@ describe("World", () => {
|
|||
position: new Point(500, 100)
|
||||
}));
|
||||
|
||||
world.updatePosition(new MessageUserPosition({
|
||||
userId: "bar",
|
||||
roomId: 1,
|
||||
position: new Point(261, 100)
|
||||
}));
|
||||
|
||||
expect(connectCalled).toBe(false);
|
||||
|
||||
world.updatePosition(new MessageUserPosition({
|
||||
userId: "bar",
|
||||
roomId: 1,
|
||||
position: new Point(101, 100)
|
||||
}));
|
||||
|
||||
//expect(connectCalled).toBe(true);
|
||||
expect(connectCalled).toBe(true);
|
||||
|
||||
}),
|
||||
connectCalled = false;
|
||||
world.updatePosition(new MessageUserPosition({
|
||||
userId: "bar",
|
||||
roomId: 1,
|
||||
position: new Point(102, 100)
|
||||
}));
|
||||
expect(connectCalled).toBe(false);
|
||||
});
|
||||
/**
|
||||
it('Should return the distances between all users', () => {
|
||||
let connectCalled: boolean = false;
|
||||
let connect = (user1: string, user2: string): void => {
|
||||
|
@ -83,4 +99,5 @@ describe("World", () => {
|
|||
|
||||
//expect(distances).toBe([]);
|
||||
})
|
||||
**/
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue