diff --git a/src/steps/writeReadme/generateTopContent.test.ts b/src/steps/writeReadme/generateTopContent.test.ts index 2003ed049..a3861d4ec 100644 --- a/src/steps/writeReadme/generateTopContent.test.ts +++ b/src/steps/writeReadme/generateTopContent.test.ts @@ -5,24 +5,24 @@ import { generateTopContent } from "./generateTopContent.js"; const optionsBase = { access: "public", - description: "", + description: "Test description", directory: ".", email: { github: "github@email.com", npm: "npm@email.com", }, mode: "create", - owner: "", - repository: "", - title: "", + owner: "test-owner", + repository: "test-repository", + title: "Test Title", } satisfies Options; describe("findExistingBadges", () => { it("generates full contents when there are no existing badges", () => { expect(generateTopContent(optionsBase, [])).toMatchInlineSnapshot(` - "

+ "

Test Title

-

+

Test description

@@ -30,21 +30,21 @@ describe("findExistingBadges", () => { All Contributors: 2 - Codecov Test Coverage - Contributor Covenant - License: MIT + Codecov Test Coverage + Contributor Covenant + License: MIT Style: Prettier TypeScript: Strict - npm package version + npm package version

## Usage \`\`\`shell - npm i + npm i test-repository \`\`\` \`\`\`ts - import { greet } from ""; + import { greet } from "test-repository"; greet("Hello, world! 💖"); \`\`\`" @@ -57,9 +57,9 @@ describe("findExistingBadges", () => { `TypeScript: Strict`, ]), ).toMatchInlineSnapshot(` - "

+ "

Test Title

-

+

Test description

@@ -67,21 +67,21 @@ describe("findExistingBadges", () => { All Contributors: 2 - Codecov Test Coverage - Contributor Covenant - License: MIT + Codecov Test Coverage + Contributor Covenant + License: MIT Style: Prettier TypeScript: Strict - npm package version + npm package version

## Usage \`\`\`shell - npm i + npm i test-repository \`\`\` \`\`\`ts - import { greet } from ""; + import { greet } from "test-repository"; greet("Hello, world! 💖"); \`\`\`" @@ -94,9 +94,9 @@ describe("findExistingBadges", () => { `Unknown Badge`, ]), ).toMatchInlineSnapshot(` - "

+ "

Test Title

-

+

Test description

@@ -104,22 +104,22 @@ describe("findExistingBadges", () => { All Contributors: 2 - Codecov Test Coverage - Contributor Covenant - License: MIT + Codecov Test Coverage + Contributor Covenant + License: MIT Style: Prettier TypeScript: Strict - npm package version + npm package version Unknown Badge

## Usage \`\`\`shell - npm i + npm i test-repository \`\`\` \`\`\`ts - import { greet } from ""; + import { greet } from "test-repository"; greet("Hello, world! 💖"); \`\`\`" @@ -129,9 +129,9 @@ describe("findExistingBadges", () => { it("does not include a greet section when the mode is migrate", () => { expect(generateTopContent({ ...optionsBase, mode: "migrate" }, [])) .toMatchInlineSnapshot(` - "

+ "

Test Title

-

+

Test description

@@ -139,12 +139,12 @@ describe("findExistingBadges", () => { All Contributors: 2 - Codecov Test Coverage - Contributor Covenant - License: MIT + Codecov Test Coverage + Contributor Covenant + License: MIT Style: Prettier TypeScript: Strict - npm package version + npm package version

" `); }); diff --git a/src/steps/writeReadme/generateTopContent.ts b/src/steps/writeReadme/generateTopContent.ts index 04256e65b..ed882230b 100644 --- a/src/steps/writeReadme/generateTopContent.ts +++ b/src/steps/writeReadme/generateTopContent.ts @@ -58,7 +58,7 @@ export function generateTopContent(options: Options, existingBadges: string[]) { /typescript.*strict/i, ], [ - `npm package version`, + `npm package version`, /npm.*v/i, ], ] as const) { diff --git a/src/steps/writeReadme/index.test.ts b/src/steps/writeReadme/index.test.ts index a8977dcde..d4a59a986 100644 --- a/src/steps/writeReadme/index.test.ts +++ b/src/steps/writeReadme/index.test.ts @@ -66,7 +66,7 @@ describe("writeReadme", () => { Sponsor: On GitHub Style: Prettier TypeScript: Strict - npm package version + npm package version

## Usage @@ -127,7 +127,7 @@ describe("writeReadme", () => { Sponsor: On GitHub Style: Prettier TypeScript: Strict - npm package version + npm package version

## Usage @@ -191,7 +191,7 @@ describe("writeReadme", () => { Sponsor: On GitHub Style: Prettier TypeScript: Strict - npm package version + npm package version

## Usage @@ -289,7 +289,7 @@ describe("writeReadme", () => { Sponsor: On GitHub Style: Prettier TypeScript: Strict - npm package version + npm package version All Contributors: 2