Skip to content

fix(test): resolve linting issues in translate_batch_translate_text.test.js#4345

Open
angelcaamal wants to merge 4 commits into
mainfrom
fix/translate-test-lint
Open

fix(test): resolve linting issues in translate_batch_translate_text.test.js#4345
angelcaamal wants to merge 4 commits into
mainfrom
fix/translate-test-lint

Conversation

@angelcaamal

@angelcaamal angelcaamal commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

This PR addresses linting and formatting issues identified in translate_batch_translate_text.test.js.

Changes:

  1. Fixed indentation inconsistencies throughout the test file to comply with project standards.
  2. Refactored file deletion logic: replaced the manual for-loop with await bucket.deleteFiles(options) for better performance and readability.

Fixes Internal: b/524742483

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • Required CI tests pass (see CI testing)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

Note: Any check with (dev), (experimental), or (legacy) can be ignored and should not block your PR from merging (see CI testing).

@angelcaamal angelcaamal added samples Issues that are directly related to samples. api: translate Issues related to the Cloud Translation API. labels Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a non-standard parenthesized grouping around Mocha hooks and tests in translate_batch_translate_text.test.js. The review feedback recommends reverting this change to restore standard Mocha test structure and improve readability.

Comment thread translate/test/v3/translate_batch_translate_text.test.js Outdated
Comment thread translate/test/v3/translate_batch_translate_text.test.js Outdated
@angelcaamal

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request corrects syntax and formatting in the batch translation test file, replacing incorrect comma separators with semicolons and fixing block indentation. Feedback suggests simplifying the cleanup logic in the after hook by using the built-in bucket.deleteFiles(options) method instead of manually fetching and deleting files individually.

Comment thread translate/test/v3/translate_batch_translate_text.test.js Outdated
@angelcaamal angelcaamal marked this pull request as ready for review June 16, 2026 21:22
@angelcaamal angelcaamal requested review from a team as code owners June 16, 2026 21:22

@Kef131 Kef131 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: translate Issues related to the Cloud Translation API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants