Added a test to verify error message
This commit is contained in:
parent
a5a913419b
commit
589fbb19d6
|
@ -1202,6 +1202,19 @@ describe('OpenPGP.js public api tests', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Errors', function() {
|
describe('Errors', function() {
|
||||||
|
it('Errors stack should contain the stack of innerError', function(done) {
|
||||||
|
openpgp.encrypt({
|
||||||
|
data: new Uint8Array([0x01, 0x01, 0x01]),
|
||||||
|
passwords: null
|
||||||
|
})
|
||||||
|
.then(function() {
|
||||||
|
done(new Error('Error expected.'));
|
||||||
|
})
|
||||||
|
.catch(function(error) {
|
||||||
|
expect(error.stack).to.match(/\nError: No keys or passwords/);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
it('Errors should contain innerError', function(done) {
|
it('Errors should contain innerError', function(done) {
|
||||||
openpgp.encrypt({
|
openpgp.encrypt({
|
||||||
data: new Uint8Array([0x01, 0x01, 0x01]),
|
data: new Uint8Array([0x01, 0x01, 0x01]),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user