Skip to content

Conversation

@lucgonp
Copy link

@lucgonp lucgonp commented Nov 6, 2025

  • Document createfs() helper with TypeScript types and examples
  • Add cli/test/README.md with comprehensive testing guide
  • Provide Given/When/Then examples and debugging tips
  • Remove TODO comment about documentation needs

This addresses the TODO in cli/test/lib/tasks/verify.spec.ts about badly needed documentation.

  • Closes

Additional details

Steps to test

How has the user experience changed?

PR Tasks


Note

Adds a comprehensive CLI test suite README and documents/types the createfs() helper in lib/tasks/verify.spec.ts.

  • Documentation:
    • New cli/test/README.md: Overview of test structure, commands, mocking strategies, common patterns (Given/When/Then), debugging, coverage, and contribution checklist.
  • Tests:
    • createfs() helper in cli/test/lib/tasks/verify.spec.ts:
      • Add detailed JSDoc with examples and filesystem structure.
      • Introduce CreateFileSystemOptions TypeScript interface and type the function.
      • Remove outdated TODO about missing documentation.

Written by Cursor Bugbot for commit db8845b. This will update automatically on new commits. Configure here.

- Document createfs() helper with TypeScript types and examples
- Add cli/test/README.md with comprehensive testing guide
- Provide Given/When/Then examples and debugging tips
- Remove TODO comment about documentation needs

This addresses the TODO in cli/test/lib/tasks/verify.spec.ts about badly needed documentation.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cypress-app-bot
Copy link
Collaborator

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Default-Value Triggers Unintended Symlink Creation

The condition if (customDir) will always be true because customDir is set to a default value earlier in the function (line 958). This causes the symlink at /custom/Contents/MacOS/Cypress to be created for all tests, even when no custom directory was provided. The condition should check if a custom directory was originally provided by the caller, not just if the variable is truthy. This could be fixed by checking the original parameter value or using a different condition like checking if customDir doesn't equal the default value.

cli/test/lib/tasks/verify.spec.ts#L995-L1001

https://github.com/cypress-io/cypress/blob/db8845b7357805d40d6650675eb0148c52c8cd45/cli/test/lib/tasks/verify.spec.ts#L995-L1001

Fix in Cursor Fix in Web


Comment on lines +44 to +48
### Prerequisites

Ensure you have Node.js and Yarn installed:
- Node.js: ^20.1.0 || ^22.0.0 || >=24.0.0
- Yarn: Latest stable
Copy link
Contributor

Choose a reason for hiding this comment

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

This is incorrect. See https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md#requirements for Node.js and Yarn.

yarn set version stable

will install the wrong version: Yarn Modern v4.x

Yarn v1 Classic is needed.

cd cli && yarn test-debug

# Run specific test by pattern
cd cli && yarn test --grep "should verify successfully"
Copy link
Contributor

Choose a reason for hiding this comment

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

This fails:

$ yarn test --grep "should verify successfully"
yarn run v1.22.22
$ yarn test-unit --grep 'should verify successfully'
$ vitest run --grep 'should verify successfully'
file:///home/mike/github/cypress-io/cypress/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:404
          throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
                ^

CACError: Unknown option `--grep`

Copy link
Contributor

@MikeMcC399 MikeMcC399 left a comment

Choose a reason for hiding this comment

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

I only commented on a couple of issues without reviewing the whole PR.

The CLA is not signed.

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.

4 participants