-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure text fixtures directories, add test-utils.ts and add msw dep
- Loading branch information
1 parent
c7edd46
commit d96ce63
Showing
56 changed files
with
695 additions
and
174 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { http, HttpResponse } from "msw"; | ||
|
||
export function mockGithubDeployments({ | ||
githubUser, | ||
githubRepoName, | ||
}: { | ||
githubUser: string; | ||
githubRepoName: string; | ||
}) { | ||
return { | ||
handlers: [ | ||
http.post( | ||
`https://api.github.com/repos/${githubUser}/${githubRepoName}/deployments`, | ||
async ({ request }) => { | ||
if (request.headers.get("Authorization") === null) { | ||
return HttpResponse.text("error: no auth token", { status: 400 }); | ||
} | ||
|
||
return HttpResponse.json(null); | ||
}, | ||
), | ||
], | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { WranglerActionConfig } from "../wranglerAction"; | ||
|
||
export function getTestConfig({ | ||
config = {}, | ||
}: { | ||
config?: Partial<WranglerActionConfig>; | ||
} = {}): WranglerActionConfig { | ||
return Object.assign( | ||
{ | ||
WRANGLER_VERSION: "3.81.0", | ||
didUserProvideWranglerVersion: false, | ||
secrets: [], | ||
workingDirectory: "/src/test/fixtures", | ||
CLOUDFLARE_API_TOKEN: "foo", | ||
CLOUDFLARE_ACCOUNT_ID: "bar", | ||
ENVIRONMENT: "dev", | ||
VARS: [], | ||
COMMANDS: [], | ||
QUIET_MODE: false, | ||
PACKAGE_MANAGER: "npm", | ||
WRANGLER_OUTPUT_DIR: "/tmp/wranglerArtifacts", | ||
GITHUB_TOKEN: "xxxxyy23213123132131", | ||
} as const satisfies WranglerActionConfig, | ||
config, | ||
); | ||
} |
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
Oops, something went wrong.