A sample app to test Keploy integration capabilities with realtime subscriptions such as SSE
git clone https://github.com/keploy/samples-go.git && cd samples-go/sse-svelte
go mod downloadUsing the docker-compose file we will start our mongodb instance:-
# Start Postgres
docker-compose up mongoNow, we will create the binary of our application:-
go build -coverOnce we have our applicaiton binary ready, we will start the application with keploy to start capturing the testcases.
sudo -E keploy record "./sse-mongo"We will capture our test from the UI written in Svelte.js
cd svelte-app && npm install && npm run devNow let's click on GetTime button to trigger the event. We would notice that keploy will capture those calls : -

Now let's run the test mode :-
keploy test -c "./sse-mongo" --delay 10 --goCoverageOutput should look like : -
So no need to setup fake database/apis like Postgres or write mocks for them. Keploy automatically mocks them and, The application thinks it's talking to MongoDb 😄. And with just few clicks we were able to get 42% code coverage of our go backend application.
