Skip to content

Commit 2af8204

Browse files
fix: don't wrap words in blockPackageJson description
1 parent 3d651f2 commit 2af8204

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/next/blocks/blockPackageJson.test.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ import { describe, expect, test } from "vitest";
44
import { blockPackageJson } from "./blockPackageJson.js";
55
import { optionsBase } from "./options.fakes.js";
66

7+
const options = {
8+
...optionsBase,
9+
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. 🧵`,
10+
};
11+
712
describe("blockPackageJson", () => {
813
test("without addons or mode", () => {
9-
const creation = testBlock(blockPackageJson, {
10-
options: optionsBase,
11-
});
14+
const creation = testBlock(blockPackageJson, { options });
1215

1316
expect(creation).toMatchInlineSnapshot(`
1417
{
1518
"files": {
16-
"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"]}",
19+
"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\\nvery 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"]}",
1720
},
1821
"scripts": [
1922
{
@@ -30,13 +33,13 @@ describe("blockPackageJson", () => {
3033
test("migration mode", () => {
3134
const creation = testBlock(blockPackageJson, {
3235
mode: "migrate",
33-
options: optionsBase,
36+
options,
3437
});
3538

3639
expect(creation).toMatchInlineSnapshot(`
3740
{
3841
"files": {
39-
"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"]}",
42+
"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\\nvery 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"]}",
4043
},
4144
"scripts": [
4245
{
@@ -67,13 +70,13 @@ describe("blockPackageJson", () => {
6770
other: true,
6871
},
6972
},
70-
options: optionsBase,
73+
options,
7174
});
7275

7376
expect(creation).toMatchInlineSnapshot(`
7477
{
7578
"files": {
76-
"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}",
79+
"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\\nvery 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}",
7780
},
7881
"scripts": [
7982
{
@@ -102,13 +105,13 @@ describe("blockPackageJson", () => {
102105
other: true,
103106
},
104107
},
105-
options: optionsBase,
108+
options,
106109
});
107110

108111
expect(creation).toMatchInlineSnapshot(`
109112
{
110113
"files": {
111-
"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}",
114+
"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\\nvery 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}",
112115
},
113116
"scripts": [
114117
{

0 commit comments

Comments
 (0)