aboutsummaryrefslogtreecommitdiff
path: root/src/matcher/options.test.ts
diff options
context:
space:
mode:
authorTom Harley2018-02-07 12:48:48 +0000
committerTom Harley2018-02-07 12:50:02 +0000
commitf60e3d9858f6037db3b27d5574ac95310127d302 (patch)
tree73d93b7a57862bfae9a560fafb983d076a1ba637 /src/matcher/options.test.ts
parentremoved types from options.ts to remove ts-node ambiguity (diff)
downloadmedicine-f60e3d9858f6037db3b27d5574ac95310127d302.tar.gz
medicine-f60e3d9858f6037db3b27d5574ac95310127d302.zip

matching now supports nested functions

Diffstat (limited to 'src/matcher/options.test.ts')
-rw-r--r--src/matcher/options.test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/matcher/options.test.ts b/src/matcher/options.test.ts
index f3d498c..058ef9e 100644
--- a/src/matcher/options.test.ts
+++ b/src/matcher/options.test.ts
@@ -63,5 +63,25 @@ describe('Object Matching:', () => {
};
options.match(template, matchee).should.be.true;
});
+ it('accepts nested objects that match', () => {
+ let template = {
+ a: types.number,
+ b: {
+ ba: types.string,
+ bb: types.function
+ },
+ c: types.boolean
+ };
+ let matchee = {
+ a: 432,
+ b: {
+ ba: "barracus",
+ bb: new Function(),
+ },
+ c: true,
+ x: false
+ };
+ options.match(template, matchee).should.be.true;
+ });
});
});