Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Motivation/Description of the PR

When no helpers are configured, the codeceptjs def command generated invalid TypeScript definitions that broke IDE auto-completion for the I actor. The generated steps.d.ts referenced an undefined Methods interface:

// Before (broken)
declare namespace CodeceptJS {
  interface SupportObject { I: I, current: any }
  
  interface I extends WithTranslation<Methods> {}  // Methods undefined
}
// After (fixed)
declare namespace CodeceptJS {
  interface SupportObject { I: I, current: any }
  interface Methods {}  // Now defined
  interface I extends WithTranslation<Methods> {}
}

Fix: Modified lib/command/definitions.js to always generate the Methods interface, even when empty.

Applicable helpers:

  • All helpers (affects type definitions generation)

Applicable plugins:

  • All plugins (affects type definitions generation)

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • google.com
    • Triggering command: node /home/REDACTED/work/CodeceptJS/CodeceptJS/bin/codecept.js run --config /home/REDACTED/work/CodeceptJS/CodeceptJS/test/data/sandbox/codecept.bdd.js --grep @fail --steps (dns block)
  • googlechromelabs.github.io
    • Triggering command: node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.168/linux64/chrome-linux64.zip
    • Triggering command: node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt
  • investigate and fix the issue that no auto suggested methods of I actor are shown in test file when using I actor.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 20, 2025 16:10
When no helpers are configured, the Methods interface was not being generated,
causing TypeScript to fail resolving the type referenced in interface I.
This broke auto-completion for the I actor methods.

The fix ensures that the Methods interface is always generated, even when
empty, so that 'interface I extends WithTranslation<Methods>' always
references a valid type.

Co-authored-by: kobenguyent <[email protected]>
Copilot AI changed the title [WIP] Investigate and fix issue with auto suggested methods in I actor Fix TypeScript definitions generation when no helpers configured Nov 20, 2025
Copilot AI requested a review from kobenguyent November 20, 2025 16:24
Copilot finished work on behalf of kobenguyent November 20, 2025 16:24
@kobenguyent kobenguyent marked this pull request as ready for review November 20, 2025 17:13
@kobenguyent kobenguyent merged commit 262935d into 4.x Nov 20, 2025
10 checks passed
@kobenguyent kobenguyent deleted the copilot/fix-auto-suggested-methods-issue branch November 20, 2025 17:14
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