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/exampleBee.js
Views: 789
1
const assert = require('assert')
2
3
module.exports = () => async (bot) => {
4
await bot.test.runExample('examples/bee.js', async (name) => {
5
assert.strictEqual(name, 'bee')
6
bot.chat('/op bee') // to counteract spawn protection
7
await bot.test.wait(2000)
8
await bot.test.tellAndListen(name, 'fly', (message) => {
9
if (message !== 'My flight was amazing !') {
10
assert.fail(`Unexpected message: ${message}`) // error
11
}
12
return true // stop listening
13
})
14
})
15
}
16
17