aboutsummaryrefslogtreecommitdiff
path: root/test/unit/options.unit.test.ts
diff options
context:
space:
mode:
authorjw2552018-04-13 21:12:53 +0100
committerjw2552018-04-13 21:12:53 +0100
commit9c0ff9a0b7d73e5e2a12c4f87d1aa586c59adec9 (patch)
tree4ec4ff8eb5fdc17041ae5b8e6bf9158a2eebbe81 /test/unit/options.unit.test.ts
parentfixed template matching in test suite (diff)
downloadmedicine-9c0ff9a0b7d73e5e2a12c4f87d1aa586c59adec9.tar.gz
medicine-9c0ff9a0b7d73e5e2a12c4f87d1aa586c59adec9.zip

only 12 failing tests :D

Diffstat (limited to 'test/unit/options.unit.test.ts')
-rw-r--r--test/unit/options.unit.test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/options.unit.test.ts b/test/unit/options.unit.test.ts
index 1925835..29000de 100644
--- a/test/unit/options.unit.test.ts
+++ b/test/unit/options.unit.test.ts
@@ -159,5 +159,15 @@ describe('Matching:', () => {
};
options.match(template, matchee).should.be.false;
});
+ it('accepts optional matches', () => {
+ const template = {
+ a: options.optional(types.array),
+ b: options.optional(types.anything)
+ };
+ const matchee = {
+ b: []
+ };
+ options.match(template)(matchee).should.be.true;
+ });
});
});