|
1 |
| -import { writeFileSync } from "node:fs"; |
| 1 | +import { writeFile, mkdir } from "node:fs/promises"; |
2 | 2 | import { mockAccountId, mockApiToken } from "./helpers/mock-account-id";
|
3 | 3 | import { setMockResponse, unsetAllMocks } from "./helpers/mock-cfetch";
|
4 | 4 | import { mockConsoleMethods } from "./helpers/mock-console";
|
@@ -276,7 +276,7 @@ describe("pages", () => {
|
276 | 276 | });
|
277 | 277 |
|
278 | 278 | it("should upload a directory of files", async () => {
|
279 |
| - writeFileSync("logo.png", "foobar"); |
| 279 | + await writeFile("logo.png", "foobar"); |
280 | 280 |
|
281 | 281 | setMockResponse(
|
282 | 282 | "/accounts/:accountId/pages/projects/foo/file",
|
@@ -323,5 +323,28 @@ describe("pages", () => {
|
323 | 323 | // ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/"
|
324 | 324 | // `);
|
325 | 325 | });
|
| 326 | + |
| 327 | + it("should not error when directory names contain periods", async () => { |
| 328 | + await mkdir(".well-known"); |
| 329 | + await writeFile(".well-known/foobar.png", "foobar"); |
| 330 | + |
| 331 | + setMockResponse( |
| 332 | + "/accounts/:accountId/pages/projects/foo/file", |
| 333 | + async () => ({ |
| 334 | + id: "2082190357cfd3617ccfe04f340c6247", |
| 335 | + }) |
| 336 | + ); |
| 337 | + |
| 338 | + setMockResponse( |
| 339 | + "/accounts/:accountId/pages/projects/foo/deployments", |
| 340 | + async () => ({ |
| 341 | + url: "https://abcxyz.foo.pages.dev/", |
| 342 | + }) |
| 343 | + ); |
| 344 | + |
| 345 | + await runWrangler("pages publish . --project-name=foo"); |
| 346 | + |
| 347 | + expect(std.err).toMatchInlineSnapshot(`""`); |
| 348 | + }); |
326 | 349 | });
|
327 | 350 | });
|
0 commit comments