Skip to content

Fix normalizeSnapshot when repository path contains special characters#178

Closed
lPernod-sorare wants to merge 2 commits intodominikg:mainfrom
lPernod-sorare:fix-dot-fixture-path
Closed

Fix normalizeSnapshot when repository path contains special characters#178
lPernod-sorare wants to merge 2 commits intodominikg:mainfrom
lPernod-sorare:fix-dot-fixture-path

Conversation

@lPernod-sorare
Copy link
Copy Markdown
Contributor

No description provided.

@dominikg
Copy link
Copy Markdown
Owner

Hi, thank you for sending PRs. It would be great if you could give examples of what exactly this fixes.

@lPernod-sorare
Copy link
Copy Markdown
Contributor Author

lPernod-sorare commented Jun 26, 2024

When cloning the repository into a folder that contained a . (/Users/loic.pernod/git-workspace) the tests did not pass on main with the following diffs:
I've only added one failure here for brevity

-               "baseUrl": "<fixture-dir>/parse/valid/with_extends/paths",
+               "baseUrl": "/Users/loic.pernod/git-workspace/tsconfck/packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths",

Investigating more, I found that the fixtureDirRegex was incorrect:

{
  fixtures: '/Users/loic.pernod/git-workspace/tsconfck/packages/tsconfck/tests/fixtures',
  fixtureDirRegex: /[/\\]Users[/\\]loic[/\\].pernod[/\\]git-workspace[/\\]tsconfck[/\\]packages[/\\]tsconfck[/\\]tests[/\\]fixtures/g
}

The second replace was matching the \ in \. after the first replace, instead of only matching on two backslashes.

@dominikg
Copy link
Copy Markdown
Owner

included in #179

@dominikg dominikg closed this Jun 27, 2024
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