Skip to content

Commit

Permalink
Review commented addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajaneeshkumar committed May 17, 2024
1 parent 8f2aad2 commit 5d5788f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/models/Spec.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ declare class Spec {
* sleep after spec execution
* @see https://pactumjs.github.io/api/utils/sleep.html
*/
sleep(ms: number): Promise<void>;
sleep(ms: number): Spec;
}

declare namespace Spec { }
2 changes: 1 addition & 1 deletion src/models/Tosser.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Tosser {
}
return th.getOutput(this.spec, this.spec._returns);
} finally {
this.sleep !== "" && await helper.sleep(this.sleep);
this.sleep > 0 && await helper.sleep(this.sleep);
await this.removeInteractionsFromServer();
this.setPreviousLogLevel();
}
Expand Down
2 changes: 1 addition & 1 deletion test/component/bdd.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('BDD', () => {
it('Should sleep after spec', async () => {
const spec = pactum.spec();
spec.useInteraction('default get');
await spec.get('http://localhost:9393/default/get').expectStatus(200).sleep(2000).toss();
await spec.get('http://localhost:9393/default/get').expectStatus(200).sleep(10).toss();
});

});
Expand Down
2 changes: 1 addition & 1 deletion test/component/spec.handler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ describe('Spec Handler', () => {
id: 2
}
])
.sleep(2000);
.sleep(10);
});
});

0 comments on commit 5d5788f

Please sign in to comment.