| id | samples-sse | |||||||
|---|---|---|---|---|---|---|---|---|
| title | Sample Real-Time App (Svelte) | |||||||
| sidebar_label | SSE + Svelte + MongoDB | |||||||
| description | The following sample app tests Keploy integration capabilities with realtime subscriptions such as SSE | |||||||
| tags |
|
|||||||
| keyword |
|
🪄 Dive into the world of realtime subscriptions and see how seamlessly Keploy integrates with SSE and MongoDB Buckle up, it's gonna be a fun ride! 🎢
import InstallationGuide from '../concepts/installation.md'
Ways you can run this sample application.
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.
