diff options
| author | Hafeez | 2018-04-14 19:47:38 +0100 |
|---|---|---|
| committer | Hafeez | 2018-04-14 19:47:38 +0100 |
| commit | 7be8d8b517c862dc1e49a7a964d0af39987e01e5 (patch) | |
| tree | 8e9946aa10fc8d1948c9f16f37da8622bbcb0adf /test/unit | |
| parent | think i fixed something (diff) | |
| parent | Merge branch 'trh/gets' of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-... (diff) | |
| download | medicine-7be8d8b517c862dc1e49a7a964d0af39987e01e5.tar.gz medicine-7be8d8b517c862dc1e49a7a964d0af39987e01e5.zip | |
Merge branch ‘trh/gets’ of gitlab.cs.st-andrews.ac.uk:cs3099group-be-4/project-code into trh/gets
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/options.unit.test.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/options.unit.test.ts b/test/unit/options.unit.test.ts index a4c879a..4a85c2f 100644 --- a/test/unit/options.unit.test.ts +++ b/test/unit/options.unit.test.ts @@ -170,6 +170,7 @@ describe('Matching:', () => { options.match(template)(matchee).should.be.true; }); it('big bad unit test', () => { + /* tslint:disable:align */ const matchee = { status: 'success', data: [ { privilege: 'admin', description: 'null', internal: false }, { privilege: 'logging', @@ -183,6 +184,36 @@ describe('Matching:', () => { user_message: options.optional(types.string), error_data: options.optional(types.anything) }; + /* tslint:enable:align */ + + options.match(template)(matchee).should.be.true; + }); + it('bigger badder unit test', () => { + /* tslint:disable:align */ + const matchee = [ { project_name: 'mocky', + users: [{ username: 'uname', access_level: 'admin'}], + public_metadata: { creation_date: '2018-04-14T17:13:44.291Z' }, + private_metadata: {}, + admin_metadata: {} } ]; + const template = types.array({ + project_name: types.string, + users: types.array({ + username: types.string, + access_level: types.string + }), + public_metadata: types.anything, + private_metadata: options.optional(types.anything), + admin_metadata: options.optional(types.anything) + }); + /* tslint:enable:align */ + + options.match(template)(matchee).should.be.true; + }); + it('$$ Buy now: unit tests cheap and chearful. only £9.99', () => { + /* tslint:disable:align */ + const matchee: any = [ 'test' ]; + const template = types.array(types.anything); + /* tslint:enable:align */ options.match(template)(matchee).should.be.true; }); |
