Skip to content

Build mocks automatically just by running your app

License

Notifications You must be signed in to change notification settings

speedscale/proxymock

Repository files navigation

Build Latest Version

Speedscale proxymock

Speedscale proxymock lets you run your app as if it were in a live environment, even when backend services are not available. proxymock records your application's behavior while it runs in the debugger and automatically generates mock servers (and soon tests!) based on the application's behavior. Just run your app normally in Visual Studio Code and proxymock will automatically listen to all the API and database calls coming out of your application (inbound coming soon!). If you want to learn more about how proxymock works, you can find information on the formal docs site

Next time you run your app, you will have the option of running a mock server generated by proxymock instead of needing a dev or test environment. You don't need to change your endpoints or database connections, proxymock is a passive listener. You don't need to change your code, this process is automated. This extension is free to use for local development. No strings attached.

If you want to deploy any of these mocks or tests in the cloud, you can sign up for a free account here for our enterprise service. proxymock (and the CLI behind it) is made by Speedscale.

Demo GIF

NOTE: Only Golang is currently supported (but nodejs and Java are in development)

  • Automatically generate mock servers and service mocks
  • Uses REAL data to generate mocks (and tests)
  • Integrates with Speedscale Cloud service for remote recording - pull production or staging environments to your desktop
  • (Coming soon) Automatically generate regression (correctness) tests
  • (Coming soon) Generates load (multiplied traffic) for your application based on the recorded application's behavior

Installation

Build from Source

Run the following set of commands to build and install from source:

git clone https://github.com/speedscale/proxymock
cd proxymock
pnpm build
LATEST_VSIX=$(ls -t package-versions/*.vsix | head -1)
code --uninstall-extension speedscale.proxymock
code --install-extension "$LATEST_VSIX"

Visual Studio Code Marketplace

  1. Open VS Code
  2. Go to the Extensions Marketplace (Ctrl+Shift+X)
  3. Search for "Speedscale Proxymock"
  4. Click Install

Usage (Creating a Mock Server)

You can find a full demo app and getting started guide here. Once you're in VS Code with the proxymock extension installed, you can use the following:

  1. Click the PROXYMOCK icon in the left sidebar navigation (it looks like a white Speedscale logo)
  2. Click "Start Recording" and then select your launch package as if you were running the normal golang debugger.
  3. Run some outbound transactions and watch them appear.
  4. Click the "Learn" Editor Command at the top right of the PROXYMOCK panel
  5. Your app will now be able to talk to the mock server instead of your app.

Yes, it's actually that easy but we recommend reading the getting started guide anyway to learn the nuances.