diff options
Diffstat (limited to 'test/lib')
| -rw-r--r-- | test/lib/enum.spec.js | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/lib/enum.spec.js b/test/lib/enum.spec.js index 0f5d6ee4d1..20de191d08 100644 --- a/test/lib/enum.spec.js +++ b/test/lib/enum.spec.js @@ -1,24 +1,26 @@ import { expect } from 'chai'; import Enum from '../../app/lib/enum'; -describe('enum', () => { - - it('should be able to compare values', () => { - const e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); - expect(e.NORTH).to.be.equal('NORTH'); - }); +describe('lib', () => { - it('should not be able to modify enum', () => { - let e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); - expect(() => e.ANYWHERE = 'ANYWHERE').to.throw(); - }); + describe('enum', () => { + it('should be able to compare values', () => { + const e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); + expect(e.NORTH).to.be.equal('NORTH'); + }); - it('should be able to validate enum keys', () => { - let e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); - expect(e.isValid('SOUTH')).to.be.true; - expect(e.isValid('ANYWHERE')).to.be.false; - expect(e.isValid()).to.be.false; - expect(e.isValid(null)).to.be.false; - }) + it('should not be able to modify enum', () => { + let e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); + expect(() => e.ANYWHERE = 'ANYWHERE').to.throw(); + }); + + it('should be able to validate enum keys', () => { + let e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST'); + expect(e.isValid('SOUTH')).to.be.true; + expect(e.isValid('ANYWHERE')).to.be.false; + expect(e.isValid()).to.be.false; + expect(e.isValid(null)).to.be.false; + }); + }); }); |
