summaryrefslogtreecommitdiffhomepage
path: root/test/lib/enum.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/enum.spec.js')
-rw-r--r--test/lib/enum.spec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib/enum.spec.js b/test/lib/enum.spec.js
index 04e1015f42..0f5d6ee4d1 100644
--- a/test/lib/enum.spec.js
+++ b/test/lib/enum.spec.js
@@ -13,4 +13,12 @@ describe('enum', () => {
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;
+ })
+
});