mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
fix and enable offline client connection test
This commit is contained in:
parent
8d9f37c2ba
commit
fd0d9f5a13
20
test/test.js
20
test/test.js
@ -298,7 +298,7 @@ mc.supportedVersions.forEach(function(supportedVersion){
|
|||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
it.skip("connects successfully - offline mode (STUBBED)", function(done) {
|
it("connects successfully - offline mode", function(done) {
|
||||||
wrap.startServer({'online-mode': 'false'}, function(err) {
|
wrap.startServer({'online-mode': 'false'}, function(err) {
|
||||||
if(err)
|
if(err)
|
||||||
return done(err);
|
return done(err);
|
||||||
@ -329,26 +329,20 @@ mc.supportedVersions.forEach(function(supportedVersion){
|
|||||||
var message = JSON.parse(packet.message);
|
var message = JSON.parse(packet.message);
|
||||||
if(chatCount === 1) {
|
if(chatCount === 1) {
|
||||||
assert.strictEqual(message.translate, "chat.type.text");
|
assert.strictEqual(message.translate, "chat.type.text");
|
||||||
assert.deepEqual(message["with"][0], {
|
assert.deepEqual(message["with"][0].clickEvent, {
|
||||||
clickEvent: {
|
action: "suggest_command",
|
||||||
action: "suggest_command",
|
value: "/msg Player "
|
||||||
value: "/msg Player "
|
|
||||||
},
|
|
||||||
text: "Player"
|
|
||||||
});
|
});
|
||||||
|
assert.deepEqual(message["with"][0].text, "Player");
|
||||||
assert.strictEqual(message["with"][1], "hello everyone; I have logged in.");
|
assert.strictEqual(message["with"][1], "hello everyone; I have logged in.");
|
||||||
} else if(chatCount === 2) {
|
} else if(chatCount === 2) {
|
||||||
assert.strictEqual(message.translate, "chat.type.announcement");
|
assert.strictEqual(message.translate, "chat.type.announcement");
|
||||||
assert.strictEqual(message["with"][0], "Server");
|
assert.strictEqual(message["with"][0].text ? message["with"][0].text : message["with"][0], "Server");
|
||||||
assert.deepEqual(message["with"][1], {
|
assert.deepEqual(message["with"][1].extra[0].text ? message["with"][1].extra[0].text : message["with"][1].extra[0], "hello");
|
||||||
text: "",
|
|
||||||
extra: ["hello"]
|
|
||||||
});
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
it("gets kicked when no credentials supplied in online mode", function(done) {
|
it("gets kicked when no credentials supplied in online mode", function(done) {
|
||||||
wrap.startServer({'online-mode': 'true'}, function(err) {
|
wrap.startServer({'online-mode': 'true'}, function(err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user