Skip to content

chore: fix setup-app-deps gha and api test types#1536

Merged
stalniy merged 1 commit intomainfrom
chore/fix-setup-app-deps
Jun 24, 2025
Merged

chore: fix setup-app-deps gha and api test types#1536
stalniy merged 1 commit intomainfrom
chore/fix-setup-app-deps

Conversation

@stalniy
Copy link
Contributor

@stalniy stalniy commented Jun 24, 2025

Summary by CodeRabbit

  • Chores
    • Updated test suites to use explicit TypeScript type assertions when parsing JSON responses, improving type safety and consistency across all functional and service tests.
    • Adjusted GitHub Action workflow to install dependencies for specific app directories instead of the entire repository, optimizing workflow efficiency.

@stalniy stalniy requested a review from a team as a code owner June 24, 2025 03:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 24, 2025

Walkthrough

This update introduces explicit TypeScript type assertions for JSON-parsed HTTP responses across numerous functional test files and a service in the API app. Additionally, the GitHub Actions workflow for setting up app dependencies is modified to install Node.js dependencies only for a specified app workspace, rather than the entire repository.

Changes

File(s) Change Summary
.github/actions/setup-app-deps/action.yml Updated npm install command to use -w apps/${{ inputs.app }} for workspace-scoped dependency installation.
apps/api/test/functional/*.spec.ts
(anonymous-user, api-key, auditors, balances, bids, blocks, dashboard-data, deployment-setting, deployments, graph-data, lease-flow, leases-duration, market-data, provider-attributes-schema, provider-dashboard, provider-deployments, provider-graph-data, provider-regions, providers, sign-and-broadcast-tx, start-trial, transactions, usage)
Added explicit TypeScript type assertions (mostly as any or specific types) to JSON-parsed HTTP responses in tests.
apps/api/test/services/wallet-testing.service.ts Added explicit as any type assertions to parsed JSON responses in service methods.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant npm
    participant App Workspace

    GitHub Actions->>npm: npm ci -w apps/${{ inputs.app }}
    npm->>App Workspace: Install dependencies for specified app
    App Workspace-->>npm: Dependencies installed
    npm-->>GitHub Actions: Installation complete
Loading

Possibly related PRs

Suggested reviewers

  • ygrishajev

Poem

In the warren where TypeScript grows,
Rabbits hop where the JSON flows.
With as any now in every test,
Type safety’s put to the quest.
Actions install with focused might,
Each workspace gets its own delight.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-24T14_08_44_616Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0860def and a557a0f.

📒 Files selected for processing (25)
  • .github/actions/setup-app-deps/action.yml (1 hunks)
  • apps/api/test/functional/anonymous-user.spec.ts (2 hunks)
  • apps/api/test/functional/api-key.spec.ts (4 hunks)
  • apps/api/test/functional/auditors.spec.ts (1 hunks)
  • apps/api/test/functional/balances.spec.ts (2 hunks)
  • apps/api/test/functional/bids.spec.ts (3 hunks)
  • apps/api/test/functional/blocks.spec.ts (2 hunks)
  • apps/api/test/functional/dashboard-data.spec.ts (1 hunks)
  • apps/api/test/functional/deployment-setting.spec.ts (3 hunks)
  • apps/api/test/functional/deployments.spec.ts (10 hunks)
  • apps/api/test/functional/graph-data.spec.ts (1 hunks)
  • apps/api/test/functional/lease-flow.spec.ts (10 hunks)
  • apps/api/test/functional/leases-duration.spec.ts (1 hunks)
  • apps/api/test/functional/market-data.spec.ts (2 hunks)
  • apps/api/test/functional/provider-attributes-schema.spec.ts (1 hunks)
  • apps/api/test/functional/provider-dashboard.spec.ts (2 hunks)
  • apps/api/test/functional/provider-deployments.spec.ts (3 hunks)
  • apps/api/test/functional/provider-graph-data.spec.ts (2 hunks)
  • apps/api/test/functional/provider-regions.spec.ts (1 hunks)
  • apps/api/test/functional/providers.spec.ts (4 hunks)
  • apps/api/test/functional/sign-and-broadcast-tx.spec.ts (1 hunks)
  • apps/api/test/functional/start-trial.spec.ts (1 hunks)
  • apps/api/test/functional/transactions.spec.ts (2 hunks)
  • apps/api/test/functional/usage.spec.ts (3 hunks)
  • apps/api/test/services/wallet-testing.service.ts (3 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/api/test/functional/start-trial.spec.ts
  • apps/api/test/functional/anonymous-user.spec.ts
  • apps/api/test/functional/provider-dashboard.spec.ts
🚧 Files skipped from review as they are similar to previous changes (22)
  • apps/api/test/functional/sign-and-broadcast-tx.spec.ts
  • apps/api/test/functional/market-data.spec.ts
  • apps/api/test/functional/dashboard-data.spec.ts
  • apps/api/test/functional/transactions.spec.ts
  • .github/actions/setup-app-deps/action.yml
  • apps/api/test/functional/balances.spec.ts
  • apps/api/test/functional/leases-duration.spec.ts
  • apps/api/test/functional/blocks.spec.ts
  • apps/api/test/functional/provider-graph-data.spec.ts
  • apps/api/test/functional/deployments.spec.ts
  • apps/api/test/functional/api-key.spec.ts
  • apps/api/test/functional/auditors.spec.ts
  • apps/api/test/functional/graph-data.spec.ts
  • apps/api/test/functional/providers.spec.ts
  • apps/api/test/functional/provider-regions.spec.ts
  • apps/api/test/functional/provider-attributes-schema.spec.ts
  • apps/api/test/functional/provider-deployments.spec.ts
  • apps/api/test/services/wallet-testing.service.ts
  • apps/api/test/functional/deployment-setting.spec.ts
  • apps/api/test/functional/bids.spec.ts
  • apps/api/test/functional/usage.spec.ts
  • apps/api/test/functional/lease-flow.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test-api-build
  • GitHub Check: validate-api
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.57%. Comparing base (7bca260) to head (a557a0f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1536    +/-   ##
========================================
  Coverage   40.57%   40.57%            
========================================
  Files         872      872            
  Lines       21217    21217            
  Branches     3876     3876            
========================================
  Hits         8608     8608            
+ Misses      12030    11892   -138     
- Partials      579      717   +138     
Flag Coverage Δ *Carryforward flag
api 71.33% <ø> (ø)
deploy-web 18.89% <ø> (ø) Carriedforward from 7bca260
notifications 87.87% <ø> (ø) Carriedforward from 7bca260
provider-proxy 82.13% <ø> (ø) Carriedforward from 7bca260

*This pull request uses carry forward flags. Click here to find out more.

see 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stalniy stalniy force-pushed the chore/fix-setup-app-deps branch from a8881b9 to 0860def Compare June 24, 2025 13:03
@stalniy stalniy enabled auto-merge (squash) June 24, 2025 13:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (6)
apps/api/test/functional/bids.spec.ts (1)

31-59: Replace beforeEach with setup function per coding guidelines.

According to the coding guidelines, test files should use a setup function instead of beforeEach for test setup. The setup function should be at the bottom of the root describe block, create and return the object under test, accept a single parameter with inline type definition, avoid shared state, and should not specify a return type.

Consider refactoring to use a setup function pattern like this:

-  beforeEach(() => {
-    knownUsers = {};
-    knownApiKeys = {};
-    knownWallets = {};
-    // ... existing setup logic
-  });

+  const setup = (options: { dseq?: string } = {}) => {
+    const knownUsers: Record<string, UserOutput> = {};
+    const knownApiKeys: Record<string, ApiKeyOutput> = {};
+    const knownWallets: Record<string, UserWalletOutput[]> = {};
+    
+    // ... setup logic here
+    
+    return { knownUsers, knownApiKeys, knownWallets };
+  };
apps/api/test/functional/api-key.spec.ts (1)

58-62: Replace beforeEach with setup function per coding guidelines.

According to the coding guidelines, test files should use a setup function instead of beforeEach for test setup. The setup function should be at the bottom of the root describe block, create and return the object under test, accept a single parameter with inline type definition, avoid shared state, and should not specify a return type.

Consider refactoring to use a setup function pattern like this:

-  beforeEach(async () => {
-    config = stub<CoreConfigService>({ get: jest.fn() });
-    config.get.mockReturnValue("test");
-    apiKeyGenerator = new ApiKeyGeneratorService(config);
-  });

Move this to a setup function at the bottom of the describe block:

+  const setup = (options: { returnValue?: string } = {}) => {
+    const config = stub<CoreConfigService>({ get: jest.fn() });
+    config.get.mockReturnValue(options.returnValue || "test");
+    const apiKeyGenerator = new ApiKeyGeneratorService(config);
+    
+    return { config, apiKeyGenerator };
+  };
apps/api/test/functional/anonymous-user.spec.ts (1)

8-16: Replace beforeEach with setup function to follow coding guidelines.

According to the coding guidelines, test files should use a setup function instead of beforeEach. The setup function should be at the bottom of the root describe block, create and return the object under test, accept a single parameter with inline type definition, and avoid shared state.

Consider refactoring to this pattern:

-  beforeEach(async () => {
-    const userResponse = await app.request("/v1/anonymous-users", {
-      method: "POST",
-      headers: new Headers({ "Content-Type": "application/json" })
-    });
-    const body = (await userResponse.json()) as any;
-    user = body.data;
-    token = body.token;
-  });

And add a setup function at the bottom:

+  async function setup() {
+    const userResponse = await app.request("/v1/anonymous-users", {
+      method: "POST",
+      headers: new Headers({ "Content-Type": "application/json" })
+    });
+    const body = (await userResponse.json()) as any;
+    return { user: body.data, token: body.token };
+  }

Then update tests to call setup() as needed.

apps/api/test/functional/deployment-setting.spec.ts (1)

18-24: Violation: Use setup function instead of beforeEach per coding guidelines.

The coding guidelines specify that **/*.spec.{ts,tsx} files should use a setup function instead of beforeEach for test setup. The setup function must be at the bottom of the root describe block, create and return the object under test, accept a single parameter with inline type definition, avoid shared state, and should not specify a return type.

Consider refactoring to use a setup function:

- beforeEach(() => {
-   jest.spyOn(leaseRepository, "findOneByDseqAndOwner").mockResolvedValue(DrainingDeploymentSeeder.create());
- });
- 
- afterEach(async () => {
-   jest.restoreAllMocks();
- });
+ function setup() {
+   jest.spyOn(leaseRepository, "findOneByDseqAndOwner").mockResolvedValue(DrainingDeploymentSeeder.create());
+   
+   return {
+     // return test objects
+   };
+ }
apps/api/test/functional/lease-flow.spec.ts (1)

84-95: Violation: Use setup function instead of beforeEach per coding guidelines.

This file violates the coding guidelines that require **/*.spec.{ts,tsx} files to use a setup function instead of beforeEach for test setup.

apps/api/test/functional/deployments.spec.ts (1)

45-94: Violation: Use setup function instead of beforeEach per coding guidelines.

This file violates the coding guidelines requiring **/*.spec.{ts,tsx} files to use a setup function instead of beforeEach for test setup. Consider refactoring the mock setup logic into a setup function at the bottom of the root describe block.

♻️ Duplicate comments (1)
apps/api/test/functional/market-data.spec.ts (1)

79-81: Duplicate of previous comment – same any casting issue.

🧹 Nitpick comments (4)
apps/api/test/functional/start-trial.spec.ts (1)

29-32: Replace any with a typed interface to preserve type-safety

Casting the JSON payload to any erodes the very benefit of having TypeScript in tests.
A lightweight local interface keeps the code self-documenting while retaining compile-time checks:

-      } = (await userResponse.json()) as any;
+      } = (await userResponse.json()) as {
+        data: { id: string };
+        token: string;
+      };

No further changes are required elsewhere because the destructured variables already match the interface shape.

apps/api/test/functional/market-data.spec.ts (1)

46-48: Prefer a typed response over any

The response schema is fully known and stable in this test.
Introduce a minimal interface instead of falling back to any:

-      const data = (await response.json()) as any;
+      const data = (await response.json()) as {
+        price: number;
+        volume: number;
+        marketCap: number;
+        marketCapRank: number;
+        priceChange24h: number;
+        priceChangePercentage24: number;
+      };

This shields future refactors from silent breakage.

apps/api/test/functional/sign-and-broadcast-tx.spec.ts (1)

47-48: Inline type instead of any for better IDE support

-      const { token } = (await differentUserResponse.json()) as any;
+      const { token } = (await differentUserResponse.json()) as { token: string };

A one-liner type keeps the intent explicit without polluting the file with extra declarations.

apps/api/test/functional/provider-attributes-schema.spec.ts (1)

6-9: Replace any with a structural type

Even a broad structural type is better than any here:

-      const data = (await response.json()) as any;
+      const data = (await response.json()) as Record<
+        string,
+        { key: string; type: string; required: boolean; description: string; values?: unknown[] }
+      >;

This ensures the subsequent property assertions stay aligned with the expected schema.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9beccd and 0860def.

📒 Files selected for processing (25)
  • .github/actions/setup-app-deps/action.yml (1 hunks)
  • apps/api/test/functional/anonymous-user.spec.ts (2 hunks)
  • apps/api/test/functional/api-key.spec.ts (4 hunks)
  • apps/api/test/functional/auditors.spec.ts (1 hunks)
  • apps/api/test/functional/balances.spec.ts (2 hunks)
  • apps/api/test/functional/bids.spec.ts (3 hunks)
  • apps/api/test/functional/blocks.spec.ts (2 hunks)
  • apps/api/test/functional/dashboard-data.spec.ts (1 hunks)
  • apps/api/test/functional/deployment-setting.spec.ts (3 hunks)
  • apps/api/test/functional/deployments.spec.ts (10 hunks)
  • apps/api/test/functional/graph-data.spec.ts (1 hunks)
  • apps/api/test/functional/lease-flow.spec.ts (10 hunks)
  • apps/api/test/functional/leases-duration.spec.ts (1 hunks)
  • apps/api/test/functional/market-data.spec.ts (2 hunks)
  • apps/api/test/functional/provider-attributes-schema.spec.ts (1 hunks)
  • apps/api/test/functional/provider-dashboard.spec.ts (2 hunks)
  • apps/api/test/functional/provider-deployments.spec.ts (3 hunks)
  • apps/api/test/functional/provider-graph-data.spec.ts (2 hunks)
  • apps/api/test/functional/provider-regions.spec.ts (1 hunks)
  • apps/api/test/functional/providers.spec.ts (4 hunks)
  • apps/api/test/functional/sign-and-broadcast-tx.spec.ts (1 hunks)
  • apps/api/test/functional/start-trial.spec.ts (1 hunks)
  • apps/api/test/functional/transactions.spec.ts (2 hunks)
  • apps/api/test/functional/usage.spec.ts (3 hunks)
  • apps/api/test/services/wallet-testing.service.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.spec.{ts,tsx}`: Use a `setup` function instead of `beforeEach` for test setup. The `setup` function must be at the bottom of the root `describe` block, create and return the ...

**/*.spec.{ts,tsx}: Use a setup function instead of beforeEach for test setup. The setup function must be at the bottom of the root describe block, create and return the object under test, accept a single parameter with inline type definition, avoid shared state, and should not specify a return type.

  • apps/api/test/functional/start-trial.spec.ts
  • apps/api/test/functional/sign-and-broadcast-tx.spec.ts
  • apps/api/test/functional/provider-regions.spec.ts
  • apps/api/test/functional/provider-attributes-schema.spec.ts
  • apps/api/test/functional/market-data.spec.ts
  • apps/api/test/functional/provider-dashboard.spec.ts
  • apps/api/test/functional/provider-deployments.spec.ts
  • apps/api/test/functional/blocks.spec.ts
  • apps/api/test/functional/dashboard-data.spec.ts
  • apps/api/test/functional/auditors.spec.ts
  • apps/api/test/functional/balances.spec.ts
  • apps/api/test/functional/bids.spec.ts
  • apps/api/test/functional/api-key.spec.ts
  • apps/api/test/functional/transactions.spec.ts
  • apps/api/test/functional/providers.spec.ts
  • apps/api/test/functional/lease-flow.spec.ts
  • apps/api/test/functional/graph-data.spec.ts
  • apps/api/test/functional/leases-duration.spec.ts
  • apps/api/test/functional/provider-graph-data.spec.ts
  • apps/api/test/functional/deployment-setting.spec.ts
  • apps/api/test/functional/anonymous-user.spec.ts
  • apps/api/test/functional/usage.spec.ts
  • apps/api/test/functional/deployments.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: validate-api
  • GitHub Check: test-api-build
🔇 Additional comments (25)
apps/api/test/functional/transactions.spec.ts (1)

42-42: LGTM! Type assertions improve TypeScript safety.

The explicit type assertions as any for JSON responses appropriately handle the API response typing while maintaining test flexibility.

Also applies to: 64-64

apps/api/test/functional/leases-duration.spec.ts (1)

138-138: LGTM! Type assertion enhances type safety in helper function.

The explicit as any type assertion on the JSON response in the expectLeasesDuration helper function appropriately handles API response typing.

apps/api/test/functional/blocks.spec.ts (1)

42-42: LGTM! Consistent type assertions improve code clarity.

The explicit as any type assertions for JSON responses align with the broader test suite typing improvements and enhance TypeScript safety.

Also applies to: 64-64

apps/api/test/functional/graph-data.spec.ts (1)

189-189: LGTM! Type assertion improves code explicitness.

The as any type assertion on the JSON response appropriately handles the dynamic nature of different graph data types in the test loop.

apps/api/test/functional/auditors.spec.ts (1)

9-9: LGTM! Excellent use of specific type assertion.

The explicit type assertion using AuditorListResponse provides better type safety than generic any while maintaining consistency with the broader test suite typing improvements.

apps/api/test/functional/bids.spec.ts (1)

128-128: LGTM! Type assertions improve type safety.

The explicit type assertions (await response.json()) as any enhance type clarity and safety in the test code while maintaining the same functionality.

Also applies to: 147-147, 167-167

apps/api/test/functional/dashboard-data.spec.ts (1)

208-208: LGTM! Type assertion improves type safety.

The explicit type assertion (await response.json()) as any enhances type clarity in the test code.

apps/api/test/functional/provider-dashboard.spec.ts (1)

40-40: LGTM! Type assertions improve type safety.

The explicit type assertions (await response.json()) as any enhance type clarity and safety in both the success and error response handling.

Also applies to: 54-54

apps/api/test/functional/api-key.spec.ts (1)

149-149: LGTM! Type assertions improve type safety.

The explicit type assertions (await response.json()) as any enhance type clarity and safety across all API key test operations.

Also applies to: 196-196, 243-243, 356-356

apps/api/test/functional/provider-deployments.spec.ts (1)

140-140: LGTM! Type assertions improve type safety.

The explicit type assertions (await response.json()) as any enhance type clarity and safety across all provider deployment test scenarios.

Also applies to: 150-150, 160-160

apps/api/test/functional/providers.spec.ts (1)

106-106: Consistent type assertion pattern applied correctly.

The explicit as any type assertions improve type safety and align with the repository-wide standardization of JSON response handling in tests.

Also applies to: 115-115, 124-124, 135-135

apps/api/test/services/wallet-testing.service.ts (1)

15-15: Type assertions improve consistency across service methods.

The as any assertions align with the repository-wide pattern for JSON response handling and provide appropriate flexibility for varied API response structures.

Also applies to: 25-25, 34-34

apps/api/test/functional/balances.spec.ts (2)

47-47: Type assertions follow established pattern.

The as any assertions are consistent with the repository-wide standardization effort for JSON response handling.

Also applies to: 76-76


106-224: Setup function follows coding guidelines correctly.

The setup function is properly positioned at the bottom of the describe block, accepts a parameter with inline type definition, creates and returns test objects, and avoids shared state.

apps/api/test/functional/anonymous-user.spec.ts (1)

13-13: Type assertions follow established pattern.

The as any assertions are consistent with the repository-wide standardization effort.

Also applies to: 55-55

apps/api/test/functional/provider-graph-data.spec.ts (1)

209-209: Type assertions maintain consistency across test suite.

The as any assertions follow the established pattern for JSON response handling and improve type safety without affecting test logic.

Also applies to: 284-284

apps/api/test/functional/deployment-setting.spec.ts (1)

181-181: LGTM! Type assertions improve type safety.

The explicit type assertions for JSON responses enhance type safety and clearly document the expected response structure.

Also applies to: 234-234, 305-305

apps/api/test/functional/lease-flow.spec.ts (1)

107-107: LGTM! Type assertions enhance code clarity and safety.

The explicit type assertions for JSON responses improve type safety. Good use of specific types like BidResponse[] where available, and any as fallback for complex response structures.

Also applies to: 130-130, 141-141, 155-155, 166-166, 202-202, 222-222, 242-242, 251-251, 263-263

apps/api/test/functional/usage.spec.ts (3)

4-4: LGTM! Added proper type import.

Adding the UsageHistoryStats import enables proper type assertions throughout the file.


280-280: LGTM! Improved type safety with specific type assertions.

Using specific imported types (UsageHistoryResponse, UsageHistoryStats) instead of generic casting improves type safety and code clarity.

Also applies to: 417-417


412-433: Partial compliance: setup function used correctly here.

This describe block correctly implements the setup function pattern as required by coding guidelines. The setup function is defined within the describe block and returns the necessary test utilities.

.github/actions/setup-app-deps/action.yml (1)

30-30: LGTM! Performance optimization for workspace-specific dependency installation.

Scoping npm ci to the specific app workspace (-w apps/${{ inputs.app }}) is a good optimization that installs only the necessary dependencies for the target app, improving build performance and reducing unnecessary installations.

apps/api/test/functional/deployments.spec.ts (3)

218-218: LGTM! Type assertions improve response handling.

The explicit type assertions for JSON responses enhance type safety and document expected response structures. Good use of specific types like { data: unknown } and { owner: string; dseq: string }.

Also applies to: 274-274, 413-413, 685-685, 850-850


313-313: Good type safety with specific array typing.

The type assertion { data: { deployments: unknown[] } } properly types the deployments array structure, enabling safe access to array properties in the test assertions.

Also applies to: 315-321


457-457: Consistent error response typing.

Using { message: string } type assertion for error responses provides consistent typing for error message validation.

Also applies to: 476-476, 765-765

@stalniy stalniy force-pushed the chore/fix-setup-app-deps branch from 0860def to a557a0f Compare June 24, 2025 14:07
@stalniy stalniy disabled auto-merge June 24, 2025 14:34
@stalniy stalniy merged commit ca1973a into main Jun 24, 2025
30 of 31 checks passed
@stalniy stalniy deleted the chore/fix-setup-app-deps branch June 24, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments