File tree Expand file tree Collapse file tree 5 files changed +29
-1
lines changed Expand file tree Collapse file tree 5 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,27 @@ You call the above using:
121
121
❯ curl ' http://localhost:3000/user/find?id=1'
122
122
null%
123
123
124
+ # bad input
125
+ ❯ curl -s -X ' POST' ' http://localhost:3000/user/create' \
126
+ -H ' Content-Type: application/json' \
127
+ -d
' {"name": "Art", "emailTYPO": "[email protected] "}' | jq
128
+ {
129
+ " statusCode" : 400,
130
+ " message" : " Validation failed" ,
131
+ " errors" : [
132
+ {
133
+ " code" : " invalid_type" ,
134
+ " expected" : " string" ,
135
+ " received" : " undefined" ,
136
+ " path" : [
137
+ " email"
138
+ ],
139
+ " message" : " Required"
140
+ }
141
+ ]
142
+ }
143
+
144
+ # success
124
145
❯ curl -X ' POST' ' http://localhost:3000/user/create' \
125
146
-H ' Content-Type: application/json' \
126
147
-d
' {"name": "Art", "email": "[email protected] "}'
Original file line number Diff line number Diff line change @@ -38,4 +38,6 @@ test/jest-e2e.json
38
38
test /app.e2e-spec.ts
39
39
src /app.module.ts
40
40
src /auth.guard.ts
41
+ src /decorators
41
42
src /user
43
+ src /test
Original file line number Diff line number Diff line change @@ -38,4 +38,6 @@ test/jest-e2e.json
38
38
test /app.e2e-spec.ts
39
39
src /app.module.ts
40
40
src /auth.guard.ts
41
+ src /decorators
41
42
src /user
43
+ src /test
Original file line number Diff line number Diff line change @@ -38,4 +38,6 @@ test/jest-e2e.json
38
38
test /app.e2e-spec.ts
39
39
src /app.module.ts
40
40
src /auth.guard.ts
41
+ src /decorators
41
42
src /user
43
+ src /test
Original file line number Diff line number Diff line change 3
3
__dirname=$( dirname " $0 " )
4
4
5
5
pnpm --filter " test-app-*" --filter " !test-app-express-cjs" exec sh -c " \
6
- rm -rf src/user && \
7
6
cp ../test-app-express-cjs/src/app.module.ts ../test-app-express-cjs/src/auth.guard.ts ./src/ && \
7
+ cp -r ../test-app-express-cjs/src/decorators ./src/ && \
8
8
cp -r ../test-app-express-cjs/src/user ./src/ && \
9
+ cp -r ../test-app-express-cjs/src/test ./src/ && \
9
10
cp ../test-app-express-cjs/test/jest-e2e.json ../test-app-express-cjs/test/app.e2e-spec.ts ./test/ \
10
11
"
11
12
You can’t perform that action at this time.
0 commit comments