update templatingTask test

This commit is contained in:
Fabian Chong
2020-09-16 14:56:28 +08:00
parent 4f59fb341e
commit 21aa93ad46
3 changed files with 7 additions and 5 deletions
@@ -228,10 +228,7 @@ export default async (cmd: Command) => {
? `@${cmd.scope.replace(/^@/, '')}/plugin-${answers.id}`
: `plugin-${answers.id}`;
const scopeName = cmd.scope ? `@${cmd.scope.replace(/^@/, '')}` : '';
const npmRegistry =
cmd.npmRegistry && cmd.scope
? `"${scopeName}:registry": "${cmd.npmRegistry}"`
: '';
const npmRegistry = cmd.npmRegistry && cmd.scope ? cmd.npmRegistry : '';
const privatePackage = cmd.private === false ? false : true;
const isMonoRepo = await fs.pathExists(paths.resolveTargetRoot('lerna.json'));
const appPackage = paths.resolveTargetRoot('packages/app');
+5
View File
@@ -37,6 +37,11 @@ describe('templatingTask', () => {
try {
await templatingTask(tmplDir, destDir, {
version: '0.0.0',
backstageVersiona: '0.0.0',
scopeName: '@backstage',
name: '@backstage/plugin-test',
privatePackage: true,
npmRegistry: 'https://registry.npmjs.org/',
});
await expect(
@@ -7,7 +7,7 @@
{{#if privatePackage}} "private": {{privatePackage}},
{{/if}}
"publishConfig": {
{{#if npmRegistry}} {{{npmRegistry}}},
{{#if npmRegistry}} "{{scopeName}}:registry": "{{npmRegistry}}",
{{/if}}
"access": "public",
"main": "dist/index.esm.js",