-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add test for global add with prefix #1919
Conversation
This PR doesn't fix the issue of add-without-flag test. After
After
As you can see in #1918, i solved this issue by adding
to runGlobal function. to make sure that all global test will NOT Use the global bin folder |
@onemen I'm confused. Why this PR need to fix it? And, I also didn't mention anywhere that it does. Also, your PR and this PR is mutually exclusive. Or I'm missing anything here?
I have already told you in another place that the test I wrote is not an ideal one and doesn't cover everything. That was a basic guard so that we don't ship global completely broken, like we did in And, similarly this PR to address just a specific bug, just to prevent regression.
|
This is a valid concern. So, please fix your PR so that we can merge it. |
That's odd, in my local fork it pass
I'm on windows 10 the files copy to |
a9482ad
to
dd66858
Compare
test.concurrent('add with prefix flag', async (): Promise<void> => { | ||
await fs.unlink(tmpGlobalFolder); | ||
return runGlobal('add', {prefix: tmpGlobalFolder}, ['react-native-cli'], 'add-with-prefix-flag', async (config) => { | ||
assert.ok(await fs.exists(path.join(tmpGlobalFolder, 'bin', 'react-native'))); |
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.
See the modification I have made in #1918 to fix the path on different platform
Change this line accordingly:
- assert.ok(await fs.exists(path.join(tmpGlobalFolder, 'bin', 'react-native')));
+ assert.ok(await fs.exists(path.join(getBinFolder(tmpGlobalFolder), 'react-native')));
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.
Thanks
dd66858
to
b2a65b9
Compare
b2a65b9
to
7b5052a
Compare
Hi, @torifat. |
@bestander No. Because of #2007 I have closed this one and created a new PR at #2025. |
Cool, I'll get to it as soon as I clear some debts |
It failed 😄 I have to make it pass first. |
Summary
Test case for
global add <package> --prefix <path>
Covers #1877