diff options
| author | Tom Harley | 2018-02-07 14:18:55 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-02-07 14:18:55 +0000 |
| commit | 5e482ce4408f2e1926d1e9af3270a52ffcc83df6 (patch) | |
| tree | 49ba0e37e404502aa4e31f8cd86657a08046ce7a /src/matcher/options.test.ts | |
| parent | matching now supports nested functions (diff) | |
| download | medicine-5e482ce4408f2e1926d1e9af3270a52ffcc83df6.tar.gz medicine-5e482ce4408f2e1926d1e9af3270a52ffcc83df6.zip | |
added literal matching
Diffstat (limited to 'src/matcher/options.test.ts')
| -rw-r--r-- | src/matcher/options.test.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/matcher/options.test.ts b/src/matcher/options.test.ts index 058ef9e..39c4b3e 100644 --- a/src/matcher/options.test.ts +++ b/src/matcher/options.test.ts @@ -75,7 +75,7 @@ describe('Object Matching:', () => { let matchee = { a: 432, b: { - ba: "barracus", + ba: "baracus", bb: new Function(), }, c: true, @@ -83,5 +83,23 @@ describe('Object Matching:', () => { }; options.match(template, matchee).should.be.true; }); + it('accepts literal matches', () => { + let template = { + a: "literal" + }; + let matchee = { + a: "literal" + }; + options.match(template, matchee).should.be.true; + }); + it('rejects incorrect literal matches', () => { + let template = { + g: 99 + }; + let matchee = { + g: 80 + }; + options.match(template, matchee).should.be.false; + }); }); }); |
