A VS Code extension that helps you write two-go API tests faster. two-go is a zero-dependency fluent service and API testing library for Node. You build an HTTP request with a chainable API and attach checks like expectStatus, expectHeader, and expectJson.
This extension provides ready-to-use snippets and a command that inserts a complete test skeleton at your cursor.
The snippets are available in both JavaScript and TypeScript files.
go-get- Build a GET request chain with status and JSON checks.go-post- Build a POST request with a JSON body and checks.expect-status- Insert an.expectStatus(...)assertion.expect-json- Insert an.expectJson(...)assertion for a JSON path.two-go-test- Insert a fullnode:testtest wrapping a two-go request chain.
two-go: Insert API Test Skeleton(two-go.newTest) - Inserts a small two-go test skeleton at the cursor. Open the Command Palette and search for the command title to run it.
await go("https://api.example.com")
.get("/users")
.expectStatus(200)
.expectJson("data[0].id", 1);- Clone this repository and open the folder in VS Code.
- Press
F5to launch an Extension Development Host window with the extension loaded. - In the new window, open a
.jsor.tsfile and type one of the snippet prefixes, or runtwo-go: Insert API Test Skeletonfrom the Command Palette.
MIT