-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor tests #158
Refactor tests #158
Conversation
🦋 Changeset detectedLatest commit: ff01e6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks! I have one optional suggestion, but feel free to merge if you don't want to bother with it
baseUrl: '/src/', | ||
paths: { | ||
'@/*': ['./*'], | ||
'@/*': ['/users/user/project/src/*'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (non-blocking): this is slightly incorrect from the perspective of tsconfig semantics. When baseUrl
is set, paths
are computed relative to it. Therefore, it's a little strange when baseUrl
and the alias resolve to completely different locations
suggestion:
baseUrl: '/src/', | |
paths: { | |
'@/*': ['./*'], | |
'@/*': ['/users/user/project/src/*'], | |
baseUrl: '/users/user/project/src/', | |
paths: { | |
'@/*': ['./*'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're completely right. I'm surprised that it hasn't broken anything
@@ -6,7 +6,9 @@ import importLocality from './index.js' | |||
vi.mock('tsconfck', async (importOriginal) => { | |||
return { | |||
...(await importOriginal<typeof import('tsconfck')>()), | |||
parse: vi.fn(() => Promise.resolve({ tsconfig: { compilerOptions: { paths: { '@/*': ['/*'] } } } })), | |||
parse: vi.fn(() => | |||
Promise.resolve({ tsconfig: { compilerOptions: { paths: { '@/*': ['/users/user/project/src/*'] } } } }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: but here, for instance, it's fine because the alias was already an absolute path, so it's okay to just replace it
Closes #128