unit test on connect is working, lets start the worst ....
This commit is contained in:
+19
-2
@@ -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([]);
|
||||
})
|
||||
**/
|
||||
})
|
||||
Reference in New Issue
Block a user