Initial update for the bitmessage-js package #1

Merged
PeterSurda merged 15 commits from lee.miller/bitmessage-js:mac into master 2024-03-08 01:55:30 +01:00
Showing only changes of commit 7b38bbc5ad - Show all commits

15
test.js
View File

@ -776,14 +776,13 @@ describe("Object types", function() {
}); });
}); });
it("shouldn't decode getpubkey with insufficient nonce", function(done) { it("shouldn't decode getpubkey with insufficient nonce", function() {
return getpubkey.encodeAsync({ return getpubkey.encodeAsync({
ttl: 100, ttl: 100,
to: "2cTux3PGRqHTEH6wyUP2sWeT4LrsGgy63z", to: "2cTux3PGRqHTEH6wyUP2sWeT4LrsGgy63z",
skipPow: true, skipPow: true,
}).then(getpubkey.decodeAsync).catch(function(err) { }).then(getpubkey.decodeAsync).catch(function(err) {
expect(err.message).to.match(/insufficient/i); expect(err.message).to.match(/insufficient/i);
done();
}); });
}); });
@ -949,7 +948,7 @@ describe("Object types", function() {
}); });
}); });
it("shouldn't decode msg without identities", function(done) { it("shouldn't decode msg without identities", function() {
return msg.encodeAsync({ return msg.encodeAsync({
ttl: 111, ttl: 111,
from: from, from: from,
@ -960,7 +959,6 @@ describe("Object types", function() {
return msg.decodeAsync(buf, {identities: [], skipPow: true}); return msg.decodeAsync(buf, {identities: [], skipPow: true});
}).catch(function(err) { }).catch(function(err) {
expect(err.message).to.match(/with given identities/i); expect(err.message).to.match(/with given identities/i);
done();
}); });
}); });
@ -982,7 +980,7 @@ describe("Object types", function() {
}); });
}); });
it("shouldn't encode too big msg", function(done) { it("shouldn't encode too big msg", function() {
return msg.encodeAsync({ return msg.encodeAsync({
ttl: 111, ttl: 111,
from: from, from: from,
@ -991,7 +989,6 @@ describe("Object types", function() {
skipPow: true, skipPow: true,
}).catch(function(err) { }).catch(function(err) {
expect(err.message).to.match(/too big/i); expect(err.message).to.match(/too big/i);
done();
}); });
}); });
@ -1099,7 +1096,7 @@ describe("Object types", function() {
}); });
}); });
it("shouldn't decode broadcast without subscriptions", function(done) { it("shouldn't decode broadcast without subscriptions", function() {
return broadcast.encodeAsync({ return broadcast.encodeAsync({
ttl: 101, ttl: 101,
from: from, from: from,
@ -1112,11 +1109,10 @@ describe("Object types", function() {
}); });
}).catch(function(err) { }).catch(function(err) {
expect(err.message).to.match(/not interested/i); expect(err.message).to.match(/not interested/i);
done();
}); });
}); });
it("shouldn't encode too big broadcast", function(done) { it("shouldn't encode too big broadcast", function() {
return broadcast.encodeAsync({ return broadcast.encodeAsync({
ttl: 101, ttl: 101,
from: from, from: from,
@ -1124,7 +1120,6 @@ describe("Object types", function() {
skipPow: true, skipPow: true,
}).catch(function(err) { }).catch(function(err) {
expect(err.message).to.match(/too big/i); expect(err.message).to.match(/too big/i);
done();
}); });
}); });