-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesthelpers.js
More file actions
52 lines (47 loc) · 1.19 KB
/
testhelpers.js
File metadata and controls
52 lines (47 loc) · 1.19 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function Chat() {
return {
// eslint-disable-next-line no-unused-vars
gameExceptSender: jest.fn((roomName, message) => {}),
// eslint-disable-next-line no-unused-vars
game: jest.fn((roomName, message) => {}),
// eslint-disable-next-line no-unused-vars
toSelf: jest.fn((id, message) => {}),
// eslint-disable-next-line no-unused-vars
toSelfInTopic: jest.fn((id, message, topic) => {}),
// eslint-disable-next-line no-unused-vars
toRoomInTopic: jest.fn((room, message, topic) => {}),
}
}
function PokerDeck() {
return {
drawTwoCards() {
return ['1', '2']
},
drawThreeCards() {
return ['3', '4', '5']
},
drawOneCard() {
return '6'
},
resetDeck: jest.fn(() => {}),
}
}
function WinnerCalculator() {
return {
// eslint-disable-next-line no-unused-vars
calculateWinningPlayer: jest.fn((cardsExaminations) => [{ playerId: 2 }]),
}
}
function TimePassed() {
return {
count: jest.fn(() => '1 minute'),
}
}
function str(object) {
return JSON.stringify(object)
}
exports.Chat = Chat
exports.PokerDeck = PokerDeck
exports.TimePassed = TimePassed
exports.WinnerCalculator = WinnerCalculator
exports.str = str