CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PrismarineJS

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: PrismarineJS/mineflayer
Path: blob/master/test/externalTests/team.js
Views: 789
1
const assert = require('assert')
2
const { once } = require('../../lib/promise_utils')
3
4
module.exports = () => async (bot) => {
5
const p = once(bot, 'teamMemberAdded')
6
if (bot.supportFeature('teamUsesChatComponents')) {
7
bot.test.sayEverywhere('/team add test "test"')
8
bot.test.sayEverywhere('/team modify test color dark_green')
9
bot.test.sayEverywhere(`/team join test ${bot.username}`)
10
} else {
11
bot.test.sayEverywhere('/scoreboard teams add test')
12
bot.test.sayEverywhere('/scoreboard teams option test color dark_green')
13
bot.test.sayEverywhere('/scoreboard teams join test')
14
}
15
16
await p
17
18
assert.notStrictEqual(bot.teams.test, undefined)
19
assert.notStrictEqual(bot.teamMap[bot.username], undefined, 'teamMap is not undefined')
20
21
const { test } = bot.teams
22
23
assert.strictEqual(test.name.toString(), 'test')
24
}
25
26