blob: 04e1015f42c31c518ab582fc05be22065ce5671c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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');
});
it('should not be able to modify enum', () => {
let e = Enum('NORTH', 'SOUTH', 'WEST', 'EAST');
expect(() => e.ANYWHERE = 'ANYWHERE').to.throw();
});
});
|