Skip to content

Commit

Permalink
add type assertion test for client.create* method param
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrpravosudko-okta committed Apr 6, 2021
1 parent 15e5eb2 commit 740abf9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/type/client.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { expectError, expectType } from 'tsd';
import { Response } from 'node-fetch';
import { Client } from '../../src/types/client';
import { Collection } from '../../src/types/collection';
import { Application } from '../../src/types/models/Application';
import { Application, ApplicationOptions } from '../../src/types/models/Application';
import { InlineHook } from '../../src/types/models/InlineHook';


const client = new Client();
Expand All @@ -16,3 +17,9 @@ expectError(client.deleteApplicationUser('appId', 'userId', {sendEmail: 0}));
// Client methods return either Promise or Collection
expectType<Promise<Response>>(client.deletePolicy('policyId'));
expectType<Collection<Application>>(client.listApplications());

// methods expecting body request parameters
const appOptions: ApplicationOptions = {
name: 'oidc_app',
};
expectType<Promise<Application>>(client.createApplication(appOptions)):

0 comments on commit 740abf9

Please sign in to comment.