-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wrangler deploy prompts warning with deployment
- Loading branch information
Showing
5 changed files
with
218 additions
and
3 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
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
97 changes: 97 additions & 0 deletions
97
packages/wrangler/src/__tests__/helpers/msw/handlers/versions.ts
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 |
---|---|---|
@@ -1,5 +1,102 @@ | ||
import { http, HttpResponse } from "msw"; | ||
import { createFetchResult } from "../index"; | ||
import type { ApiDeployment, ApiVersion } from "../../../../versions/types"; | ||
|
||
export const mswListNewDeploymentsLatestFull = [ | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/deployments", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
deployments: [ | ||
{ | ||
id: `deployment:${params["scriptName"]}`, | ||
source: "api", | ||
strategy: "percentage", | ||
author_email: "[email protected]", | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
versions: [ | ||
{ | ||
version_id: `${params["scriptName"]}:version:0`, | ||
percentage: 100.0, | ||
}, | ||
], | ||
}, | ||
] as Array<ApiDeployment>, | ||
}) | ||
); | ||
}, | ||
{ once: true } | ||
), | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/versions/:version", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
id: params["version"], | ||
number: 1, | ||
metadata: { | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
modified_on: "2021-01-01T00:00:00.000000Z", | ||
source: "api", | ||
author_email: "[email protected]", | ||
}, | ||
} as ApiVersion) | ||
); | ||
}, | ||
{ once: false } | ||
), | ||
]; | ||
|
||
export const mswListNewDeploymentsLatestFiftyFifty = [ | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/deployments", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
deployments: [ | ||
{ | ||
id: `deployment:${params["scriptName"]}`, | ||
source: "api", | ||
strategy: "percentage", | ||
author_email: "[email protected]", | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
versions: [ | ||
{ | ||
version_id: `${params["scriptName"]}:version:0`, | ||
percentage: 50.0, | ||
}, | ||
{ | ||
version_id: `${params["scriptName"]}:version:1`, | ||
percentage: 50.0, | ||
}, | ||
], | ||
}, | ||
] as Array<ApiDeployment>, | ||
}) | ||
); | ||
}, | ||
{ once: true } | ||
), | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/versions/:version", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
id: params["version"], | ||
number: 1, | ||
metadata: { | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
modified_on: "2021-01-01T00:00:00.000000Z", | ||
source: "api", | ||
author_email: "[email protected]", | ||
}, | ||
} as ApiVersion) | ||
); | ||
}, | ||
{ once: false } | ||
), | ||
]; | ||
|
||
export const mswListNewDeployments = http.get( | ||
"*/accounts/:accountId/workers/scripts/:workerName/deployments", | ||
|
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
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