Skip to content

Conversation

ferrandiaz
Copy link
Contributor

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

Support testDir: './test' or testDir: 'test' in playwright.config file

@sorccu
Copy link
Member

sorccu commented Oct 10, 2025

Can you show/prove that this change actually does something? path.resolve() is going to prepend the path with process.cwd() if the path is not already absolute. I would assume that glob also starts from process.cwd() if given a relative path. Based on a quick test executed in the packages/cli folder of this repo, I don't think this does anything:

const path = require('node:path')
const { glob } = require('glob')

const option1 = await glob('**/*.spec.ts', { cwd: './src', absolute: true })
const option2 = await glob('**/*.spec.ts', { cwd: 'src', absolute: true })
const option3 = await glob('**/*.spec.ts', { cwd: path.resolve('src'), absolute: true })

JSON.stringify(option1.sort()) === JSON.stringify(option2.sort()) // true
JSON.stringify(option1.sort()) === JSON.stringify(option3.sort()) // true

Copy link
Member

@sorccu sorccu left a comment

Choose a reason for hiding this comment

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

Check my comment.

@ferrandiaz ferrandiaz requested a review from sorccu October 10, 2025 09:34
@sorccu
Copy link
Member

sorccu commented Oct 10, 2025

Can you describe what the updated PR does? Explain the issue too.

@ferrandiaz
Copy link
Contributor Author

ferrandiaz commented Oct 10, 2025

Can you describe what the updated PR does? Explain the issue too.

@sorccu
When passing a relative directory path (like "foo" instead of "./foo" or an absolute path) to findRegexFiles, the function would return incorrect relative file paths.
In the case of "foo" it will not return a thing

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