Skip to content

Commit b04641d

Browse files
Reset generateTopContent.test.ts
1 parent 15d3d65 commit b04641d

File tree

1 file changed

+89
-89
lines changed

1 file changed

+89
-89
lines changed

src/steps/writeReadme/generateTopContent.test.ts

+89-89
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,94 @@ describe("findExistingBadges", () => {
8787
`<img alt="TypeScript: Strict" src="invalid svg" />`,
8888
]),
8989
).toMatchInlineSnapshot(`
90+
"<h1 align=\\"center\\"></h1>
91+
92+
<p align=\\"center\\"></p>
93+
94+
<p align=\\"center\\">
95+
<a href=\\"#contributors\\" target=\\"_blank\\">
96+
<!-- prettier-ignore-start -->
97+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
98+
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
99+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
100+
<!-- prettier-ignore-end -->
101+
</a>
102+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
103+
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
104+
</a>
105+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
106+
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
107+
</a>
108+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
109+
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
110+
</a>
111+
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
112+
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
113+
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
114+
</p>
115+
116+
## Usage
117+
118+
\`\`\`shell
119+
npm i
120+
\`\`\`
121+
\`\`\`ts
122+
import { greet } from \\"\\";
123+
124+
greet(\\"Hello, world! 💖\\");
125+
\`\`\`"
126+
`);
127+
});
128+
129+
it("push existing badges to the end when there is an existing unknown badge", () => {
130+
expect(
131+
generateTopContent(optionsBase, [
132+
`<img alt="Unknown Badge" src="unknown.svg" />`,
133+
]),
134+
).toMatchInlineSnapshot(`
135+
"<h1 align=\\"center\\"></h1>
136+
137+
<p align=\\"center\\"></p>
138+
139+
<p align=\\"center\\">
140+
<a href=\\"#contributors\\" target=\\"_blank\\">
141+
<!-- prettier-ignore-start -->
142+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
143+
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
144+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
145+
<!-- prettier-ignore-end -->
146+
</a>
147+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
148+
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
149+
</a>
150+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
151+
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
152+
</a>
153+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
154+
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
155+
</a>
156+
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
157+
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
158+
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
159+
<img alt=\\"Unknown Badge\\" src=\\"unknown.svg\\" />
160+
</p>
161+
162+
## Usage
163+
164+
\`\`\`shell
165+
npm i
166+
\`\`\`
167+
\`\`\`ts
168+
import { greet } from \\"\\";
169+
170+
greet(\\"Hello, world! 💖\\");
171+
\`\`\`"
172+
`);
173+
});
174+
175+
it("does not include a greet section when the mode is migrate", () => {
176+
expect(generateTopContent({ ...optionsBase, mode: "migrate" }, []))
177+
.toMatchInlineSnapshot(`
90178
"<h1 align=\\"center\\"></h1>
91179
92180
<p align=\\"center\\"></p>
@@ -111,95 +199,7 @@ describe("findExistingBadges", () => {
111199
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
112200
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
113201
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
114-
</p>
115-
116-
## Usage
117-
118-
\`\`\`shell
119-
npm i
120-
\`\`\`
121-
\`\`\`ts
122-
import { greet } from \\"\\";
123-
124-
greet(\\"Hello, world! 💖\\");
125-
\`\`\`"
202+
</p>"
126203
`);
127204
});
128-
129-
it("push existing badges to the end when there is an existing unknown badge", () => {
130-
expect(
131-
generateTopContent(optionsBase, [
132-
`<img alt="Unknown Badge" src="unknown.svg" />`,
133-
]),
134-
).toMatchInlineSnapshot(`
135-
"<h1 align=\\"center\\"></h1>
136-
137-
<p align=\\"center\\"></p>
138-
139-
<p align=\\"center\\">
140-
<a href=\\"#contributors\\" target=\\"_blank\\">
141-
<!-- prettier-ignore-start -->
142-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
143-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
144-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
145-
<!-- prettier-ignore-end -->
146-
</a>
147-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
148-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
149-
</a>
150-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
151-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
152-
</a>
153-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
154-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
155-
</a>
156-
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
157-
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
158-
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
159-
<img alt=\\"Unknown Badge\\" src=\\"unknown.svg\\" />
160-
</p>
161-
162-
## Usage
163-
164-
\`\`\`shell
165-
npm i
166-
\`\`\`
167-
\`\`\`ts
168-
import { greet } from \\"\\";
169-
170-
greet(\\"Hello, world! 💖\\");
171-
\`\`\`"
172-
`);
173-
});
174-
175-
it("does not include a greet section when the mode is migrate", () => {
176-
expect(generateTopContent({ ...optionsBase, mode: "migrate" }, []))
177-
.toMatchInlineSnapshot(`
178-
"<h1 align=\\"center\\"></h1>
179-
180-
<p align=\\"center\\"></p>
181-
182-
<p align=\\"center\\">
183-
<a href=\\"#contributors\\" target=\\"_blank\\">
184-
<!-- prettier-ignore-start -->
185-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
186-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
187-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
188-
<!-- prettier-ignore-end -->
189-
</a>
190-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
191-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
192-
</a>
193-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
194-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
195-
</a>
196-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
197-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
198-
</a>
199-
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
200-
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
201-
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
202-
</p>"
203-
`);
204-
});
205205
});

0 commit comments

Comments
 (0)