fakevercel

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fakevercel is a read-only stand-in for the Vercel REST API, shaped from the documented responses the importer consumes. Any request that is not a GET is rejected and recorded, so a test can assert the importer never writes to Vercel.

Index

Constants

View Source
const (
	Token     = "fake-vercel-token" //nolint:gosec // fixture value
	TeamID    = "team_acme"
	ProjWeb   = "prj_web"
	ProjDocs  = "prj_docs"
	ProjBare  = "prj_bare"
	SecretVal = "enc-blob-should-never-surface" //nolint:gosec // fixture value
)

Fixture identifiers other packages assert on.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {

	// Empty makes the team hold no projects.
	Empty bool
	// contains filtered or unexported fields
}

Server is the fake. Create it with New and serve Handler.

func New

func New() *Server

New returns a fake with the default fixture.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler serves the fake API. The project list is split over two pages.

func (*Server) Queries

func (s *Server) Queries() []string

Queries returns the raw query of every request received.

func (*Server) Requests

func (s *Server) Requests() []string

Requests returns "METHOD path" for every request received.

func (*Server) Violations

func (s *Server) Violations() []string

Violations returns every request that was not a GET.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL