-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't wrap words in blockPackageJson description (#1874)
## PR Checklist - [x] Addresses an existing open issue: fixes #1873 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview 2af8204 shows the `\n` in the test. 💖
- Loading branch information
1 parent
3d651f2
commit e49f518
Showing
2 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,19 @@ import { describe, expect, test } from "vitest"; | |
import { blockPackageJson } from "./blockPackageJson.js"; | ||
import { optionsBase } from "./options.fakes.js"; | ||
|
||
const options = { | ||
...optionsBase, | ||
description: `A very very very very very very very very very very very very very very very very long <em><code>HTML-ish</code> description</em> ending with an emoji. 🧵`, | ||
}; | ||
|
||
describe("blockPackageJson", () => { | ||
test("without addons or mode", () => { | ||
const creation = testBlock(blockPackageJson, { | ||
options: optionsBase, | ||
}); | ||
const creation = testBlock(blockPackageJson, { options }); | ||
|
||
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"A very very very very very very very very very very very very very very very very long HTML-ish description ending with an emoji. 🧵","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
@@ -30,13 +33,13 @@ describe("blockPackageJson", () => { | |
test("migration mode", () => { | ||
const creation = testBlock(blockPackageJson, { | ||
mode: "migrate", | ||
options: optionsBase, | ||
options, | ||
}); | ||
|
||
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"A very very very very very very very very very very very very very very very very long HTML-ish description ending with an emoji. 🧵","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
@@ -67,13 +70,13 @@ describe("blockPackageJson", () => { | |
other: true, | ||
}, | ||
}, | ||
options: optionsBase, | ||
options, | ||
}); | ||
|
||
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"A very very very very very very very very very very very very very very very very long HTML-ish description ending with an emoji. 🧵","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
@@ -102,13 +105,13 @@ describe("blockPackageJson", () => { | |
other: true, | ||
}, | ||
}, | ||
options: optionsBase, | ||
options, | ||
}); | ||
|
||
expect(creation).toMatchInlineSnapshot(` | ||
{ | ||
"files": { | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}", | ||
"package.json": "{"name":"test-repository","version":"0.0.0","description":"A very very very very very very very very very very very very very very very very long HTML-ish description ending with an emoji. 🧵","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"[email protected]"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}", | ||
}, | ||
"scripts": [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters