options.spec.js 829 B

1234567891011121314151617181920212223242526272829303132
  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. /* jshint node:true, jasmine:true */
  9. 'use strict';
  10. var expect = require('chai').expect;
  11. var options = require('../lib/options');
  12. describe('The policy options object', function() {
  13. it('should be immutable', function() {
  14. expect(function() {
  15. options.newProperty = '';
  16. }).to.throw(/Can\'t add property.*is not extensible/);
  17. });
  18. it('should provide options for existing policies', function() {
  19. expect(function() {
  20. var value = options.asymmetric.keypair.encryption;
  21. }).not.to.throw();
  22. expect(function() {
  23. var value = options.madeUpSection.subSection.ToMakeItCrash;
  24. }).to.throw();
  25. });
  26. });