-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): Request Panel > Script > generate test scripts button (#274)…
… > updatePlugin doesn't show updated test scripts until you refresh the page
- Loading branch information
1 parent
a41ee9c
commit 36d22ea
Showing
2 changed files
with
16 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import dedent from 'dedent' | ||
|
||
export async function generateTestScripts() { | ||
return ` | ||
test('Status code is 200', () => { | ||
expect(rf.response.getStatusCode()).to.eql(200) | ||
}) | ||
return dedent` | ||
test('Status code is 200', () => { | ||
expect(rf.response.getStatusCode()).to.eql(200) | ||
}) | ||
test('Response time is less than 500ms', () => { | ||
expect(rf.response.getResponseTime()).to.below(600) | ||
}) | ||
test('Response time is less than 500ms', () => { | ||
expect(rf.response.getResponseTime()).to.below(600) | ||
}) | ||
test('Body is not empty', () => { | ||
expect(rf.response.getBodyJSON()).to.not.be.empty | ||
}) | ||
test('Body is not empty', () => { | ||
expect(rf.response.getBodyJSON()).to.not.be.empty | ||
}) | ||
test('headers are not empty', () => { | ||
expect(rf.response.getHeaders()).to.not.be.empty | ||
}) | ||
test('headers are not empty', () => { | ||
expect(rf.response.getHeaders()).to.not.be.empty | ||
}) | ||
` | ||
} |