update templatingTask test
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user