You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0.0/quickstart/express-postgresql-prisma.md
+45-17Lines changed: 45 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,14 @@ keyword:
18
18
- Auto Testcase generation
19
19
---
20
20
21
-
## Introduction
21
+
import InstallReminder from '@site/src/components/InstallReminder';
22
+
import SectionDivider from '@site/src/components/SectionDivider';
22
23
23
-
A sample Task Management application and see how seamlessly Keploy integrates with Express, [PostgreSQL](https://www.postgresql.org/) and Prisma ORM. Buckle up, it's gonna be a fun ride! π’
24
+
## Running App Locally on Linux/WSL
24
25
25
-
import InstallationGuide from '../concepts/installation.md'
26
+
A sample Task Management application and see how seamlessly Keploy integrates with Express, PostgreSQL and Prisma ORM. Buckle up, it's gonna be a fun ride!
@@ -175,7 +172,46 @@ The above command will start recording the API calls made to the application and
175
172
176
173
> π‘ You can use Postman or any other API testing tool to test the API calls. Additionally, the application will run a swagger UI on `http://localhost:3000/api/docs` to visualize the API calls.
177
174
178
-
### Running App using Docker Compose π³
175
+
#### Test the Application
176
+
177
+
```bash
178
+
keploy test -c "npm start"
179
+
```
180
+
181
+
<SectionDivider />
182
+
183
+
## Running App using Docker Compose π³
184
+
185
+
A sample Task Management application and see how seamlessly Keploy integrates with Express, PostgreSQL and Prisma ORM. Buckle up, it's gonna be a fun ride!
186
+
187
+
<InstallReminder />
188
+
189
+
### Prerequisites
190
+
191
+
Ensure you have the following installed:
192
+
193
+
- Docker
194
+
- Node.js and npm
195
+
- Keploy CLI
196
+
197
+
Clone the repository and move to express-postgresql-prisma folder
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0.0/quickstart/nextjs-postgres.md
+9-14Lines changed: 9 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,15 +13,16 @@ keyword:
13
13
- Auto Testcase generation
14
14
---
15
15
16
-
## Introduction
16
+
## Running App Locally on Linux/WSL π§
17
17
18
18
This is a sample app to test Keploy integration capabilities using NextJS and Postgres with Drizzle ORM. Buckle up, it's gonna be a fun ride! π’
19
19
20
-
import InstallationGuide from '../concepts/installation.md'
20
+
import Link from '@docusaurus/Link'
21
+
import InstallReminder from '@site/src/components/InstallReminder';
21
22
22
-
<InstallationGuide/>
23
+
<InstallReminder/>
23
24
24
-
## Get Started! π¬
25
+
###Get Started! π¬
25
26
26
27
Now that we have bun installed, we will se tup our application.
27
28
@@ -35,12 +36,6 @@ npm install
35
36
docker-compose up
36
37
```
37
38
38
-
## Installation π₯
39
-
40
-
-[Using Docker container for Postgres and running application locally](#running-app-locally-on-linuxwsl-)
41
-
42
-
## Running App Locally on Linux/WSL π§
43
-
44
39
We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (Redis) chill on Docker. Ready? Let's get the party started!π
45
40
46
41
### Capture testcase
@@ -51,6 +46,8 @@ Ready, set, record! Here's how:
51
46
sudo -E env PATH=$PATH keploy record -c 'npm run dev'
Give yourself a pat on the back! With that simple spell, you've conjured up test cases with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
88
85
@@ -96,7 +93,7 @@ Time to put things to the test π§ͺ
96
93
sudo -E env PATH=$PATH keploy test -c "npm run dev" --delay 10
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
102
99
@@ -105,5 +102,3 @@ Final thoughts? Dive deeper! Try different API calls, tweak the DB response in t
105
102
### Wrapping it up π
106
103
107
104
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible. ππ
108
-
109
-
Hope this helps you out, if you still have any questions, reach out to us .
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
108
-
109
-
Your results should be looking all _snazzy_, like this:
102
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-test-express-new-mongo.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }} />
110
103
111
-
<img src="/docs/img/testrun-node-fail.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }} />
112
-
113
-
Worry not, just add the ever-changing fields (like our **ts** here) to the **noise parameter** to **dodge those assertions**.
104
+
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
114
105
115
-
<img src="/docs/img/testrun-node-pass.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
106
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-result-express-new-mongo.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
116
107
117
108
### Wrapping it up π
118
109
119
110
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.ππ
We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (mongoDB) chill on Docker. Ready? Let's get the party started!π
126
134
127
135
If you are using WSL on windows then use below to start wsl in the user's home directory:
sudo -E env PATH=$PATH keploy record -c 'node src/app.js'
155
163
```
156
164
165
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongoose-record-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
166
+
157
167
Keep an eye out for the `-c `flag! It's the command charm to run the app.
158
168
159
169
Alright, magician! With the app alive and kicking, let's weave some test cases. The spell? Making some API calls! Postman, Hoppscotch, or the classic curl - pick your wand.
π Woohoo! Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
183
193
184
-
<img src="/docs/img/testcase-node.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
185
-
186
194
Now, the real fun begins. Let's weave more spells!
187
195
188
196
π Follow the URL road...!
189
197
190
198
```bash
191
-
curl --request GET \ --url http://localhost:8080/students
199
+
curl --request GET \ --url http://localhost:8000/students
192
200
```
193
201
194
202
Or simply wander over to your browser and visit `http://localhost:8000/students`.
@@ -203,12 +211,12 @@ Ready to put your spells to the test?
Worry not, just add the ever-changing fields (like our **ts** here) to the **noise parameter** to **dodge those assertions**.
214
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongo-test-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
207
215
208
-
<img src="/docs/img/testrun-node-pass.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
216
+
output should look like
217
+
218
+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongooose-result-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
209
219
210
220
### Wrapping it up π
211
221
212
222
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.ππ
213
-
214
-
Hope this helps you out, if you still have any questions, reach out to us .
0 commit comments