fix: tests fails#139
Conversation
📝 WalkthroughWalkthroughYandexTranslator is moved from stable to unstable exports due to test failures. Documentation and barrel exports are updated, internal import paths are corrected, tests are adjusted to exclude it, package version bumps to 3.4.0, and dev dependencies are downgraded with type safety improvements. ChangesYandexTranslator Reclassification
Package & Build Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
87-110:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUpdate the Yandex example import path to unstable.
YandexTranslatoris now documented as unstable, but the example still imports it from the stable barrel. That will break for users following the README.📌 Proposed doc fix
- import { YandexTranslator } from 'anylang/translators'; + import { YandexTranslator } from 'anylang/translators/unstable';🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` around lines 87 - 110, The README example imports YandexTranslator from the stable barrel but YandexTranslator is in the unstable subdirectory; update the import path in the example so the import uses the unstable barrel (replace import { YandexTranslator } from 'anylang/translators' with the unstable import path) to prevent broken examples for users trying to instantiate YandexTranslator in the README example.
🧹 Nitpick comments (1)
src/translators/__tests__/benchmark.ts (1)
1-4: ⚡ Quick winConsider narrowing ESLint suppressions to specific lines.
File-wide ESLint suppressions reduce type safety across the entire file. If only a few operations require these suppressions (e.g., line 35's
output.dataaccess), prefer inline// eslint-disable-next-linecomments immediately above those lines instead of disabling rules for the entire file.This improves maintainability by keeping type safety active where possible and making it clear which specific operations require the suppressions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/translators/__tests__/benchmark.ts` around lines 1 - 4, Current file-wide ESLint disables at the top of src/translators/__tests__/benchmark.ts are too broad; remove those global disable comments and instead apply targeted inline disables only where needed (for example, the specific access to output.data in the benchmark test and any other single unsafe-member-access/unsafe-assignment/unsafe-argument occurrences). Locate the test that references output.data and replace the file-level suppressions with // eslint-disable-next-line comments immediately above the exact expressions (referencing the output variable and its use of .data) so the rest of the file retains normal TypeScript linting and type-safety.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 3: The package version in package.json is currently "3.4.0" but this
change is a breaking API change (removal of YandexTranslator from the stable
export), so bump the major version to "4.0.0" by updating the "version" field in
package.json (ensure the "version" key is changed from "3.4.0" to "4.0.0"); also
update any release notes/changelog and CI/release metadata that rely on the
package version to reflect the major bump.
---
Outside diff comments:
In `@README.md`:
- Around line 87-110: The README example imports YandexTranslator from the
stable barrel but YandexTranslator is in the unstable subdirectory; update the
import path in the example so the import uses the unstable barrel (replace
import { YandexTranslator } from 'anylang/translators' with the unstable import
path) to prevent broken examples for users trying to instantiate
YandexTranslator in the README example.
---
Nitpick comments:
In `@src/translators/__tests__/benchmark.ts`:
- Around line 1-4: Current file-wide ESLint disables at the top of
src/translators/__tests__/benchmark.ts are too broad; remove those global
disable comments and instead apply targeted inline disables only where needed
(for example, the specific access to output.data in the benchmark test and any
other single unsafe-member-access/unsafe-assignment/unsafe-argument
occurrences). Locate the test that references output.data and replace the
file-level suppressions with // eslint-disable-next-line comments immediately
above the exact expressions (referencing the output variable and its use of
.data) so the rest of the file retains normal TypeScript linting and
type-safety.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c8e5ebff-811f-416d-9a1e-576a249bcf9d
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonsrc/translators/__tests__/__snapshots__/translators.benchmark.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (8)
README.mdpackage.jsonsrc/translators/__tests__/benchmark.tssrc/translators/__tests__/translators.benchmark.test.tssrc/translators/__tests__/translators.test.tssrc/translators/index.tssrc/translators/unstable/YandexTranslator/YandexSidFetcher.tssrc/translators/unstable/YandexTranslator/index.ts
💤 Files with no reviewable changes (3)
- src/translators/tests/translators.test.ts
- src/translators/index.ts
- src/translators/tests/translators.benchmark.test.ts
Closes #138
It seems the YandexTranslate module is unstable. It sometimes work, sometimes don't.
The captcha solving is solves a problem, but next challenge happens in few minutes.
So we move the YandexTranslate module into unstable dir.