summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/enum.spec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lib/enum.spec.js b/test/lib/enum.spec.js
new file mode 100644
index 0000000000..04e1015f42
--- /dev/null
+++ b/test/lib/enum.spec.js
@@ -0,0 +1,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();
+ });
+
+});