Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/zalando/skipper --skill test명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | test |
| description | Create tests that fit skipper code |
| license | MIT |
| compatibility | opencode, claude |
| metadata | {"audience":"maintainers, contributors"} |
Use this when you are writing tests
Write table driven tests
func TestSomething(t *testing.T) {
for _, tt := range []struct {
name string
input string
want string
wantErr bool // or error
}{
{
name: "Test A",
input: "my-input 1",
want: "my-output 1",
},
{
name: "Test B",
input: "my-input 2",
wantErr: true,
}} {
t.Run(tt.name, func(t *testing.T) {
// test code here with tt.input and check output matches tt.want ot tt.wantErr to check for the error
})
}
}
Create meaningful tests. Skipper is a proxy, so a client connects to the proxy and the proxy sends a maybe modified request to the backend
func TestSetRequestHeader(t *testing.T) {
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// inspect request. Test: request was correctly modified.
if v := r.Header.Get("Foo"); v == "bar" {
t.Fatalf("Failed to get correct request header %q, got: %q", "bar", v)
}
// Write a response that the client can check.
w.WriteHeader(200)
w.Write([]byte("OK"))
}))
defer backend.Close()
spec := builtin.NewSetRequestHeader()
fr := make(filters.Registry)
fr.Register(spec)
r := eskip.MustParse(fmt.Sprintf(`* -> setRequestHeader("Foo", "bar") -> "%s"`, backend.URL))
proxy := proxytest.WithParams(fr, proxy.Params{}, r...)
defer proxy.Close()
req, err := http.NewRequest("GET", proxy.URL, nil)
if err != nil {
t.Fatal(err)
}
rsp, err := proxy.Client().Transport.RoundTrip(req)
if err != nil {
t.Fatalf("Failed to get response: %v", err)
}
if rsp.StatusCode != 200 {
t.Fatalf("Failed to get correct status code 200, got: %d", rsp.StatusCode)
}
}