Skip to content
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

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Refactor tests #158

merged 3 commits into from
Jan 2, 2025

Conversation

daniilsapa
Copy link
Collaborator

Closes #128

Copy link

changeset-bot bot commented Dec 30, 2024

🦋 Changeset detected

Latest commit: ff01e6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@feature-sliced/steiger-plugin Patch
steiger Patch

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

Copy link
Member

@illright illright left a 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

Comment on lines 13 to 15
baseUrl: '/src/',
paths: {
'@/*': ['./*'],
'@/*': ['/users/user/project/src/*'],
Copy link
Member

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:

Suggested change
baseUrl: '/src/',
paths: {
'@/*': ['./*'],
'@/*': ['/users/user/project/src/*'],
baseUrl: '/users/user/project/src/',
paths: {
'@/*': ['./*'],

Copy link
Collaborator Author

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/*'] } } } }),
Copy link
Member

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

@daniilsapa daniilsapa merged commit 66d6f40 into next Jan 2, 2025
7 checks passed
@daniilsapa daniilsapa deleted the feature/refactor-tests branch January 2, 2025 22:52
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