Commit 03d9c36b authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by Enrique Alcántara

Fix npm command getter

- source
- tests
parent eacdaa70
......@@ -84,10 +84,10 @@ export const npmSetupCommand = ({ packageEntity, npmPath }) => (type = NpmManage
const scope = packageEntity.name.substring(0, packageEntity.name.indexOf('/'));
if (type === NpmManager.NPM) {
return `echo ${scope}:registry=${npmPath} >> .npmrc`;
return `echo ${scope}:registry=${npmPath}/ >> .npmrc`;
}
return `echo \\"${scope}:registry\\" \\"${npmPath}\\" >> .yarnrc`;
return `echo \\"${scope}:registry\\" \\"${npmPath}/\\" >> .yarnrc`;
};
export const nugetInstallationCommand = ({ packageEntity }) =>
......
---
title: Add Missing slash in 'Registry setup' section of npm packages
merge_request: 42360
author:
type: changed
......@@ -32,7 +32,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
<code-instruction-stub
copytext="Copy npm setup command"
instruction="echo @Test:registry=undefined >> .npmrc"
instruction="echo @Test:registry=undefined/ >> .npmrc"
label="npm command"
trackingaction="copy_npm_setup_command"
trackinglabel="code_instruction"
......@@ -40,7 +40,7 @@ exports[`NpmInstallation renders all the messages 1`] = `
<code-instruction-stub
copytext="Copy yarn setup command"
instruction="echo \\\\\\"@Test:registry\\\\\\" \\\\\\"undefined\\\\\\" >> .yarnrc"
instruction="echo \\\\\\"@Test:registry\\\\\\" \\\\\\"undefined/\\\\\\" >> .yarnrc"
label="yarn command"
trackingaction="copy_yarn_setup_command"
trackinglabel="code_instruction"
......
......@@ -78,7 +78,7 @@ describe('NpmInstallation', () => {
.at(2)
.props(),
).toMatchObject({
instruction: 'echo @Test:registry=undefined >> .npmrc',
instruction: 'echo @Test:registry=undefined/ >> .npmrc',
multiline: false,
trackingAction: TrackingActions.COPY_NPM_SETUP_COMMAND,
});
......@@ -90,7 +90,7 @@ describe('NpmInstallation', () => {
.at(3)
.props(),
).toMatchObject({
instruction: 'echo \\"@Test:registry\\" \\"undefined\\" >> .yarnrc',
instruction: 'echo \\"@Test:registry\\" \\"undefined/\\" >> .yarnrc',
multiline: false,
trackingAction: TrackingActions.COPY_YARN_SETUP_COMMAND,
});
......
......@@ -62,9 +62,9 @@ describe('Getters PackageDetails Store', () => {
const mavenSetupXmlBlock = generateMavenSetupXml();
const npmInstallStr = `npm i ${npmPackage.name}`;
const npmSetupStr = `echo @Test:registry=${registryUrl} >> .npmrc`;
const npmSetupStr = `echo @Test:registry=${registryUrl}/ >> .npmrc`;
const yarnInstallStr = `yarn add ${npmPackage.name}`;
const yarnSetupStr = `echo \\"@Test:registry\\" \\"${registryUrl}\\" >> .yarnrc`;
const yarnSetupStr = `echo \\"@Test:registry\\" \\"${registryUrl}/\\" >> .yarnrc`;
const nugetInstallationCommandStr = `nuget install ${nugetPackage.name} -Source "GitLab"`;
const nugetSetupCommandStr = `nuget source Add -Name "GitLab" -Source "${registryUrl}" -UserName <your_username> -Password <your_token>`;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment