Skip to content

Commit

Permalink
upgrade vitest + make konfig-integration-tests an ESM module
Browse files Browse the repository at this point in the history
  • Loading branch information
dphuang2 committed Feb 24, 2024
1 parent 7021279 commit 2509b2f
Show file tree
Hide file tree
Showing 78 changed files with 7,244 additions and 7,243 deletions.
2 changes: 1 addition & 1 deletion generator/konfig-integration-tests/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ integration-tests:
COPY tsconfig.json vitest.config.ts util.ts .
COPY sdks sdks
COPY tests tests
COPY apiServer.js .
COPY apiServer.cjs .
COPY scripts scripts
RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY ./scripts/install-aws-cli.sh
# can be overridden at runtime (e.g. "docker run konfig-integration-tests:latest --testName=TestName")
Expand Down
1 change: 1 addition & 0 deletions generator/konfig-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Suite of integration tests for Konfig",
"main": "index.js",
"license": "MIT",
"type": "module",
"private": true,
"devDependencies": {
"@types/express": "^4.17.21",
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ From within Visual Studio:
1. Open the Solution Explorer.
2. Right-click on a project within your solution.
3. Click on *Manage NuGet Packages...*
4. Click on the *Browse* tab and search for \\"Newscatcherapi.Net\\".
5. Click on the \\"Newscatcherapi.Net\\" package, select the appropriate version in the
4. Click on the *Browse* tab and search for "Newscatcherapi.Net".
5. Click on the "Newscatcherapi.Net" package, select the appropriate version in the
right-tab and click *Install*.
## Getting Started
Expand All @@ -58,37 +58,37 @@ namespace Example
{
NewscatcherClient client = new NewscatcherClient();
// Configure API key authorization: apiKey
client.SetApiKey(\\"YOUR_API_KEY\\");
var authorName = \\"authorName_example\\";
var sources = \\"sources_example\\";
var predefinedSources = \\"predefinedSources_example\\";
var notSources = \\"notSources_example\\";
var lang = \\"lang_example\\";
var notLang = \\"notLang_example\\";
var countries = \\"countries_example\\";
var notCountries = \\"notCountries_example\\";
client.SetApiKey("YOUR_API_KEY");
var authorName = "authorName_example";
var sources = "sources_example";
var predefinedSources = "predefinedSources_example";
var notSources = "notSources_example";
var lang = "lang_example";
var notLang = "notLang_example";
var countries = "countries_example";
var notCountries = "notCountries_example";
var from = new From(DateTime.Now);
var to = new To(DateTime.Now);
var publishedDatePrecision = \\"publishedDatePrecision_example\\";
var publishedDatePrecision = "publishedDatePrecision_example";
var byParseDate = false;
var sortBy = \\"relevancy\\";
var rankedOnly = \\"rankedOnly_example\\";
var sortBy = "relevancy";
var rankedOnly = "rankedOnly_example";
var fromRank = 56;
var toRank = 56;
var isHeadline = true;
var isPaidContent = true;
var parentUrl = \\"parentUrl_example\\";
var allLinks = \\"allLinks_example\\";
var allDomainLinks = \\"allDomainLinks_example\\";
var parentUrl = "parentUrl_example";
var allLinks = "allLinks_example";
var allDomainLinks = "allDomainLinks_example";
var wordCountMin = 56;
var wordCountMax = 56;
var page = 1;
var pageSize = 100;
var includeNlpData = true;
var hasNlp = true;
var theme = \\"theme_example\\";
var nerName = \\"nerName_example\\";
var theme = "theme_example";
var nerName = "nerName_example";
var titleSentimentMin = 8.14D;
var titleSentimentMax = 8.14D;
var contentSentimentMin = 8.14D;
Expand All @@ -102,8 +102,8 @@ namespace Example
}
catch (ApiException e)
{
Console.WriteLine(\\"Exception when calling AuthorsApi.Get: \\" + e.Message);
Console.WriteLine(\\"Status Code: \\"+ e.ErrorCode);
Console.WriteLine("Exception when calling AuthorsApi.Get: " + e.Message);
Console.WriteLine("Status Code: "+ e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
catch (ClientException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ From within Visual Studio:
1. Open the Solution Explorer.
2. Right-click on a project within your solution.
3. Click on *Manage NuGet Packages...*
4. Click on the *Browse* tab and search for \\"CsharpNullableRefUsingAllOfSchema.Net\\".
5. Click on the \\"CsharpNullableRefUsingAllOfSchema.Net\\" package, select the appropriate version in the
4. Click on the *Browse* tab and search for "CsharpNullableRefUsingAllOfSchema.Net".
5. Click on the "CsharpNullableRefUsingAllOfSchema.Net" package, select the appropriate version in the
right-tab and click *Install*.
## Getting Started
Expand All @@ -59,7 +59,7 @@ namespace Example
{
CsharpNullableRefUsingAllOfSchemaClient client = new CsharpNullableRefUsingAllOfSchemaClient();
// Configure API key authorization: ApiKey
client.SetApiKey(\\"YOUR_API_KEY\\");
client.SetApiKey("YOUR_API_KEY");
var input = default(double?);
Expand All @@ -75,8 +75,8 @@ namespace Example
}
catch (ApiException e)
{
Console.WriteLine(\\"Exception when calling TestApi.Fetch: \\" + e.Message);
Console.WriteLine(\\"Status Code: \\"+ e.ErrorCode);
Console.WriteLine("Exception when calling TestApi.Fetch: " + e.Message);
Console.WriteLine("Status Code: "+ e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
catch (ClientException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ From within Visual Studio:
1. Open the Solution Explorer.
2. Right-click on a project within your solution.
3. Click on *Manage NuGet Packages...*
4. Click on the *Browse* tab and search for \\"SnapTrade.Net\\".
5. Click on the \\"SnapTrade.Net\\" package, select the appropriate version in the
4. Click on the *Browse* tab and search for "SnapTrade.Net".
5. Click on the "SnapTrade.Net" package, select the appropriate version in the
right-tab and click *Install*.
## Getting Started
Expand All @@ -59,13 +59,13 @@ namespace Example
{
Snaptrade client = new Snaptrade();
// Configure custom BasePath if desired
// client.SetBasePath(\\"https://api.snaptrade.com/api/v1\\");
client.SetClientId(\\"test\\");
client.SetConsumerKey(\\"test\\");
// client.SetBasePath("https://api.snaptrade.com/api/v1");
client.SetClientId("test");
client.SetConsumerKey("test");
var userId = \\"userId_example\\";
var userSecret = \\"userSecret_example\\";
var brokerageAuthorizations = \\"917c8734-8470-4a3e-a18f-57c3f2ee6631\\"; // Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)
var userId = "userId_example";
var userSecret = "userSecret_example";
var brokerageAuthorizations = "917c8734-8470-4a3e-a18f-57c3f2ee6631"; // Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)
try
{
Expand All @@ -75,8 +75,8 @@ namespace Example
}
catch (ApiException e)
{
Console.WriteLine(\\"Exception when calling AccountInformationApi.GetAllUserHoldings: \\" + e.Message);
Console.WriteLine(\\"Status Code: \\"+ e.ErrorCode);
Console.WriteLine("Exception when calling AccountInformationApi.GetAllUserHoldings: " + e.Message);
Console.WriteLine("Status Code: "+ e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
catch (ClientException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ From within Visual Studio:
1. Open the Solution Explorer.
2. Right-click on a project within your solution.
3. Click on *Manage NuGet Packages...*
4. Click on the *Browse* tab and search for \\"CsharpSplitit.Net\\".
5. Click on the \\"CsharpSplitit.Net\\" package, select the appropriate version in the
4. Click on the *Browse* tab and search for "CsharpSplitit.Net".
5. Click on the "CsharpSplitit.Net" package, select the appropriate version in the
right-tab and click *Install*.
## Getting Started
Expand All @@ -57,13 +57,13 @@ namespace Example
public static void Main()
{
CsharpSplititClient client = new CsharpSplititClient();
// Configure OAuth2 credentials for \\"application\\" OAuth flow
client.SetOAuthClientId(System.Environment.GetEnvironmentVariable(\\"CLIENT_ID\\"));
client.SetOAuthClientSecret(System.Environment.GetEnvironmentVariable(\\"CLIENT_SECRET\\"));
// Configure OAuth2 credentials for "application" OAuth flow
client.SetOAuthClientId(System.Environment.GetEnvironmentVariable("CLIENT_ID"));
client.SetOAuthClientSecret(System.Environment.GetEnvironmentVariable("CLIENT_SECRET"));
var installmentPlanNumber = \\"installmentPlanNumber_example\\";
var xSplititIdempotencyKey = \\"xSplititIdempotencyKey_example\\";
var xSplititTouchPoint = \\"\\"; // TouchPoint (default to \\"\\")
var installmentPlanNumber = "installmentPlanNumber_example";
var xSplititIdempotencyKey = "xSplititIdempotencyKey_example";
var xSplititTouchPoint = ""; // TouchPoint (default to "")
try
{
Expand All @@ -72,8 +72,8 @@ namespace Example
}
catch (ApiException e)
{
Console.WriteLine(\\"Exception when calling InstallmentPlanApi.Cancel: \\" + e.Message);
Console.WriteLine(\\"Status Code: \\"+ e.ErrorCode);
Console.WriteLine("Exception when calling InstallmentPlanApi.Cancel: " + e.Message);
Console.WriteLine("Status Code: "+ e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
catch (ClientException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ go get github.com/decentro-in/decentro-in-collections-sdk/go
package main
import (
\\"fmt\\"
\\"os\\"
decentro_in_collections \\"github.com/decentro-in/decentro-in-collections-sdk/go\\"
"fmt"
"os"
decentro_in_collections "github.com/decentro-in/decentro-in-collections-sdk/go"
)
func main() {
configuration := decentro_in_collections.NewConfiguration()
configuration.SetClientId(\\"CLIENT_ID\\")
configuration.SetClientSecret(\\"CLIENT_SECRET\\")
configuration.SetModuleSecret(\\"MODULE_SECRET\\")
configuration.SetProviderSecret(\\"PROVIDER_SECRET\\")
configuration.SetClientId("CLIENT_ID")
configuration.SetClientSecret("CLIENT_SECRET")
configuration.SetModuleSecret("MODULE_SECRET")
configuration.SetProviderSecret("PROVIDER_SECRET")
client := decentro_in_collections.NewAPIClient(configuration)
generatePaymentLinkRequest := *decentro_in_collections.NewGeneratePaymentLinkRequest(
\\"ABCDEF12345\\",
\\"00000000000000000\\",
"ABCDEF12345",
"00000000000000000",
4,
\\"Welcome to Decentro\\",
"Welcome to Decentro",
0,
)
generatePaymentLinkRequest.SetExpiryTime(10)
Expand All @@ -53,17 +53,17 @@ func main() {
resp, httpRes, err := request.Execute()
if err != nil {
fmt.Fprintf(os.Stderr, \\"Error when calling \`CollectionsApi.GeneratePaymentLink\`\`: %v\\\\n\\", err)
fmt.Fprintf(os.Stderr, \\"Full HTTP response: %v\\\\n\\", httpRes)
fmt.Fprintf(os.Stderr, "Error when calling \`CollectionsApi.GeneratePaymentLink\`\`: %v\\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\\n", httpRes)
}
// response from \`GeneratePaymentLink\`: GeneratePaymentLinkResponse
fmt.Fprintf(os.Stdout, \\"Response from \`CollectionsApi.GeneratePaymentLink\`: %v\\\\n\\", resp)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.DecentroTxnId\`: %v\\\\n\\", *resp.DecentroTxnId)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Status\`: %v\\\\n\\", *resp.Status)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.ResponseCode\`: %v\\\\n\\", *resp.ResponseCode)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Message\`: %v\\\\n\\", *resp.Message)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Data\`: %v\\\\n\\", *resp.Data)
fmt.Fprintf(os.Stdout, \\"Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.ResponseKey\`: %v\\\\n\\", *resp.ResponseKey)
fmt.Fprintf(os.Stdout, "Response from \`CollectionsApi.GeneratePaymentLink\`: %v\\n", resp)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.DecentroTxnId\`: %v\\n", *resp.DecentroTxnId)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Status\`: %v\\n", *resp.Status)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.ResponseCode\`: %v\\n", *resp.ResponseCode)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Message\`: %v\\n", *resp.Message)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.Data\`: %v\\n", *resp.Data)
fmt.Fprintf(os.Stdout, "Response from \`GeneratePaymentLinkResponse.GeneratePaymentLink.ResponseKey\`: %v\\n", *resp.ResponseKey)
}
\`\`\`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,47 @@ go get github.com/konfig-dev/newscatcher-go-sdk/go
package main
import (
\\"fmt\\"
\\"os\\"
newscatcherapi \\"github.com/konfig-dev/newscatcher-go-sdk/go\\"
"fmt"
"os"
newscatcherapi "github.com/konfig-dev/newscatcher-go-sdk/go"
)
func main() {
configuration := newscatcherapi.NewConfiguration()
configuration.SetApiKey(\\"X_API_TOKEN\\")
configuration.SetApiKey("X_API_TOKEN")
client := newscatcherapi.NewAPIClient(configuration)
request := client.AuthorsApi.Get(
\\"authorName_example\\",
"authorName_example",
)
request.Sources(\\"sources_example\\")
request.PredefinedSources(\\"predefinedSources_example\\")
request.NotSources(\\"notSources_example\\")
request.Lang(\\"lang_example\\")
request.NotLang(\\"notLang_example\\")
request.Countries(\\"countries_example\\")
request.NotCountries(\\"notCountries_example\\")
request.Sources("sources_example")
request.PredefinedSources("predefinedSources_example")
request.NotSources("notSources_example")
request.Lang("lang_example")
request.NotLang("notLang_example")
request.Countries("countries_example")
request.NotCountries("notCountries_example")
request.From(from)
request.To(to)
request.PublishedDatePrecision(\\"publishedDatePrecision_example\\")
request.PublishedDatePrecision("publishedDatePrecision_example")
request.ByParseDate(false)
request.SortBy(\\"\\"relevancy\\"\\")
request.RankedOnly(\\"rankedOnly_example\\")
request.SortBy(""relevancy"")
request.RankedOnly("rankedOnly_example")
request.FromRank(56)
request.ToRank(56)
request.IsHeadline(true)
request.IsPaidContent(true)
request.ParentUrl(\\"parentUrl_example\\")
request.AllLinks(\\"allLinks_example\\")
request.AllDomainLinks(\\"allDomainLinks_example\\")
request.ParentUrl("parentUrl_example")
request.AllLinks("allLinks_example")
request.AllDomainLinks("allDomainLinks_example")
request.WordCountMin(56)
request.WordCountMax(56)
request.Page(1)
request.PageSize(100)
request.IncludeNlpData(true)
request.HasNlp(true)
request.Theme(\\"theme_example\\")
request.NerName(\\"nerName_example\\")
request.Theme("theme_example")
request.NerName("nerName_example")
request.TitleSentimentMin(8.14)
request.TitleSentimentMax(8.14)
request.ContentSentimentMin(8.14)
Expand All @@ -69,18 +69,18 @@ func main() {
resp, httpRes, err := request.Execute()
if err != nil {
fmt.Fprintf(os.Stderr, \\"Error when calling \`AuthorsApi.Get\`\`: %v\\\\n\\", err)
fmt.Fprintf(os.Stderr, \\"Full HTTP response: %v\\\\n\\", httpRes)
fmt.Fprintf(os.Stderr, "Error when calling \`AuthorsApi.Get\`\`: %v\\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\\n", httpRes)
}
// response from \`Get\`: AuthorsGetResponse
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsApi.Get\`: %v\\\\n\\", resp)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.Status\`: %v\\\\n\\", *resp.Status)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.TotalHits\`: %v\\\\n\\", resp.TotalHits)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.Page\`: %v\\\\n\\", resp.Page)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.TotalPages\`: %v\\\\n\\", resp.TotalPages)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.PageSize\`: %v\\\\n\\", resp.PageSize)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.Articles\`: %v\\\\n\\", resp.Articles)
fmt.Fprintf(os.Stdout, \\"Response from \`AuthorsGetResponse.Get.UserInput\`: %v\\\\n\\", resp.UserInput)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsApi.Get\`: %v\\n", resp)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.Status\`: %v\\n", *resp.Status)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.TotalHits\`: %v\\n", resp.TotalHits)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.Page\`: %v\\n", resp.Page)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.TotalPages\`: %v\\n", resp.TotalPages)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.PageSize\`: %v\\n", resp.PageSize)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.Articles\`: %v\\n", resp.Articles)
fmt.Fprintf(os.Stdout, "Response from \`AuthorsGetResponse.Get.UserInput\`: %v\\n", resp.UserInput)
}
\`\`\`
Expand Down
Loading

0 comments on commit 2509b2f

Please sign in to comment.