Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Git diff of regenerated files
run: cd _examples && make diff

webrpc-interoperability:
webrpc-tests:
strategy:
matrix:
webrpc-version: [v0.11.0]
Expand All @@ -55,3 +55,5 @@ jobs:
run: cd tests && echo "$PWD/bin/${{ matrix.webrpc-version }}" >> $GITHUB_PATH
- name: Run interoperability tests
run: cd tests && ./test.sh
- name: Run typescript check
run: cd tests && npm run ts-check
6 changes: 5 additions & 1 deletion _examples/node-ts/webapp/client.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ const buildResponse = (res: Response): Promise<any> => {
try {
data = JSON.parse(text)
} catch(error) {
let message = ''
if (error instanceof Error) {
message = error.message
}
throw WebrpcBadResponseError.new({
status: res.status,
cause: `JSON.parse(): ${error.message || ''}: response text: ${text}`},
cause: `JSON.parse(): ${message}: response text: ${text}`},
)
}
if (!res.ok) {
Expand Down
6 changes: 5 additions & 1 deletion clientHelpers.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ const buildResponse = (res: Response): Promise<any> => {
try {
data = JSON.parse(text)
} catch(error) {
let message = ''
if (error instanceof Error) {
message = error.message
}
throw WebrpcBadResponseError.new({
status: res.status,
cause: `JSON.parse(): ${error.message || ''}: response text: ${text}`},
cause: `JSON.parse(): ${message}: response text: ${text}`},
)
}
if (!res.ok) {
Expand Down
24 changes: 22 additions & 2 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "index.js",
"scripts": {
"test": "./test.sh",
"vitest": "./node_modules/.bin/vitest run --reporter verbose --dir ./"
"vitest": "./node_modules/.bin/vitest run --reporter verbose --dir ./",
"prets-check": "webrpc-gen -schema=./test.ridl -target=../ -client -out=./client.ts",
"ts-check": "tsc --noEmit ./client.ts"
},
"repository": {
"type": "git",
Expand All @@ -18,6 +20,7 @@
},
"homepage": "https://github.com/webrpc/gen-typescript#readme",
"devDependencies": {
"typescript": "^5.1.6",
"vitest": "^0.25.6"
},
"engines": {
Expand Down