| ... | ... | @@ -126,6 +126,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 126 | 126 | it.effect("prefers a t3.json iconPath over well-known files", () => |
| 127 | 127 | Effect.gen(function* () { |
| 128 | 128 | const resolver = yield* ProjectFaviconResolver.ProjectFaviconResolver; |
| 129 | const path = yield* Path.Path; |
| 129 | 130 | const cwd = yield* makeTempDir; |
| 130 | 131 | yield* writeTextFile(cwd, "t3.json", '{ "iconPath": "brand/mark.svg" }'); |
| 131 | 132 | yield* writeTextFile(cwd, "brand/mark.svg", "<svg>mark</svg>"); |
| ... | ... | @@ -134,13 +135,14 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 134 | 135 | const resolved = yield* resolver.resolvePath(cwd); |
| 135 | 136 | |
| 136 | 137 | expect(resolved).not.toBeNull(); |
| 137 | | expect(resolved).toContain("brand/mark.svg"); |
| 138 | expect(resolved).toBe(path.join(cwd, "brand", "mark.svg")); |
| 138 | 139 | }), |
| 139 | 140 | ); |
| 140 | 141 | |
| 141 | 142 | it.effect("uses a saved project favicon override", () => |
| 142 | 143 | Effect.gen(function* () { |
| 143 | 144 | const resolver = yield* ProjectFaviconResolver.ProjectFaviconResolver; |
| 145 | const path = yield* Path.Path; |
| 144 | 146 | const cwd = yield* makeTempDir; |
| 145 | 147 | yield* writeTextFile(cwd, "brand/custom.svg", "<svg>custom</svg>"); |
| 146 | 148 | yield* writeTextFile(cwd, "favicon.svg", "<svg>automatic</svg>"); |
| ... | ... | @@ -148,7 +150,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 148 | 150 | const resolved = yield* resolver.resolvePath(cwd, "brand/custom.svg"); |
| 149 | 151 | |
| 150 | 152 | expect(resolved).not.toBeNull(); |
| 151 | | expect(resolved).toContain("brand/custom.svg"); |
| 153 | expect(resolved).toBe(path.join(cwd, "brand", "custom.svg")); |
| 152 | 154 | }), |
| 153 | 155 | ); |
| 154 | 156 | |
| ... | ... | @@ -232,7 +234,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 232 | 234 | const resolved = yield* resolver.resolvePath(cwd); |
| 233 | 235 | |
| 234 | 236 | expect(resolved).not.toBeNull(); |
| 235 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 237 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 236 | 238 | }), |
| 237 | 239 | ); |
| 238 | 240 | |
| ... | ... | @@ -257,7 +259,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 257 | 259 | const resolved = yield* resolver.resolvePath(cwd); |
| 258 | 260 | |
| 259 | 261 | expect(resolved).not.toBeNull(); |
| 260 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 262 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 261 | 263 | }), |
| 262 | 264 | ); |
| 263 | 265 | |
| ... | ... | @@ -275,7 +277,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 275 | 277 | const resolved = yield* resolver.resolvePath(cwd); |
| 276 | 278 | |
| 277 | 279 | expect(resolved).not.toBeNull(); |
| 278 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 280 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 279 | 281 | }), |
| 280 | 282 | ); |
| 281 | 283 | |
| ... | ... | @@ -293,7 +295,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 293 | 295 | const resolved = yield* resolver.resolvePath(cwd); |
| 294 | 296 | |
| 295 | 297 | expect(resolved).not.toBeNull(); |
| 296 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 298 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 297 | 299 | }), |
| 298 | 300 | ); |
| 299 | 301 | |
| ... | ... | @@ -311,7 +313,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 311 | 313 | const resolved = yield* resolver.resolvePath(cwd); |
| 312 | 314 | |
| 313 | 315 | expect(resolved).not.toBeNull(); |
| 314 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 316 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 315 | 317 | }), |
| 316 | 318 | ); |
| 317 | 319 | |
| ... | ... | @@ -459,7 +461,7 @@ it.layer(TestLayer)("ProjectFaviconResolverLive", (it) => { |
| 459 | 461 | const resolved = yield* resolver.resolvePath(cwd); |
| 460 | 462 | |
| 461 | 463 | expect(resolved).not.toBeNull(); |
| 462 | | expect(resolved).toContain("public/brand/logo.svg"); |
| 464 | expect(resolved).toBe((yield* Path.Path).join(cwd, "public", "brand", "logo.svg")); |
| 463 | 465 | }), |
| 464 | 466 | ); |
| 465 | 467 | }); |