Skip to content

Commit

Permalink
Adds test for property instance
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Nov 15, 2018
1 parent 2f4902b commit 5e1468c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import OpenApi from './index';
import User from './resources/user';

it('will be constructed with appropriate options', async () => {
const instance = new OpenApi({
Expand All @@ -10,3 +11,12 @@ it('will be constructed with appropriate options', async () => {
version: 'v2',
});
});

it('can access the user resource', async () => {
const instance = new OpenApi({
domain: 'admin',
});

expect(instance).toHaveProperty('users');
expect(instance.users).toBeInstanceOf(User.prototype.constructor);
});

0 comments on commit 5e1468c

Please sign in to comment.