Skip to content

Commit

Permalink
Adds missing tests for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Nov 15, 2018
1 parent 5e1468c commit 4e90a5a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yarn-error.log*
.nyc_output
/.rpt2_cache
/node_modules
/coverage
.npm
.node_repl_history
/dist
14 changes: 13 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import OpenApi from './index';
import User from './resources/user';

it('will be constructed with appropriate options', async () => {
it('will be constructed with appropriate required options', async () => {
const instance = new OpenApi({
domain: 'admin',
});
Expand All @@ -12,6 +12,18 @@ it('will be constructed with appropriate options', async () => {
});
});

it('will be constructed with all options', async () => {
const instance = new OpenApi({
domain: 'admin',
version: 'some-version'
});

expect(instance).toHaveProperty('options', {
domain: 'admin',
version: 'some-version',
});
});

it('can access the user resource', async () => {
const instance = new OpenApi({
domain: 'admin',
Expand Down
8 changes: 8 additions & 0 deletions src/resources/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ it('will set assigned filter', async () => {
});
});

it('will set assigned filter to false', async () => {
const resource = new User(mockAxios);

expect(resource.assigned(false)).toHaveProperty('filters', {
assigned: false,
});
});

it('will set location filter using a number', async () => {
const resource = new User(mockAxios);

Expand Down

0 comments on commit 4e90a5a

Please sign in to comment.