Skip to content

Commit 2ae1ee3

Browse files
committed
fix test script
1 parent d70badb commit 2ae1ee3

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,27 @@ You call the above using:
121121
❯ curl 'http://localhost:3000/user/find?id=1'
122122
null%
123123

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
124145
❯ curl -X 'POST' 'http://localhost:3000/user/create' \
125146
-H 'Content-Type: application/json' \
126147
-d '{"name": "Art", "email": "[email protected]"}'

packages/test-app-express-esm/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ test/jest-e2e.json
3838
test/app.e2e-spec.ts
3939
src/app.module.ts
4040
src/auth.guard.ts
41+
src/decorators
4142
src/user
43+
src/test

packages/test-app-fastify-cjs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ test/jest-e2e.json
3838
test/app.e2e-spec.ts
3939
src/app.module.ts
4040
src/auth.guard.ts
41+
src/decorators
4142
src/user
43+
src/test

packages/test-app-fastify-esm/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ test/jest-e2e.json
3838
test/app.e2e-spec.ts
3939
src/app.module.ts
4040
src/auth.guard.ts
41+
src/decorators
4142
src/user
43+
src/test

scripts/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ set -e
33
__dirname=$(dirname "$0")
44

55
pnpm --filter "test-app-*" --filter "!test-app-express-cjs" exec sh -c "\
6-
rm -rf src/user && \
76
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/ && \
88
cp -r ../test-app-express-cjs/src/user ./src/ && \
9+
cp -r ../test-app-express-cjs/src/test ./src/ && \
910
cp ../test-app-express-cjs/test/jest-e2e.json ../test-app-express-cjs/test/app.e2e-spec.ts ./test/ \
1011
"
1112

0 commit comments

Comments
 (0)