Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock Request.redirect() #191

Open
markjaquith opened this issue Mar 16, 2021 · 1 comment
Open

Mock Request.redirect() #191

markjaquith opened this issue Mar 16, 2021 · 1 comment

Comments

@markjaquith
Copy link

Request.redirect() isn't currently mocked.

https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect

I'm currently using this:

Response.redirect = (url: string, status: number = 302) =>
	new Response(null, {
		headers: {
			Location: url,
		},
		status,
	}
);
@yinzara
Copy link
Collaborator

yinzara commented Mar 19, 2021

Agreed, I think it's worth adding this if you wanted to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants