Skip to content

Commit a0b7593

Browse files
authoredJan 15, 2025··
fix: don't include non-size properties in logo option (#1857)
## PR Checklist - [x] Addresses an existing open issue: fixes #1856 - [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 Adds the extra `type: "ping"` to tests to be sure. 💖
1 parent d8d6917 commit a0b7593

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎src/shared/options/readLogoSizing.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("readLogoSizing", () => {
3434
it("returns the height when imageSize returns only a height smaller than the maximum", () => {
3535
const height = 100;
3636

37-
mockImageSize.mockReturnValueOnce({ height });
37+
mockImageSize.mockReturnValueOnce({ height, type: "png" });
3838

3939
const actual = readLogoSizing(src);
4040

@@ -44,7 +44,7 @@ describe("readLogoSizing", () => {
4444
it("returns maximum height when imageSize returns only a height greater than the maximum", () => {
4545
const height = 129;
4646

47-
mockImageSize.mockReturnValueOnce({ height });
47+
mockImageSize.mockReturnValueOnce({ height, type: "png" });
4848

4949
const actual = readLogoSizing(src);
5050

@@ -54,7 +54,7 @@ describe("readLogoSizing", () => {
5454
it("returns the width when imageSize returns only a width smaller than the maximum", () => {
5555
const width = 100;
5656

57-
mockImageSize.mockReturnValueOnce({ width });
57+
mockImageSize.mockReturnValueOnce({ type: "png", width });
5858

5959
const actual = readLogoSizing(src);
6060

@@ -64,7 +64,7 @@ describe("readLogoSizing", () => {
6464
it("returns maximum width when imageSize returns only a width greater than the maximum", () => {
6565
const width = 129;
6666

67-
mockImageSize.mockReturnValueOnce({ width });
67+
mockImageSize.mockReturnValueOnce({ type: "png", width });
6868

6969
const actual = readLogoSizing(src);
7070

@@ -75,7 +75,7 @@ describe("readLogoSizing", () => {
7575
const height = 101;
7676
const width = 102;
7777

78-
mockImageSize.mockReturnValueOnce({ height, width });
78+
mockImageSize.mockReturnValueOnce({ height, type: "png", width });
7979

8080
const actual = readLogoSizing(src);
8181

@@ -86,7 +86,7 @@ describe("readLogoSizing", () => {
8686
const height = 1280;
8787
const width = 1000;
8888

89-
mockImageSize.mockReturnValueOnce({ height, width });
89+
mockImageSize.mockReturnValueOnce({ height, type: "png", width });
9090

9191
const actual = readLogoSizing(src);
9292

@@ -97,7 +97,7 @@ describe("readLogoSizing", () => {
9797
const height = 1000;
9898
const width = 1280;
9999

100-
mockImageSize.mockReturnValueOnce({ height, width });
100+
mockImageSize.mockReturnValueOnce({ height, type: "png", width });
101101

102102
const actual = readLogoSizing(src);
103103

‎src/shared/options/readLogoSizing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function readLogoSizing(
2424
}
2525

2626
if (size.height <= maximum && size.width <= maximum) {
27-
return size;
27+
return { height: size.height, width: size.width };
2828
}
2929

3030
return size.height > size.width

0 commit comments

Comments
 (0)
Please sign in to comment.