Skip to content

Commit

Permalink
fix(create): normalize quotes and indents in generated test and lib f…
Browse files Browse the repository at this point in the history
…iles (#3529)
  • Loading branch information
teddybradford committed Feb 9, 2023
1 parent 6b50725 commit ad39fe2
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 46 deletions.
52 changes: 26 additions & 26 deletions e2e/create/src/create.spec.ts
Expand Up @@ -95,7 +95,7 @@ describe("lerna-create", () => {
module.exports = noOptions;
function noOptions() {
return "Hello from noOptions";
return 'Hello from noOptions';
}
`);
Expand All @@ -110,7 +110,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(noOptions(), 'Hello from noOptions');
console.info("noOptions tests passed");
console.info('noOptions tests passed');
`);
});
Expand Down Expand Up @@ -188,7 +188,7 @@ describe("lerna-create", () => {
module.exports = optionBin;
function optionBin() {
return "Hello from optionBin";
return 'Hello from optionBin';
}
`);
Expand All @@ -205,7 +205,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionBin(), 'Hello from optionBin');
console.info("optionBin tests passed");
console.info('optionBin tests passed');
`);
});
Expand Down Expand Up @@ -274,7 +274,7 @@ describe("lerna-create", () => {
module.exports = optionDescription;
function optionDescription() {
return "Hello from optionDescription";
return 'Hello from optionDescription';
}
`);
Expand All @@ -291,7 +291,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionDescription(), 'Hello from optionDescription');
console.info("optionDescription tests passed");
console.info('optionDescription tests passed');
`);
});
Expand Down Expand Up @@ -367,7 +367,7 @@ describe("lerna-create", () => {
module.exports = optionDependencies;
function optionDependencies() {
return "Hello from optionDependencies";
return 'Hello from optionDependencies';
}
`);
Expand All @@ -384,7 +384,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionDependencies(), 'Hello from optionDependencies');
console.info("optionDependencies tests passed");
console.info('optionDependencies tests passed');
`);
});
Expand Down Expand Up @@ -451,7 +451,7 @@ describe("lerna-create", () => {
const file = await fixture.readWorkspaceFile(`packages/${packageName}/src/${packageName}.js`);
expect(file).toMatchInlineSnapshot(`
export default function optionEsModule() {
return "Hello from optionEsModule";
return 'Hello from optionEsModule';
}
`);
Expand All @@ -466,7 +466,7 @@ describe("lerna-create", () => {
import { strict as assert } from 'assert';
assert.strictEqual(optionEsModule(), 'Hello from optionEsModule');
console.info("optionEsModule tests passed");
console.info('optionEsModule tests passed');
`);
});
Expand Down Expand Up @@ -536,7 +536,7 @@ describe("lerna-create", () => {
module.exports = optionHomepage;
function optionHomepage() {
return "Hello from optionHomepage";
return 'Hello from optionHomepage';
}
`);
Expand All @@ -553,7 +553,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionHomepage(), 'Hello from optionHomepage');
console.info("optionHomepage tests passed");
console.info('optionHomepage tests passed');
`);
});
Expand Down Expand Up @@ -626,7 +626,7 @@ describe("lerna-create", () => {
module.exports = optionKeywords;
function optionKeywords() {
return "Hello from optionKeywords";
return 'Hello from optionKeywords';
}
`);
Expand All @@ -643,7 +643,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionKeywords(), 'Hello from optionKeywords');
console.info("optionKeywords tests passed");
console.info('optionKeywords tests passed');
`);
});
Expand Down Expand Up @@ -712,7 +712,7 @@ describe("lerna-create", () => {
module.exports = optionLicense;
function optionLicense() {
return "Hello from optionLicense";
return 'Hello from optionLicense';
}
`);
Expand All @@ -729,7 +729,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionLicense(), 'Hello from optionLicense');
console.info("optionLicense tests passed");
console.info('optionLicense tests passed');
`);
});
Expand Down Expand Up @@ -799,7 +799,7 @@ describe("lerna-create", () => {
module.exports = optionPrivate;
function optionPrivate() {
return "Hello from optionPrivate";
return 'Hello from optionPrivate';
}
`);
Expand All @@ -816,7 +816,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(optionPrivate(), 'Hello from optionPrivate');
console.info("optionPrivate tests passed");
console.info('optionPrivate tests passed');
`);
});
Expand Down Expand Up @@ -889,7 +889,7 @@ describe("lerna-create", () => {
module.exports = withScope;
function withScope() {
return "Hello from withScope";
return 'Hello from withScope';
}
`);
Expand All @@ -906,7 +906,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(withScope(), 'Hello from withScope');
console.info("withScope tests passed");
console.info('withScope tests passed');
`);
});
Expand Down Expand Up @@ -978,7 +978,7 @@ describe("lerna-create", () => {
module.exports = withScopeAndAccess;
function withScopeAndAccess() {
return "Hello from withScopeAndAccess";
return 'Hello from withScopeAndAccess';
}
`);
Expand All @@ -995,7 +995,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(withScopeAndAccess(), 'Hello from withScopeAndAccess');
console.info("withScopeAndAccess tests passed");
console.info('withScopeAndAccess tests passed');
`);
});
Expand Down Expand Up @@ -1067,7 +1067,7 @@ describe("lerna-create", () => {
module.exports = withScopeAndRegistry;
function withScopeAndRegistry() {
return "Hello from withScopeAndRegistry";
return 'Hello from withScopeAndRegistry';
}
`);
Expand All @@ -1084,7 +1084,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(withScopeAndRegistry(), 'Hello from withScopeAndRegistry');
console.info("withScopeAndRegistry tests passed");
console.info('withScopeAndRegistry tests passed');
`);
});
Expand Down Expand Up @@ -1157,7 +1157,7 @@ describe("lerna-create", () => {
module.exports = withScopeAndTag;
function withScopeAndTag() {
return "Hello from withScopeAndTag";
return 'Hello from withScopeAndTag';
}
`);
Expand All @@ -1174,7 +1174,7 @@ describe("lerna-create", () => {
const assert = require('assert').strict;
assert.strictEqual(withScopeAndTag(), 'Hello from withScopeAndTag');
console.info("withScopeAndTag tests passed");
console.info('withScopeAndTag tests passed');
`);
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/publish/src/from-git-recover-from-error.spec.ts
Expand Up @@ -82,7 +82,7 @@ describe("lerna-publish-from-git-recover-from-error", () => {
lerna notice
lerna notice 📦 test-2@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-2.js
lerna notice 90B lib/test-2.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down
2 changes: 1 addition & 1 deletion e2e/publish/src/publish-npm-workspace-prefix.spec.ts
Expand Up @@ -217,7 +217,7 @@ describe("lerna-publish-workspace-prefix", () => {
lerna notice
lerna notice 📦 test-main@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice XXXB lib/test-main.js
lerna notice XXXB lib/test-main.js
lerna notice XXXB package.json
lerna notice XXXB README.md
lerna notice === Tarball Details ===
Expand Down
4 changes: 2 additions & 2 deletions e2e/publish/src/publish-npm.spec.ts
Expand Up @@ -64,7 +64,7 @@ describe("lerna-publish-npm", () => {
lerna notice
lerna notice 📦 test-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-1.js
lerna notice 90B lib/test-1.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("lerna-publish-npm", () => {
lerna notice
lerna notice 📦 test-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-1.js
lerna notice 90B lib/test-1.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down
2 changes: 1 addition & 1 deletion e2e/publish/src/publish-pnpm-workspace-prefix.spec.ts
Expand Up @@ -217,7 +217,7 @@ describe("lerna-publish-workspace-prefix-pnpm", () => {
lerna notice
lerna notice 📦 test-main@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice XXXB lib/test-main.js
lerna notice XXXB lib/test-main.js
lerna notice XXXB package.json
lerna notice XXXB README.md
lerna notice === Tarball Details ===
Expand Down
2 changes: 1 addition & 1 deletion e2e/publish/src/publish-pnpm.spec.ts
Expand Up @@ -64,7 +64,7 @@ describe("lerna-publish-pnpm", () => {
lerna notice
lerna notice 📦 test-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-1.js
lerna notice 90B lib/test-1.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down
4 changes: 2 additions & 2 deletions e2e/publish/src/publish-yarn.spec.ts
Expand Up @@ -64,7 +64,7 @@ describe("lerna-publish-yarn", () => {
lerna notice
lerna notice 📦 test-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-1.js
lerna notice 90B lib/test-1.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("lerna-publish-yarn", () => {
lerna notice
lerna notice 📦 test-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 92B lib/test-1.js
lerna notice 90B lib/test-1.js
lerna notice XXXB package.json
lerna notice 110B README.md
lerna notice === Tarball Details ===
Expand Down
8 changes: 4 additions & 4 deletions libs/commands/create/src/index.ts
Expand Up @@ -434,7 +434,7 @@ class CreateCommand extends Command {
const libContent = this.options.esModule
? dedent`
export default function ${this.camelName}() {
return "Hello from ${this.camelName}";
return 'Hello from ${this.camelName}';
}
`
: dedent`
Expand All @@ -443,7 +443,7 @@ class CreateCommand extends Command {
module.exports = ${this.camelName};
function ${this.camelName}() {
return "Hello from ${this.camelName}";
return 'Hello from ${this.camelName}';
}
`;

Expand All @@ -457,7 +457,7 @@ class CreateCommand extends Command {
import { strict as assert } from 'assert';
assert.strictEqual(${this.camelName}(), 'Hello from ${this.camelName}');
console.info("${this.camelName} tests passed");
console.info('${this.camelName} tests passed');
`
: dedent`
'use strict';
Expand All @@ -466,7 +466,7 @@ class CreateCommand extends Command {
const assert = require('assert').strict;
assert.strictEqual(${this.camelName}(), 'Hello from ${this.camelName}');
console.info("${this.camelName} tests passed");
console.info('${this.camelName} tests passed');
`;

return catFile(this.testDir, this.testFileName, testContent);
Expand Down

0 comments on commit ad39fe2

Please sign in to comment.