diff options
| author | Tom Harley | 2018-02-20 16:21:30 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-02-20 16:21:30 +0000 |
| commit | eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb (patch) | |
| tree | 8351e174ee8ac7249f61286dd52bccd46f147a31 /test/options.test.ts | |
| parent | minor fixes (diff) | |
| parent | Merge branch 'trh/yarn' into 'master' (diff) | |
| download | medicine-eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb.tar.gz medicine-eba2d2c0b0293e9dd146a377a85ff6c31e4b96cb.zip | |
Merge branch ‘master’ into trh/payload-checker
Diffstat (limited to 'test/options.test.ts')
| -rw-r--r-- | test/options.test.ts | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/test/options.test.ts b/test/options.test.ts deleted file mode 100644 index 542d38a..0000000 --- a/test/options.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as mocha from 'mocha'; -import chai = require('chai'); -var should = chai.should(); - -import * as options from '../src/matcher/options'; -import { default as types } from '../src/matcher/types'; - -describe('Object Matching:', () => { - describe('Rough Matching', () => { - it('accepts basic things', () => { - let template = { - a: types.string - }; - let matchee = { - a: "yes" - }; - options.match(template, matchee).should.be.true; - }); - it('accepts objects with superfluous properties', () => { - let template = { - a: types.number - }; - let matchee = { - a: 40, - b: 20 - }; - options.match(template, matchee).should.be.true; - }); - it('rejects objects missing some properties', () => { - let template = { - a: types.boolean, - b: types.number, - c: types.number - }; - let matchee = { - b: 5 - }; - options.match(template, matchee).should.be.false; - }); - it('accepts objects that omit not_present properties', () => { - let template = { - a: types.function, - b: types.not_present, - c: types.not_present - }; - let matchee = { - a: new Function() - }; - options.match(template, matchee).should.be.true; - }); - }); -}); |
