commons.exceptions.spec.js 876 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. describe('Cryptolib: ', function() {
  9. 'use strict';
  10. it('Should be possible to create a CryptoException object', function() {
  11. cryptolib('commons', function(box) {
  12. var exception = new box.commons.exceptions.CryptoLibException(
  13. 'customMessage', 'originalMessage');
  14. expect(exception).toBeDefined();
  15. });
  16. });
  17. it('Should be possible to create have a string representation of the exception',
  18. function() {
  19. cryptolib('commons', function(box) {
  20. var exception = new box.commons.exceptions.CryptoLibException(
  21. 'customMessage', 'originalMessage');
  22. expect(exception.toString()).toBeDefined();
  23. });
  24. });
  25. });