Skip to content

Commit

Permalink
Merge pull request #225 from pactumjs/222-mockaddinteraction-not-work…
Browse files Browse the repository at this point in the history
…ing-typescript

fix: typescript definitions for mock and reporter
  • Loading branch information
ASaiAnudeep authored Oct 22, 2022
2 parents b818606 + 778aae8 commit 0d9accf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pactum",
"version": "3.2.2",
"version": "3.2.3",
"description": "REST API Testing Tool for all levels in a Test Pyramid",
"main": "./src/index.js",
"types": "./src/index.d.ts",
Expand Down
7 changes: 2 additions & 5 deletions src/exports/mock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ export interface InteractionRequest {
export interface InteractionResponse {
status: number;
headers?: object;
body?: object;
body?: any;
file?: string;
fixedDelay?: number;
randomDelay?: RandomDelay;
onCall?: OnCall
}

export interface RandomDelay {
Expand All @@ -34,10 +35,6 @@ export interface OnCall {
[key: number]: InteractionResponse
}

export interface InteractionResponse {
onCall?: OnCall
}

export interface InteractionExpectations {
disable?: boolean;
exercised?: boolean;
Expand Down
12 changes: 6 additions & 6 deletions src/exports/reporter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export interface SpecData {
}

export interface Reporter {
name: string;
afterSpec(data: SpecData): void;
afterStep(data: object): void;
afterTest(data: object): void;
afterInteraction(data: ExercisedInteraction): void;
end(): void | Promise<void>
name?: string;
afterSpec?(data: SpecData): void;
afterStep?(data: object): void;
afterTest?(data: object): void;
afterInteraction?(data: ExercisedInteraction): void;
end?(): void | Promise<void>
}

/**
Expand Down

0 comments on commit 0d9accf

Please sign in to comment.