-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cts): group tests per method (#53)
- Loading branch information
Showing
8 changed files
with
131 additions
and
171 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,18 +1,21 @@ | ||
// @ts-nocheck | ||
import { {{client}}, EchoRequester } from '{{{import}}}'; | ||
|
||
describe('Common Test Suite', () => { | ||
const client = new {{client}}(process.env.ALGOLIA_APPLICATION_ID, process.env.ALGOLIA_SEARCH_KEY, { requester: new EchoRequester() }); | ||
const client = new {{client}}(process.env.ALGOLIA_APPLICATION_ID, process.env.ALGOLIA_SEARCH_KEY, { requester: new EchoRequester() }); | ||
|
||
{{#tests}} | ||
test('{{testName}}', async () => { | ||
const req = await client.{{method}}({{#parameters}}{{{value}}}{{^-last}}, {{/-last}}{{/parameters}}); | ||
expect(req).toMatchObject({ | ||
path: '{{{request.path}}}', | ||
method: '{{{request.method}}}', | ||
{{#request.data}}data: {{{.}}},{{/request.data}} | ||
}) | ||
}); | ||
{{#blocks}} | ||
describe('{{operationId}}', () => { | ||
{{#tests}} | ||
test('{{testName}}', async () => { | ||
const req = await client.{{method}}({{#parameters}}{{{value}}}{{^-last}}, {{/-last}}{{/parameters}}); | ||
expect(req).toMatchObject({ | ||
path: '{{{request.path}}}', | ||
method: '{{{request.method}}}', | ||
{{#request.data}}data: {{{.}}},{{/request.data}} | ||
}) | ||
}); | ||
|
||
{{/tests}} | ||
}); | ||
{{/tests}} | ||
}) | ||
|
||
{{/blocks}} |
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
Oops, something went wrong.