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/scoreboard.js
Views: 789
1
// const assert = require('assert')
2
// const { once } = require('../../lib/promise_utils')
3
4
module.exports = () => async (bot) => {
5
// TODO: This is failing randomly, investigate and fix
6
/* bot.test.sayEverywhere('/scoreboard objectives add test1 health')
7
bot.test.sayEverywhere('/scoreboard objectives add test2 deathCount')
8
bot.test.sayEverywhere('/scoreboard objectives add test3 dummy')
9
bot.test.sayEverywhere('/scoreboard objectives setdisplay sidebar test1')
10
bot.test.sayEverywhere('/scoreboard objectives setdisplay belowName test1')
11
bot.test.sayEverywhere('/scoreboard objectives setdisplay list test2')
12
bot.test.sayEverywhere(`/scoreboard players add ${bot.username} test3 1`)
13
bot.test.sayEverywhere(`/scoreboard players reset ${bot.username}`)
14
15
let scoreboards = Object.keys(bot.scoreboards).length
16
if (scoreboards !== 2) {
17
await once(bot, 'scoreboardCreated')
18
scoreboards++
19
if (scoreboards !== 2) {
20
await once(bot, 'scoreboardCreated')
21
}
22
}
23
await bot.test.wait(500)
24
25
assert.notStrictEqual(bot.scoreboards.test1, undefined)
26
assert.notStrictEqual(bot.scoreboards.test2, undefined)
27
28
const { test1, test2 } = bot.scoreboards
29
assert.strictEqual(test2.name, test2.title)
30
assert.strictEqual(test1, bot.scoreboard.sidebar)
31
32
const promise = once(bot, 'scoreUpdated')
33
bot.test.sayEverywhere(`/kill ${bot.username}`)
34
const [scoreboard, updated] = await promise
35
assert.strictEqual(scoreboard.itemsMap[bot.username], updated) */
36
}
37
38